Struct bones_lib::ecs::prelude::bones_schema::ser_de::SchemaDeserialize
pub struct SchemaDeserialize {
pub deserialize_fn: for<'a, 'de> fn(_: SchemaRefMut<'a>, _: &'a mut dyn Deserializer<'de>) -> Result<(), Error>,
}
Expand description
Derivable schema type_data
for types that implement
Deserialize
.
This allows you use serde to implement custom deserialization logic instead of the default one
used for #[repr(C)]
structs that implement HasSchema
.
Fields§
§deserialize_fn: for<'a, 'de> fn(_: SchemaRefMut<'a>, _: &'a mut dyn Deserializer<'de>) -> Result<(), Error>
The function that may be used to deserialize the type.
Implementations§
§impl SchemaDeserialize
impl SchemaDeserialize
pub fn deserialize<'a, 'de, D>(
&self,
reference: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
pub fn deserialize<'a, 'de, D>(
&self,
reference: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Use this SchemaDeserialize
to deserialize data from the deserializer
into the
reference
.
Trait Implementations§
§impl<T> FromType<T> for SchemaDeserializewhere
T: HasSchema + for<'de> Deserialize<'de>,
impl<T> FromType<T> for SchemaDeserializewhere
T: HasSchema + for<'de> Deserialize<'de>,
§fn from_type() -> SchemaDeserialize
fn from_type() -> SchemaDeserialize
Return the data for the type.
§impl HasSchema for SchemaDeserialize
impl HasSchema for SchemaDeserialize
§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 SchemaDeserialize
impl RefUnwindSafe for SchemaDeserialize
impl Send for SchemaDeserialize
impl Sync for SchemaDeserialize
impl Unpin for SchemaDeserialize
impl UnwindSafe for SchemaDeserialize
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