Struct libspa::pod::deserialize::PodDeserializer
source · pub struct PodDeserializer<'de> { /* private fields */ }
Expand description
This struct is responsible for deserializing a raw pod into a PodDeserialize
implementor.
Implementations§
source§impl<'de> PodDeserializer<'de>
impl<'de> PodDeserializer<'de>
sourcepub fn deserialize_from<P: PodDeserialize<'de>>(
input: &'de [u8]
) -> Result<(&'de [u8], P), DeserializeError<&'de [u8]>>
pub fn deserialize_from<P: PodDeserialize<'de>>( input: &'de [u8] ) -> Result<(&'de [u8], P), DeserializeError<&'de [u8]>>
Deserialize a PodDeserialize
implementor from a raw pod.
Deserialization will only succeed if the raw pod matches the kind of pod expected by the PodDeserialize
implementor.
§Returns
The remaining input and the type on success, or an error that specifies where parsing failed.
sourcepub unsafe fn deserialize_ptr<P: PodDeserialize<'de>>(
ptr: NonNull<spa_pod>
) -> Result<P, DeserializeError<&'de [u8]>>
pub unsafe fn deserialize_ptr<P: PodDeserialize<'de>>( ptr: NonNull<spa_pod> ) -> Result<P, DeserializeError<&'de [u8]>>
Deserialize a spa_sys::spa_pod
pointer.
§Safety
- The provided pointer must point to a valid, well-aligned
spa_pod
struct. - The pod pointed to must be kept valid for the entire lifetime of the deserialized object if
sourcepub fn deserialize_none<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_none<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a none
pod.
sourcepub fn deserialize_bool<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_bool<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a boolean
pod.
sourcepub fn deserialize_int<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_int<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize an int
pod.
sourcepub fn deserialize_long<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_long<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a long
pod.
sourcepub fn deserialize_float<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_float<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a float
pod.
sourcepub fn deserialize_double<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_double<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a double
pod.
sourcepub fn deserialize_str<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_str<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a String
pod.
sourcepub fn deserialize_bytes<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_bytes<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Bytes
pod.
sourcepub fn new_array_deserializer<E>(
self
) -> Result<(ArrayPodDeserializer<'de, E>, u32), DeserializeError<&'de [u8]>>where
E: FixedSizedPod,
pub fn new_array_deserializer<E>(
self
) -> Result<(ArrayPodDeserializer<'de, E>, u32), DeserializeError<&'de [u8]>>where
E: FixedSizedPod,
Start parsing an array pod containing elements of type E
.
§Returns
- The array deserializer and the number of elements in the array on success
- An error if the header could not be parsed
sourcepub fn deserialize_rectangle<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_rectangle<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Rectangle
pod.
sourcepub fn deserialize_fraction<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_fraction<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Fraction
pod.
sourcepub fn deserialize_id<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_id<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize an Id
pod.
sourcepub fn deserialize_fd<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_fd<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Fd
pod.
sourcepub fn deserialize_struct<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_struct<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Struct
pod.
sourcepub fn deserialize_array<V, T>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
pub fn deserialize_array<V, T>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
Deserialize an array
pod containing elements of type T
.
sourcepub fn deserialize_object<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_object<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize an Object
pod.
sourcepub fn deserialize_choice<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_choice<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a Choice
pod.
sourcepub fn deserialize_pointer<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
pub fn deserialize_pointer<V>(
self,
visitor: V
) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>where
V: Visitor<'de>,
Deserialize a pointer pod.
sourcepub fn deserialize_any(
self
) -> Result<(Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
pub fn deserialize_any( self ) -> Result<(Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
Deserialize any kind of pod using a visitor producing Value
.
sourcepub fn deserialize_any_from(
input: &'de [u8]
) -> Result<(&'de [u8], Value), DeserializeError<&'de [u8]>>
pub fn deserialize_any_from( input: &'de [u8] ) -> Result<(&'de [u8], Value), DeserializeError<&'de [u8]>>
Variant of Self::deserialize_from
returning the parsed value as a Value
.