Skip to main content

ErasedResource

Trait ErasedResource 

Source
pub trait ErasedResource: Send + Sync {
    // Required methods
    fn definition(&self) -> ResourceDefinition;
    fn read_erased<'a>(&'a self, uri: &'a str) -> Option<BoxResourceFuture<'a>>;
}
Expand description

Type-erased wrapper enabling heterogeneous resource storage.

Required Methods§

Source

fn definition(&self) -> ResourceDefinition

Return the resource definition.

Source

fn read_erased<'a>(&'a self, uri: &'a str) -> Option<BoxResourceFuture<'a>>

Check if the incoming URI matches this resource’s pattern, extract variables, and execute read.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§