pub struct Registry { /* private fields */ }parse only.Expand description
Extension Registry that manages Substrait extensions
This registry is immutable and reusable across multiple plans. It provides URN + name based lookup for extension types. Function parsing will be added in a future update.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn new<I: IntoIterator<Item = ExtensionFile>>(
extensions: I,
) -> Result<Self, SimpleExtensionsError>
pub fn new<I: IntoIterator<Item = ExtensionFile>>( extensions: I, ) -> Result<Self, SimpleExtensionsError>
Create a new Global Registry from validated extension files.
Any duplicate URNs will raise an error.
Sourcepub fn extensions(&self) -> impl Iterator<Item = (&Urn, &SimpleExtensions)>
pub fn extensions(&self) -> impl Iterator<Item = (&Urn, &SimpleExtensions)>
Get an iterator over all extension files in this registry
Sourcepub fn from_core_extensions() -> Self
Available on crate feature extensions only.
pub fn from_core_extensions() -> Self
extensions only.Create a Global Registry from the built-in core extensions.
Most core extensions are included. Some are skipped due to bugs in the upstream YAML files (see https://github.com/substrait-io/substrait/issues/935).
Sourcepub fn get_type(&self, urn: &Urn, name: &str) -> Option<&CustomType>
pub fn get_type(&self, urn: &Urn, name: &str) -> Option<&CustomType>
Get a type by URN and name
Sourcepub fn get_scalar_function(
&self,
urn: &Urn,
name: &str,
) -> Option<&ScalarFunction>
pub fn get_scalar_function( &self, urn: &Urn, name: &str, ) -> Option<&ScalarFunction>
Get a scalar function by URN and name.
TODO: Add support for retrieving functions by their full signature shorthand (e.g., “add:i32_i32”).