gstreamer::structure

Struct StructureRef

Source
pub struct StructureRef(/* private fields */);

Implementations§

Source§

impl StructureRef

Source

pub unsafe fn from_glib_borrow<'a>(ptr: *const GstStructure) -> &'a StructureRef

Source

pub unsafe fn from_glib_borrow_mut<'a>( ptr: *mut GstStructure, ) -> &'a mut StructureRef

Source

pub fn as_ptr(&self) -> *const GstStructure

Source

pub fn as_mut_ptr(&self) -> *mut GstStructure

Source

pub fn get<'a, T: FromValue<'a>>( &'a self, name: impl IntoGStr, ) -> Result<T, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

Source

pub fn get_by_id<'a, T: FromValue<'a>>( &'a self, name: impl AsRef<IdStr>, ) -> Result<T, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

Source

pub fn get_optional<'a, T: FromValue<'a>>( &'a self, name: impl IntoGStr, ) -> Result<Option<T>, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

Source

pub fn get_optional_by_id<'a, T: FromValue<'a>>( &'a self, name: impl AsRef<IdStr>, ) -> Result<Option<T>, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

Source

pub fn value( &self, name: impl IntoGStr, ) -> Result<&SendValue, GetError<Infallible>>

Source

pub fn value_by_id( &self, name: impl AsRef<IdStr>, ) -> Result<&SendValue, GetError<Infallible>>

Source

pub fn get_by_quark<'a, T: FromValue<'a>>( &'a self, name: Quark, ) -> Result<T, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

👎Deprecated: use get_by_id() instead
Source

pub fn get_optional_by_quark<'a, T: FromValue<'a>>( &'a self, name: Quark, ) -> Result<Option<T>, GetError<<<T as FromValue<'a>>::Checker as ValueTypeChecker>::Error>>

👎Deprecated: use get_optional_by_id() instead
Source

pub fn value_by_quark( &self, name: Quark, ) -> Result<&SendValue, GetError<Infallible>>

👎Deprecated: use value_by_id() instead
Source

pub fn set(&mut self, name: impl IntoGStr, value: impl Into<Value> + Send)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_with_static( &mut self, name: impl AsRef<GStr> + 'static, value: impl Into<Value> + Send, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_with_id( &mut self, name: impl AsRef<IdStr>, value: impl Into<Value> + Send, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_if( &mut self, name: impl IntoGStr, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_with_static_if( &mut self, name: impl AsRef<GStr> + 'static, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_with_id_if( &mut self, name: impl AsRef<IdStr>, value: impl Into<Value> + Send, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_if_some( &mut self, name: impl IntoGStr, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_with_static_if_some( &mut self, name: impl AsRef<GStr> + 'static, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_with_id_if_some( &mut self, name: impl AsRef<IdStr>, value: Option<impl Into<Value> + Send>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_from_iter<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_with_static_from_iter<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl AsRef<GStr> + 'static, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_with_id_from_iter<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl AsRef<IdStr>, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

Source

pub fn set_if_not_empty<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_with_static_if_not_empty<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl AsRef<GStr> + 'static, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_with_id_if_not_empty<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( &mut self, name: impl AsRef<IdStr>, iter: impl IntoIterator<Item = impl ToSendValue>, )

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

Source

pub fn set_value(&mut self, name: impl IntoGStr, value: SendValue)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_with_static( &mut self, name: impl AsRef<GStr> + 'static, value: SendValue, )

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_with_id(&mut self, name: impl AsRef<IdStr>, value: SendValue)

Sets field name to the given value value.

Overrides any default or previously defined value for name.

Source

pub fn set_value_if( &mut self, name: impl IntoGStr, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_static_if( &mut self, name: impl AsRef<GStr> + 'static, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_id_if( &mut self, name: impl AsRef<IdStr>, value: SendValue, predicate: bool, )

Sets field name to the given value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

Source

pub fn set_value_if_some( &mut self, name: impl IntoGStr, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_static_if_some( &mut self, name: impl AsRef<GStr> + 'static, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_value_with_id_if_some( &mut self, name: impl AsRef<IdStr>, value: Option<SendValue>, )

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

Source

pub fn set_by_quark(&mut self, name: Quark, value: impl Into<Value> + Send)

👎Deprecated: use set_by_id() instead
Source

pub fn set_by_quark_if_some( &mut self, name: Quark, value: Option<impl Into<Value> + Send>, )

👎Deprecated: use set_by_id_if_some() instead
Source

pub fn set_value_by_quark(&mut self, name: Quark, value: SendValue)

👎Deprecated: use set_by_id_value() instead
Source

pub fn set_value_by_quark_if_some( &mut self, name: Quark, value: Option<SendValue>, )

👎Deprecated: use set_by_id_value_if_some() instead
Source

pub fn name(&self) -> &GStr

Source

pub fn name_id(&self) -> &IdStr

Source

pub fn name_quark(&self) -> Quark

👎Deprecated: use name() instead, or name_id() with feature v1_26
Source

pub fn set_name(&mut self, name: impl IntoGStr)

Source

pub fn set_name_from_static(&mut self, name: impl AsRef<GStr> + 'static)

Source

pub fn set_name_from_id(&mut self, name: impl AsRef<IdStr>)

Source

pub fn set_name_if_some(&mut self, name: Option<impl IntoGStr>)

Source

pub fn set_name_from_static_if_some( &mut self, name: Option<impl AsRef<GStr> + 'static>, )

Source

pub fn set_name_from_id_if_some(&mut self, name: Option<impl AsRef<IdStr>>)

Source

pub fn has_name(&self, name: &str) -> bool

Source

pub fn has_field(&self, field: impl IntoGStr) -> bool

Source

pub fn has_field_by_id(&self, field: impl AsRef<IdStr>) -> bool

Source

pub fn has_field_with_type(&self, field: impl IntoGStr, type_: Type) -> bool

Source

pub fn has_field_with_type_by_id( &self, field: impl AsRef<IdStr>, type_: Type, ) -> bool

Source

pub fn has_field_by_quark(&self, field: Quark) -> bool

👎Deprecated: use has_field_by_id()
Source

pub fn has_field_with_type_by_quark(&self, field: Quark, type_: Type) -> bool

👎Deprecated: use has_field_with_type_by_id()
Source

pub fn remove_field(&mut self, field: impl IntoGStr)

Source

pub fn remove_fields(&mut self, fields: impl IntoIterator<Item = impl IntoGStr>)

Source

pub fn remove_field_by_id(&mut self, field: impl AsRef<IdStr>)

Source

pub fn remove_field_by_ids( &mut self, fields: impl IntoIterator<Item = impl AsRef<IdStr>>, )

Source

pub fn remove_all_fields(&mut self)

Source

pub fn fields(&self) -> FieldIterator<'_>

Source

pub fn iter(&self) -> Iter<'_>

Source

pub fn field_ids(&self) -> FieldIdIterator<'_>

Source

pub fn id_iter(&self) -> IdIter<'_>

Source

pub fn nth_field_name(&self, idx: usize) -> Option<&GStr>

Source

pub fn nth_field_by_id(&self, idx: usize) -> Option<&IdStr>

Source

pub fn n_fields(&self) -> usize

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn can_intersect(&self, other: &StructureRef) -> bool

Source

pub fn intersect(&self, other: &StructureRef) -> Option<Structure>

Source

pub fn is_subset(&self, superset: &StructureRef) -> bool

Source

pub fn fixate(&mut self)

Source

pub fn fixate_field(&mut self, name: impl IntoGStr) -> bool

Source

pub fn fixate_field_bool(&mut self, name: impl IntoGStr, target: bool) -> bool

Source

pub fn fixate_field_str( &mut self, name: impl IntoGStr, target: impl IntoGStr, ) -> bool

Source

pub fn fixate_field_nearest_double( &mut self, name: impl IntoGStr, target: f64, ) -> bool

Source

pub fn fixate_field_nearest_fraction( &mut self, name: impl IntoGStr, target: impl Into<Fraction>, ) -> bool

Source

pub fn fixate_field_nearest_int( &mut self, name: impl IntoGStr, target: i32, ) -> bool

Source

pub fn serialize(&self, flags: SerializeFlags) -> GString

Source

pub fn serialize_strict( &self, flags: SerializeFlags, ) -> Result<GString, BoolError>

Source

pub fn foreach<F: FnMut(Quark, &Value) -> ControlFlow<()>>( &self, func: F, ) -> bool

👎Deprecated: Use iter() instead, or id_iter() with feature v1_26
Source

pub fn map_in_place_by_id<F: FnMut(&IdStr, &mut Value) -> ControlFlow<()>>( &mut self, func: F, )

Executes the provided func on each field, possibly modifying the value.

Source

pub fn filter_map_in_place_by_id<F: FnMut(&IdStr, Value) -> Option<Value>>( &mut self, func: F, )

Executes the provided func on each field with an owned value.

  • If func returns Some(value), the field’s value is replaced with value.
  • If func returns None, the field is removed.
Source

pub fn map_in_place<F: FnMut(Quark, &mut Value) -> ControlFlow<()>>( &mut self, func: F, ) -> ControlFlow<()>

Executes the provided func on each field, possibly modifying the value, as long as ControlFlow::Continue(()) is returned.

Using Quarks is deprecated, however this method is kept because there are no other means to achieve this pre-GStreamer-1.26. With feature v1_26, use map_in_place_by_id instead.

§Returns:
  • ControlFlow::Continue(()) if func returned this for all fields,
  • ControlFlow::Break(()) otherwise.
Source

pub fn filter_map_in_place<F: FnMut(Quark, Value) -> Option<Value>>( &mut self, func: F, )

Executes the provided func on each field with an owned value.

  • If func returns Some(value), the field’s value is replaced with value.
  • If func returns None, the field is removed.

Using Quarks is deprecated, however this method is kept because there are no other means to achieve this pre-GStreamer-1.26. With feature v1_26, use filter_map_in_place_by_id instead.

Trait Implementations§

Source§

impl AsMut<StructureRef> for BufferPoolConfigRef

Source§

fn as_mut(&mut self) -> &mut StructureRef

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMut<StructureRef> for Structure

Source§

fn as_mut(&mut self) -> &mut StructureRef

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<StructureRef> for BufferPoolConfigRef

Source§

fn as_ref(&self) -> &StructureRef

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

impl AsRef<StructureRef> for Structure

Source§

fn as_ref(&self) -> &StructureRef

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

impl Borrow<StructureRef> for Structure

Source§

fn borrow(&self) -> &StructureRef

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<StructureRef> for Structure

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Debug for StructureRef

Source§

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

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

impl Display for StructureRef

Source§

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

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

impl<'a> Extend<(&'a GStr, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (&'a GStr, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a> Extend<(&'a IdStr, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (&'a IdStr, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a> Extend<(&'a str, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (&'a str, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<(GString, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (GString, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<(IdStr, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (IdStr, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<(Quark, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (Quark, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<(String, SendValue)> for StructureRef

Source§

fn extend<T: IntoIterator<Item = (String, SendValue)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a> FromValue<'a> for &'a StructureRef

Source§

type Checker = GenericValueTypeOrNoneChecker<&'a StructureRef>

Value type checker.
Source§

unsafe fn from_value(value: &'a Value) -> Self

Get the contained value from a Value. Read more
Source§

impl<'a> IntoIterator for &'a StructureRef

Source§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
Source§

type Item = (&'a GStr, &'a SendValue)

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq<Structure> for StructureRef

Source§

fn eq(&self, other: &Structure) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<StructureRef> for Structure

Source§

fn eq(&self, other: &StructureRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for StructureRef

Source§

fn eq(&self, other: &StructureRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for StructureRef

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 StaticType for StructureRef

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl ToOwned for StructureRef

Source§

type Owned = Structure

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Structure

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

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

impl ToValue for StructureRef

Source§

fn to_value(&self) -> Value

Convert a value to a Value.
Source§

fn value_type(&self) -> Type

Returns the type identifier of self. Read more
Source§

impl ToValueOptional for StructureRef

Source§

fn to_value_optional(s: Option<&Self>) -> Value

Convert an Option to a Value.
Source§

impl Eq for StructureRef

Source§

impl Send for StructureRef

Source§

impl Sync for StructureRef

Auto Trait Implementations§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> ToSendValue for T
where T: Send + ToValue + ?Sized,

Source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
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>,

Source§

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>,

Source§

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.