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>

source

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.

source

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
source

pub fn deserialize_none<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a none pod.

source

pub fn deserialize_bool<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a boolean pod.

source

pub fn deserialize_int<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize an int pod.

source

pub fn deserialize_long<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a long pod.

source

pub fn deserialize_float<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a float pod.

source

pub fn deserialize_double<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a double pod.

source

pub fn deserialize_str<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a String pod.

source

pub fn deserialize_bytes<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Bytes pod.

source

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
source

pub fn deserialize_rectangle<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Rectangle pod.

source

pub fn deserialize_fraction<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Fraction pod.

source

pub fn deserialize_id<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize an Id pod.

source

pub fn deserialize_fd<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Fd pod.

source

pub fn deserialize_struct<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Struct pod.

source

pub fn deserialize_array<V, T>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de, ArrayElem = T>, T: CanonicalFixedSizedPod + FixedSizedPod + Copy,

Deserialize an array pod containing elements of type T.

source

pub fn deserialize_object<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize an Object pod.

source

pub fn deserialize_choice<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a Choice pod.

source

pub fn deserialize_pointer<V>( self, visitor: V ) -> Result<(V::Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>
where V: Visitor<'de>,

Deserialize a pointer pod.

source

pub fn deserialize_any( self ) -> Result<(Value, DeserializeSuccess<'de>), DeserializeError<&'de [u8]>>

Deserialize any kind of pod using a visitor producing Value.

source

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.

Auto Trait Implementations§

§

impl<'de> RefUnwindSafe for PodDeserializer<'de>

§

impl<'de> Send for PodDeserializer<'de>

§

impl<'de> Sync for PodDeserializer<'de>

§

impl<'de> Unpin for PodDeserializer<'de>

§

impl<'de> UnwindSafe for PodDeserializer<'de>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.