Trait libre_pvz_resources::dynamic::ErasedResource

source ·
pub trait ErasedResource: AnyResource {
    const RESOURCE_TYPE: &'static str;

    // Required method
    fn try_from_erased(
        erased: Box<dyn AnyResource>
    ) -> Result<DynamicResource<Self>, String>;
}
Expand description

Allow dynamic (de)serialization for trait objects.

Required Associated Constants§

source

const RESOURCE_TYPE: &'static str

Readable name for this type of trait objects as dynamic resource (for diagnostics).

Required Methods§

source

fn try_from_erased( erased: Box<dyn AnyResource> ) -> Result<DynamicResource<Self>, String>

Try convert from a fully-erased dynamic resource to this trait object.

Object Safety§

This trait is not object safe.

Implementors§