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§
Sourcefn from_args(args: &mut ArgsAccess<'_>) -> Result<Self, ExtensionError>
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.
Sourcefn to_args(
&self,
context: &ExtensionContext<'_>,
) -> Result<ExtensionArgs, ExtensionError>
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".