Trait bevy::asset::processor::ErasedProcessor

pub trait ErasedProcessor: Send + Sync {
    // Required methods
    fn process<'a>(
        &'a self,
        context: &'a mut ProcessContext<'_>,
        meta: Box<dyn AssetMetaDyn>,
        writer: &'a mut (dyn AsyncWrite + Unpin + Sync + Send + 'static)
    ) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<Box<dyn AssetMetaDyn>, ProcessError>> + 'a>>;
    fn deserialize_meta(
        &self,
        meta: &[u8]
    ) -> Result<Box<dyn AssetMetaDyn>, DeserializeMetaError>;
    fn default_meta(&self) -> Box<dyn AssetMetaDyn>;
}
Expand description

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

Required Methods§

fn process<'a>( &'a self, context: &'a mut ProcessContext<'_>, meta: Box<dyn AssetMetaDyn>, writer: &'a mut (dyn AsyncWrite + Unpin + Sync + Send + 'static) ) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<Box<dyn AssetMetaDyn>, ProcessError>> + 'a>>

Type-erased variant of Process::process.

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.

fn default_meta(&self) -> Box<dyn AssetMetaDyn>

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

Implementors§

§

impl<P> ErasedProcessor for P
where P: Process,