Skip to main content

InterfaceImplementation

Trait InterfaceImplementation 

Source
pub trait InterfaceImplementation<T>: InterfaceDefinition {
    // Required method
    fn dispatch(
        implementation: &T,
        operation: &str,
        arguments: BTreeMap<String, Value>,
    ) -> Result<Value, DispatchError>;
}
Expand description

Typed dispatch implemented by every generated interface companion.

T must implement the Rust interface trait associated with this definition. Host runtimes use this bound when an interface is explicitly exposed, so an object that does not implement that interface is rejected at compile time.

Required Methods§

Source

fn dispatch( implementation: &T, operation: &str, arguments: BTreeMap<String, Value>, ) -> Result<Value, DispatchError>

Validates, decodes, and dispatches one operation to implementation, then encodes and validates its result.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§