Skip to main content

ResourceCodec

Trait ResourceCodec 

pub trait ResourceCodec {
    // Required methods
    fn store(&self, value: Box<dyn Any>) -> Result<Id, WireError>;
    fn load(&self, id: Id, view: TypeId) -> Result<Box<dyn Any>, WireError>;

    // Provided method
    fn refused(&self, _handler: &str) { ... }
}
Expand description

Resolves resource identities for the side of a synchronous boundary call.

Required Methods§

fn store(&self, value: Box<dyn Any>) -> Result<Id, WireError>

fn load(&self, id: Id, view: TypeId) -> Result<Box<dyn Any>, WireError>

Provided Methods§

fn refused(&self, _handler: &str)

Reports a refused erased view; codecs may log this once per caller and handler.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§