Struct libspa::pod::deserialize::StructPodDeserializer
source · pub struct StructPodDeserializer<'de> { /* private fields */ }
Expand description
This struct handles deserializing structs.
It can be obtained by calling PodDeserializer::deserialize_struct
.
Fields of the struct must be deserialized using its deserialize_field
until it returns None
.
followed by calling its end
function to finish deserialization of the struct.
Implementations§
source§impl<'de> StructPodDeserializer<'de>
impl<'de> StructPodDeserializer<'de>
sourcepub fn deserialize_field<P: PodDeserialize<'de>>(
&mut self
) -> Result<Option<P>, DeserializeError<&'de [u8]>>
pub fn deserialize_field<P: PodDeserialize<'de>>( &mut self ) -> Result<Option<P>, DeserializeError<&'de [u8]>>
Deserialize a single field of the struct
Returns Some
when a field was successfully deserialized and None
when all fields have been read.
sourcepub fn end(self) -> Result<DeserializeSuccess<'de>, DeserializeError<&'de [u8]>>
pub fn end(self) -> Result<DeserializeSuccess<'de>, DeserializeError<&'de [u8]>>
Finish deserialization of the pod.
§Panics
Panics if not all fields of the pod have been deserialized.
Auto Trait Implementations§
impl<'de> RefUnwindSafe for StructPodDeserializer<'de>
impl<'de> Send for StructPodDeserializer<'de>
impl<'de> Sync for StructPodDeserializer<'de>
impl<'de> Unpin for StructPodDeserializer<'de>
impl<'de> UnwindSafe for StructPodDeserializer<'de>
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