Struct wireplumber::spa::SpaPod

source ·
pub struct SpaPod { /* private fields */ }
Expand description

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

source§

impl SpaPod

source

pub fn as_ptr(&self) -> *mut WpSpaPod

Return the inner pointer to the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow<'a>(ptr: *const *const WpSpaPod) -> &'a Self

Borrows the underlying C value.

source§

impl SpaPod

source

pub fn new_boolean(value: bool) -> SpaPod

source

pub fn new_double(value: f64) -> SpaPod

source

pub fn new_fd(value: i64) -> SpaPod

source

pub fn new_float(value: f32) -> SpaPod

source

pub fn new_fraction(num: u32, denom: u32) -> SpaPod

source

pub fn new_id(value: u32) -> SpaPod

source

pub fn new_int(value: i32) -> SpaPod

source

pub fn new_long(value: i64) -> SpaPod

source

pub fn new_none() -> SpaPod

source

pub fn new_rectangle(width: u32, height: u32) -> SpaPod

source

pub fn new_string(value: &str) -> SpaPod

source

pub fn copy(&self) -> Option<SpaPod>

source

pub fn ensure_unique_owner(self) -> Option<SpaPod>

source

pub fn filter(&self, filter: &SpaPod) -> Option<SpaPod>

source

pub fn fixate(&self) -> bool

source

pub fn array_child(&self) -> Option<SpaPod>

source

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

source

pub fn choice_child(&self) -> Option<SpaPod>

source

pub fn control(&self) -> Option<(u32, GString, SpaPod)>

source

pub fn double(&self) -> Option<f64>

source

pub fn fd(&self) -> Option<i64>

source

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

source

pub fn fraction(&self) -> Option<(u32, u32)>

source

pub fn id(&self) -> Option<u32>

source

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

source

pub fn long(&self) -> Option<i64>

source

pub fn property(&self) -> Option<(GString, SpaPod)>

source

pub fn rectangle(&self) -> Option<(u32, u32)>

source

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

source

pub fn is_array(&self) -> bool

source

pub fn is_boolean(&self) -> bool

source

pub fn is_bytes(&self) -> bool

source

pub fn is_choice(&self) -> bool

source

pub fn is_control(&self) -> bool

source

pub fn is_double(&self) -> bool

source

pub fn is_fd(&self) -> bool

source

pub fn is_float(&self) -> bool

source

pub fn is_fraction(&self) -> bool

source

pub fn is_id(&self) -> bool

source

pub fn is_int(&self) -> bool

source

pub fn is_long(&self) -> bool

source

pub fn is_none(&self) -> bool

source

pub fn is_object(&self) -> bool

source

pub fn is_pointer(&self) -> bool

source

pub fn is_property(&self) -> bool

source

pub fn is_rectangle(&self) -> bool

source

pub fn is_sequence(&self) -> bool

source

pub fn is_string(&self) -> bool

source

pub fn is_struct(&self) -> bool

source

pub fn is_unique_owner(&self) -> bool

source

pub fn set_boolean(&self, value: bool) -> bool

source

pub fn set_double(&self, value: f64) -> bool

source

pub fn set_fd(&self, value: i64) -> bool

source

pub fn set_float(&self, value: f32) -> bool

source

pub fn set_fraction(&self, num: u32, denom: u32) -> bool

source

pub fn set_id(&self, value: u32) -> bool

source

pub fn set_int(&self, value: i32) -> bool

source

pub fn set_long(&self, value: i64) -> bool

source

pub fn set_pod(&self, pod: &SpaPod) -> bool

source

pub fn set_rectangle(&self, width: u32, height: u32) -> bool

source§

impl SpaPod

source

pub fn spa_id(&self) -> Option<Id>

Available on crate feature libspa only.
source

pub fn spa_fd(&self) -> Option<Fd>

Available on crate feature libspa only.
source

