Struct bones_asset::prelude::SchemaMetaAssetLoader
source · pub struct SchemaMetaAssetLoader(pub fn(ctx: &mut MetaAssetLoadCtx<'_>, ptr: SchemaRefMut<'_>, deserialzer: &mut dyn Deserializer<'_>) -> Result<()>);
Expand description
A custom asset loader implementation for a metadata asset.
This is similar in purpose to implementing AssetLoader
, but instead of loading from bytes,
it loads from the deserialized SchemaRefMut
of a metadata asset and must be added as a
schema type data.
Tuple Fields§
§0: fn(ctx: &mut MetaAssetLoadCtx<'_>, ptr: SchemaRefMut<'_>, deserialzer: &mut dyn Deserializer<'_>) -> Result<()>
Implementations§
source§impl SchemaMetaAssetLoader
impl SchemaMetaAssetLoader
sourcepub fn load<'a, 'de, D>(
&self,
ctx: &mut MetaAssetLoadCtx<'_>,
ptr: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), Error>where
D: Deserializer<'de>,
pub fn load<'a, 'de, D>(
&self,
ctx: &mut MetaAssetLoadCtx<'_>,
ptr: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), Error>where
D: Deserializer<'de>,
Load the asset
Trait Implementations§
source§impl HasSchema for SchemaMetaAssetLoader
impl HasSchema for SchemaMetaAssetLoader
§fn register_schema()
fn register_schema()
Register this schema with the global schema registry. Read more
§fn cast<T>(this: &Self) -> &Twhere
T: HasSchema,
fn cast<T>(this: &Self) -> &Twhere
T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
§fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where
T: HasSchema,
fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where
T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
§fn cast_mut<T>(this: &mut Self) -> &mut Twhere
T: HasSchema,
fn cast_mut<T>(this: &mut Self) -> &mut Twhere
T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
§fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where
T: HasSchema,
fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where
T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
§fn as_schema_ref(&self) -> SchemaRef<'_>where
Self: Sized,
fn as_schema_ref(&self) -> SchemaRef<'_>where
Self: Sized,
Converts a reference of
T
to a SchemaRef
§fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where
Self: Sized,
fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where
Self: Sized,
Converts a reference of
T
to a SchemaRefMut
Auto Trait Implementations§
impl Freeze for SchemaMetaAssetLoader
impl RefUnwindSafe for SchemaMetaAssetLoader
impl Send for SchemaMetaAssetLoader
impl Sync for SchemaMetaAssetLoader
impl Unpin for SchemaMetaAssetLoader
impl UnwindSafe for SchemaMetaAssetLoader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more