Struct wireplumber::spa::json::SpaJsonRef

source ·
pub struct SpaJsonRef<'j> { /* private fields */ }

Implementations§

source§

impl<'j> SpaJsonRef<'j>

source

pub fn to_owned_deserializer<'a>( &'a self ) -> impl for<'de> Deserializer<'de, Error = ParseError> + 'a + 'j

Available on crate feature serde only.
source

pub fn into_owned_deserializer( self ) -> impl for<'de> Deserializer<'de, Error = ParseError> + 'j

Available on crate feature serde only.
source§

impl<'j> SpaJsonRef<'j>

source

pub fn with_str(json: &'j str) -> Self

source

pub fn with_gstr(json: &'j GStr) -> Self

source

pub fn with_json<'a>(json: &'a SpaJson) -> &'a Self
where 'j: 'a,

source

pub unsafe fn with_json_unchecked<'a>(json: &'a SpaJson) -> &'a Self

source

pub unsafe fn new(json: SpaJson) -> Self

source

pub fn into_data(self) -> &'j str

source

pub fn data(&self) -> &str

source

pub unsafe fn get_json(&self) -> &SpaJson

Because this object borrows data of lifetime 'j, it is not safe to clone this reference.

source

pub unsafe fn get_json_mut(&mut self) -> &mut SpaJson

source

pub unsafe fn into_json_unchecked(self) -> SpaJson

source

pub fn copy(&self) -> SpaJson

source

pub fn into_owned(self) -> SpaJson

source

pub unsafe fn into_parts_unchecked(self) -> (SpaJson, &'j str)

source

pub fn parse_char(&self) -> Result<char, ParseError>

source

pub fn parse_str(&self) -> Option<Cow<'j, str>>

source

pub fn parse_string(&self) -> Option<GString>

source

pub fn parse_boolean(&self) -> Option<bool>

source

pub fn parse_int(&self) -> Option<i32>

source

pub fn parse_float(&self) -> Option<f32>

source

pub fn parse_null(&self) -> Option<()>

source

pub fn parse_array<'a>(&'a self) -> Option<SpaJsonParserRef<'a, 'j>>

source

pub fn parse_object<'a>(&'a self) -> Option<SpaJsonObjectParser<'a, 'j>>

source

pub fn parse_values<'a>( &'a self ) -> impl Iterator<Item = SpaJsonRef<'j>> + 'static

source

pub fn parse_variant(&self) -> Result<Variant, ParseError>

source

pub fn parse_container<'a>( &'a self ) -> Result<SpaJsonParserRef<'a, 'j>, ParseError>

source

pub fn check_parse(&self) -> Result<(), ParseError>

source

pub fn spa_type(&self) -> Result<SpaType, ParseError>

source§

impl SpaJsonRef<'static>

source

pub fn new_null() -> Self

source

pub fn empty() -> Self

source

pub fn empty_array() -> Self

source

pub fn empty_object() -> Self

source

pub fn into_json(self) -> SpaJson

Trait Implementations§

source§

impl<'a, 'j> AsRef<SpaJsonRef<'a>> for SpaJsonRef<'j>
where 'j: 'a,

source§

fn as_ref(&self) -> &SpaJsonRef<'a>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'j> AsRef<SpaJsonRef<'j>> for &'j SpaJson

source§

fn as_ref(&self) -> &SpaJsonRef<'j>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'j> Clone for SpaJsonRef<'j>

source§

fn clone(&self) -> SpaJsonRef<'j>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'j> Debug for SpaJsonRef<'j>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserializer<'de> for &SpaJsonRef<'de>

§

type Error = ParseError

The error type that can be returned if some error occurs during deserialization.
source§

fn deserialize_char<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a char value.
source§

fn deserialize_string<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_byte_buf<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_unit<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a unit value.
source§

fn deserialize_u8<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u8 value.
source§

fn deserialize_u16<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u16 value.
source§

fn deserialize_u32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u32 value.
source§

fn deserialize_u64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u64 value.
source§

fn deserialize_i8<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i8 value.
source§

fn deserialize_i16<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i16 value.
source§

fn deserialize_i32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i32 value.
source§

fn deserialize_i64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i64 value.
source§

fn deserialize_bool<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a bool value.
source§

fn deserialize_f32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a f32 value.
source§

fn deserialize_f64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a f64 value.
source§

fn deserialize_option<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an optional value. Read more
source§

fn deserialize_seq<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a sequence of values.
source§

fn deserialize_map<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a map of key-value pairs.
source§

fn deserialize_enum<V: Visitor<'de>>( self, _name: &'static str, _variants: &'static [&'static str], visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants.
source§

fn deserialize_ignored_any<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
source§

fn deserialize_any<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
source§

fn deserialize_bytes<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_unit_struct<V: Visitor<'de>>( self, _name: &'static str, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a unit struct with a particular name.
source§

fn deserialize_newtype_struct<V: Visitor<'de>>( self, _name: &'static str, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a newtype struct with a particular name.
source§

fn deserialize_tuple<V: Visitor<'de>>( self, _len: usize, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data.
source§

fn deserialize_tuple_struct<V: Visitor<'de>>( self, _name: &'static str, _len: usize, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields.
source§

fn deserialize_struct<V: Visitor<'de>>( self, _name: &'static str, _fields: &'static [&'static str], visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a struct with a particular name and fields.
source§

fn deserialize_identifier<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant.
source§