pub fn deserialize<'de, P: PodDeserialize<'de>>( &'de self ) -> Result<P, DeserializeError<&'de [u8]>>

Available on crate feature libspa only.
source

pub fn serialize<P: PodSerialize>(value: &P) -> Result<Self, GenError>

Available on crate feature libspa only.
source

pub fn to_pod_value(&self) -> Result<Value, Error>

Available on crate feature libspa only.
source

pub fn debug(&self) -> DebugValue<'static, 'static>

source§

impl SpaPod

source

pub unsafe fn with_pod_unchecked(bytes: &[u8]) -> Self

§Safety

Does not tie lifetime of bytes to Self, so requires caller guarantee

source

pub unsafe fn with_pod_mut_unchecked(bytes: &mut [u8]) -> Self

§Safety

Does not tie lifetime of bytes to Self, so requires caller guarantee

source

pub fn with_copy(pod: &SpaPod) -> Self

source

pub fn with_pod(bytes: &[u8]) -> Self

source

pub unsafe fn as_bytes(&self) -> &[u8]

source

pub fn to_bytes(&self) -> Vec<u8>

source

pub unsafe fn new_wrap_raw_mut(pod: *mut spa_pod) -> SpaPod

borrows pod for the lifetime of the returned object

source

pub unsafe fn new_wrap_raw_const(pod: *const spa_pod) -> SpaPod

borrows pod for the lifetime of the returned object

source

pub fn new_bytes(value: &[u8]) -> SpaPod

source

pub fn new_pointer(type_name: &str, value: gconstpointer) -> SpaPod

source

pub fn spa_type(&self) -> Option<SpaType>

source

pub fn bytes(&self) -> Option<&[u8]>

source

pub fn choice_type(&self) -> Option<SpaIdValue>

source

pub fn pointer(&self) -> Option<gconstpointer>

source

pub fn set_pointer(&self, type_name: &str, value: gconstpointer) -> bool

source

pub fn iterator(&self) -> IntoValueIterator<SpaPod>

source

pub fn array_pointers(&self) -> IntoValueIterator<Pointer>

source

pub fn array_iterator<T: SpaPrimitive>(&self) -> impl Iterator<Item = T>

source

pub fn spa_pod_raw(&self) -> &spa_pod

source

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

source

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

source

pub fn struct_fields( &self, length_prefix: bool ) -> Result<IntoIter<(String, SpaPod)>>

Available on crate feature experimental only.
source

pub fn spa_properties( &self ) -> impl Iterator<Item = (Result<SpaIdValue, WpSpaType>, SpaPod)>

source

pub fn find_spa_property<K: SpaPropertyKey>(&self, key: &K) -> Option<SpaPod>

source

pub fn spa_property<T, K: SpaPropertyKey>(&self, key: &K) -> Option<T>
where for<'a> &'a SpaPod: TryInto<T>, for<'a> <&'a SpaPod as TryInto<T>>::Error: Debug,

source

pub fn set_spa_property<K: SpaPropertyKey>( &self, key: &K, value: &SpaPod ) -> Option<SpaPod>

source

pub fn apply<O: IsA<PipewireObject>>(self, obj: &O) -> Result<()>

Available on crate feature experimental only.

Trait Implementations§

source§

impl Clone for SpaPod

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for SpaPod

source§

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

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

impl From<SpaPod> for Value

source§

fn from(s: SpaPod) -> Self

Converts to this type from the input type.
source§

impl<T: SpaValue> FromIterator<T> for SpaPod

source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl HasParamSpec for SpaPod

§

type ParamSpec = ParamSpecBoxed

§

type SetValue = SpaPod

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, SpaPod>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for SpaPod

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 Ord for SpaPod

source§

fn cmp(&self, other: &SpaPod) -> 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 PartialEq for SpaPod

source§

fn eq(&self, other: &Self) -> 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 PartialOrd for SpaPod

source§

fn partial_cmp(&self, other: &SpaPod) -> 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 SpaValue for SpaPod

source§

impl StaticType for SpaPod

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl<'a> TryFrom<&'a SpaPod> for ()

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for Fd

Available on crate feature libspa only.
§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for GString

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for Id

Available on crate feature libspa only.
§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for SpaBool

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for SpaPod

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for String

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for Value

Available on crate feature libspa only.
§

type Error = Error

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, T: for<'f> TryFrom<&'f SpaPod>> TryFrom<&'a SpaPod> for Vec<T>
where for<'f> <T as TryFrom<&'f SpaPod>>::Error: Into<GlibNoneError>,

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for Vec<u8>

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for bool

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for f32

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for f64

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for i32

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for i64

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for spa_fraction

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for spa_rectangle

§

type Error = GlibNoneError

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for u32

§

type Error = Error

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a SpaPod> for u64

§

type Error = Error

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

fn try_from(pod: &'a SpaPod) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryInto<Value> for SpaPod

Available on crate feature libspa only.
§

type Error = Error

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

fn try_into(self) -> Result<Value, Error>

Performs the conversion.
source§

impl Eq for SpaPod

Auto Trait Implementations§

§

impl Freeze for SpaPod

§

impl RefUnwindSafe for SpaPod

§

impl !Send for SpaPod

§

impl !Sync for SpaPod

§

impl Unpin for SpaPod

§

impl UnwindSafe for SpaPod

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> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

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> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
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> ToValueOption for T
where T: ToValue,

source§

impl<T> TransparentType for T

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> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

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.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,