Skip to main content

Explainable

Trait Explainable 

Source
pub trait Explainable: Sized {
    // Required methods
    fn name() -> &'static str;
    fn from_args(args: &mut ArgsAccess<'_>) -> Result<Self, ExtensionError>;
    fn to_args(
        &self,
        context: &ExtensionContext<'_>,
    ) -> Result<ExtensionArgs, ExtensionError>;
}
Expand description

Maps a registered extension type to and from text-format arguments.

Implement this trait for each protobuf extension type you register with an ExtensionRegistry.

Required Methods§

Source

fn name() -> &'static str

Returns the name used in the text format and the extension registry.

Source

fn from_args(args: &mut ArgsAccess<'_>) -> Result<Self, ExtensionError>

Builds your extension value from its text-format arguments.

Read every named and positional argument the extension accepts from args. After this method returns Ok, ExtensionArgs::parse and the registry reject any arguments you did not access. If it returns Err, they return that error without checking for unhandled arguments. Output columns are not included in this check.

Source

fn to_args( &self, context: &ExtensionContext<'_>, ) -> Result<ExtensionArgs, ExtensionError>

Builds the text-format arguments for this value.

The context provides the relation’s inputs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§