Struct libspa::pod::deserialize::ObjectPodDeserializer
source · pub struct ObjectPodDeserializer<'de> { /* private fields */ }
Expand description
This struct handles deserializing objects.
It can be obtained by calling PodDeserializer::deserialize_object
.
Properties of the object must be deserialized using its deserialize_property
until it returns None
.
followed by calling its end
function to finish deserialization of the object.
Implementations§
source§impl<'de> ObjectPodDeserializer<'de>
impl<'de> ObjectPodDeserializer<'de>
sourcepub fn deserialize_property<P: PodDeserialize<'de>>(
&mut self
) -> Result<Option<(P, u32, PropertyFlags)>, DeserializeError<&'de [u8]>>
pub fn deserialize_property<P: PodDeserialize<'de>>( &mut self ) -> Result<Option<(P, u32, PropertyFlags)>, DeserializeError<&'de [u8]>>
Deserialize a single property of the object.
Returns Some
when a property was successfully deserialized and None
when all properties have been read.
sourcepub fn deserialize_property_key<P: PodDeserialize<'de>>(
&mut self,
key: u32
) -> Result<(P, PropertyFlags), DeserializeError<&'de [u8]>>
pub fn deserialize_property_key<P: PodDeserialize<'de>>( &mut self, key: u32 ) -> Result<(P, PropertyFlags), DeserializeError<&'de [u8]>>
Variant of Self::deserialize_property
ensuring the property has a given key.
Returns DeserializeError::PropertyMissing
if the property is missing
and DeserializeError::PropertyWrongKey
if the property does not have the
expected key.
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 properties of the pod have been deserialized.