fn deserialize_str<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_i128<V>( self, visitor: V ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i128 value. Read more
source§

fn deserialize_u128<V>( self, visitor: V ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an u128 value. Read more
source§

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
source§

impl<'de> Deserializer<'de> for SpaJsonRef<'de>

§

type Error = ParseError

The error type that can be returned if some error occurs during deserialization.
source§

fn deserialize_any<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
source§

fn deserialize_bool<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a bool value.
source§

fn deserialize_i8<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i8 value.
source§

fn deserialize_i16<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i16 value.
source§

fn deserialize_i32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i32 value.
source§

fn deserialize_i64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an i64 value.
source§

fn deserialize_u8<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u8 value.
source§

fn deserialize_u16<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u16 value.
source§

fn deserialize_u32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u32 value.
source§

fn deserialize_u64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a u64 value.
source§

fn deserialize_f32<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a f32 value.
source§

fn deserialize_f64<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a f64 value.
source§

fn deserialize_char<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a char value.
source§

fn deserialize_str<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_string<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_bytes<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_byte_buf<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
source§

fn deserialize_option<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an optional value. Read more
source§

fn deserialize_unit<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a unit value.
source§

fn deserialize_unit_struct<V: Visitor<'de>>( self, name: &'static str, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a unit struct with a particular name.
source§

fn deserialize_newtype_struct<V: Visitor<'de>>( self, name: &'static str, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a newtype struct with a particular name.
source§

fn deserialize_seq<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a sequence of values.
source§

fn deserialize_tuple<V: Visitor<'de>>( self, len: usize, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data.
source§

fn deserialize_tuple_struct<V: Visitor<'de>>( self, name: &'static str, len: usize, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields.
source§

fn deserialize_map<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a map of key-value pairs.
source§

fn deserialize_struct<V: Visitor<'de>>( self, name: &'static str, fields: &'static [&'static str], visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting a struct with a particular name and fields.
source§

fn deserialize_enum<V: Visitor<'de>>( self, name: &'static str, variants: &'static [&'static str], visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants.
source§

fn deserialize_identifier<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant.
source§

fn deserialize_ignored_any<V: Visitor<'de>>( self, visitor: V ) -> Result<V::Value, Self::Error>

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
source§

fn deserialize_i128<V>( self, visitor: V ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i128 value. Read more
source§

fn deserialize_u128<V>( self, visitor: V ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an u128 value. Read more
source§

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
source§

impl<'j> Display for SpaJsonRef<'j>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> EnumAccess<'de> for &SpaJsonRef<'de>

§

type Error = ParseError

The error type that can be returned if some error occurs during deserialization.
§

type Variant = &SpaJsonRef<'de>

The Visitor that will be used to deserialize the content of the enum variant.
source§

fn variant_seed<V: DeserializeSeed<'de>>( self, seed: V ) -> Result<(V::Value, Self::Variant), Self::Error>

variant is called to identify which variant to deserialize. Read more
source§

fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error>
where V: Deserialize<'de>,

variant is called to identify which variant to deserialize. Read more
source§

impl<'a, 'j> From<&'a SpaJson> for &'a SpaJsonRef<'j>
where 'a: 'j,

source§

fn from(json: &'a SpaJson) -> Self

Converts to this type from the input type.
source§

impl<'a, 'j> From<&'a SpaJsonRef<'j>> for SpaJson

source§

fn from(json: &'a SpaJsonRef<'_>) -> Self

Converts to this type from the input type.
source§

impl<'j> From<SpaJsonRef<'j>> for SpaJson

source§

fn from(json: SpaJsonRef<'j>) -> Self

Converts to this type from the input type.
source§

impl<'j> Hash for SpaJsonRef<'j>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'j> Ord for SpaJsonRef<'j>

source§

fn cmp(&self, other: &SpaJsonRef<'j>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'j> PartialEq for SpaJsonRef<'j>

source§

fn eq(&self, other: &SpaJsonRef<'j>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'j> PartialOrd for SpaJsonRef<'j>

source§

fn partial_cmp(&self, other: &SpaJsonRef<'j>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'j> Serialize for SpaJsonRef<'j>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<'j> StaticVariantType for SpaJsonRef<'j>

source§

fn static_variant_type() -> Cow<'static, VariantTy>

Returns the VariantType corresponding to Self.
source§

impl<'j> ToVariant for SpaJsonRef<'j>

source§

fn to_variant(&self) -> Variant

Returns a Variant clone of self.
source§

impl<'de> VariantAccess<'de> for &SpaJsonRef<'de>

§

type Error = ParseError

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess.
source§

fn unit_variant(self) -> Result<(), Self::Error>

Called when deserializing a variant with no values. Read more
source§

fn newtype_variant_seed<T: DeserializeSeed<'de>>( self, seed: T ) -> Result<T::Value, Self::Error>

Called when deserializing a variant with a single value. Read more
source§

fn tuple_variant<V: Visitor<'de>>( self, _len: usize, _visitor: V ) -> Result<V::Value, Self::Error>

Called when deserializing a tuple-like variant. Read more
source§

fn struct_variant<V: Visitor<'de>>( self, _fields: &'static [&'static str], _visitor: V ) -> Result<V::Value, Self::Error>

Called when deserializing a struct-like variant. Read more
source§

fn newtype_variant<T>(self) -> Result<T, Self::Error>
where T: Deserialize<'de>,

Called when deserializing a variant with a single value. Read more
source§

impl<'j> Eq for SpaJsonRef<'j>

source§

impl<'j> StructuralPartialEq for SpaJsonRef<'j>

Auto Trait Implementations§

§

impl<'j> Freeze for SpaJsonRef<'j>

§

impl<'j> RefUnwindSafe for SpaJsonRef<'j>

§

impl<'j> !Send for SpaJsonRef<'j>

§

impl<'j> !Sync for SpaJsonRef<'j>

§

impl<'j> Unpin for SpaJsonRef<'j>

§

impl<'j> UnwindSafe for SpaJsonRef<'j>

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.