Struct bones_schema::ser_de::SchemaDeserialize
source · pub struct SchemaDeserialize {
pub deserialize_fn: for<'a, 'de> fn(_: SchemaRefMut<'a>, deserializer: &'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>, deserializer: &'a mut dyn Deserializer<'de>) -> Result<(), Error>
The function that may be used to deserialize the type.
Implementations§
source§impl SchemaDeserialize
impl SchemaDeserialize
sourcepub fn deserialize<'a, 'de, D>(
&self,
reference: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), D::Error>where
D: Deserializer<'de>,
pub fn deserialize<'a, 'de, D>(
&self,
reference: SchemaRefMut<'a>,
deserializer: D,
) -> Result<(), D::Error>where
D: Deserializer<'de>,
Use this SchemaDeserialize
to deserialize data from the deserializer
into the
reference
.
Trait Implementations§
source§impl<T: HasSchema + for<'de> Deserialize<'de>> FromType<T> for SchemaDeserialize
impl<T: HasSchema + for<'de> Deserialize<'de>> FromType<T> for SchemaDeserialize
source§impl HasSchema for SchemaDeserialize
impl HasSchema for SchemaDeserialize
source§fn register_schema()
fn register_schema()
Register this schema with the global schema registry. Read more
source§fn cast<T: HasSchema>(this: &Self) -> &T
fn cast<T: HasSchema>(this: &Self) -> &T
Cast a reference of this type to a reference of another type with the same memory layout. Read more
source§fn try_cast<T: HasSchema>(this: &Self) -> Result<&T, SchemaMismatchError>
fn try_cast<T: HasSchema>(this: &Self) -> Result<&T, SchemaMismatchError>
Cast a reference of this type to a reference of another type with the same memory layout. Read more
source§fn cast_mut<T: HasSchema>(this: &mut Self) -> &mut T
fn cast_mut<T: HasSchema>(this: &mut Self) -> &mut T
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
source§fn try_cast_mut<T: HasSchema>(
this: &mut Self,
) -> Result<&mut T, SchemaMismatchError>
fn try_cast_mut<T: HasSchema>( this: &mut Self, ) -> Result<&mut T, SchemaMismatchError>
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
source§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
source§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