Skip to main content

ErasedProcessor

Trait ErasedProcessor 

Source
pub trait ErasedProcessor: Send + Sync {
    // Required methods
    fn process<'a>(
        &'a self,
        context: &'a mut ProcessContext<'_>,
        settings: &'a dyn Settings,
        writer: &'a mut Writer,
    ) -> BoxedFuture<'a, Result<Box<dyn AssetMetaDyn>, ProcessError>>;
    fn deserialize_meta(
        &self,
        meta: &[u8],
    ) -> Result<Box<dyn AssetMetaDyn>, DeserializeMetaError>;
    fn type_path(&self) -> &'static str;
    fn short_type_path(&self) -> &'static str;
    fn default_meta(
        &self,
        processor_path_kind: MetaTypePathKind,
    ) -> Box<dyn AssetMetaDyn>;
}
Expand description

A type-erased variant of Process that enables interacting with processor implementations without knowing their type.

Required Methods§

Source

fn process<'a>( &'a self, context: &'a mut ProcessContext<'_>, settings: &'a dyn Settings, writer: &'a mut Writer, ) -> BoxedFuture<'a, Result<Box<dyn AssetMetaDyn>, ProcessError>>

Type-erased variant of Process::process.

Source

fn deserialize_meta( &self, meta: &[u8], ) -> Result<Box<dyn AssetMetaDyn>, DeserializeMetaError>

Deserialized meta as type-erased AssetMeta, operating under the assumption that it matches the meta for the underlying Process impl.

Source

fn type_path(&self) -> &'static str

Returns the type-path of the original Process.

Source

fn short_type_path(&self) -> &'static str

Returns the short type path of this processor.

Source

fn default_meta( &self, processor_path_kind: MetaTypePathKind, ) -> Box<dyn AssetMetaDyn>

Returns the default type-erased AssetMeta for the underlying Process impl.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§