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§
sourceconst RESOURCE_TYPE: &'static str
const RESOURCE_TYPE: &'static str
Readable name for this type of trait objects as dynamic resource (for diagnostics).
Required Methods§
sourcefn try_from_erased(
erased: Box<dyn AnyResource>
) -> Result<DynamicResource<Self>, String>
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.