Skip to main content

PortableToolEmbedding

Trait PortableToolEmbedding 

Source
pub trait PortableToolEmbedding: PortableTool {
    type InitError: Error + WasmCompatSend + WasmCompatSync + 'static;
    type Context: for<'de> Deserialize<'de> + Serialize;
    type State: WasmCompatSend;

    // Required methods
    fn embedding_docs(&self) -> Vec<String>;
    fn context(&self) -> Self::Context;
    fn init(
        state: Self::State,
        context: Self::Context,
    ) -> Result<Self, Self::InitError>;
}
Expand description

A portable tool that can be embedded and reconstructed for discovery.

Required Associated Types§

Source

type InitError: Error + WasmCompatSend + WasmCompatSync + 'static

Failure returned while reconstructing the typed implementation.

Source

type Context: for<'de> Deserialize<'de> + Serialize

Serializable reconstruction data.

Source

type State: WasmCompatSend

Runtime initialization state supplied by the authoring integration.

Required Methods§

Source

fn embedding_docs(&self) -> Vec<String>

Documents used by a discovery implementation.

Source

fn context(&self) -> Self::Context

Serializable reconstruction data.

Source

fn init( state: Self::State, context: Self::Context, ) -> Result<Self, Self::InitError>

Reconstruct the typed implementation.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§