Struct gstreamer::structure::Structure[][src]

pub struct Structure(_, _);

A Structure is a collection of key/value pairs. The keys are expressed as GQuarks and the values can be of any GType.

In addition to the key/value pairs, a Structure also has a name. The name starts with a letter and can be filled by letters, numbers and any of "/-_.:".

Structure is used by various GStreamer subsystems to store information in a flexible and extensible way. A Structure does not have a refcount because it usually is part of a higher level object such as Caps, Message, Event, Query. It provides a means to enforce mutability using the refcount of the parent with the Structure::set_parent_refcount method.

A Structure can be created with Structure::new_empty or Structure::new, which both take a name and an optional set of key/value pairs along with the types of the values.

Field values can be changed with Structure::set_value or Structure::set.

Field values can be retrieved with Structure::get_value or the more convenient gst_structure_get_*() functions.

Fields can be removed with Structure::remove_field or Structure::remove_fields.

Strings in structures must be ASCII or UTF-8 encoded. Other encodings are not allowed. Strings may be None however.

Be aware that the current Caps / Structure serialization into string has limited support for nested Caps / Structure fields. It can only support one level of nesting. Using more levels will lead to unexpected behavior when using serialization features, such as Caps::to_string or gst_value_serialize and their counterparts.

Methods

impl Structure
[src]

Creates a new, empty Structure with the given name.

See Structure::set_name for constraints on the name parameter.

Free-function: gst_structure_free

name

name of new structure

Returns

a new, empty Structure

Creates a new Structure with the given name. Parses the list of variable arguments and sets fields to the values listed. Variable arguments should be passed as field name, field type, and value. Last variable argument should be None.

Free-function: gst_structure_free

name

name of new structure

firstfield

name of first field to set

Returns

a new Structure

Creates a Structure from a string representation. If end is not None, a pointer to the place inside the given string where parsing ended will be returned.

Free-function: gst_structure_free

string

a string representation of a Structure.

end

pointer to store the end of the string in.

Returns

a new Structure or None when the string could not be parsed. Free with Structure::free after use.

Methods from Deref<Target = StructureRef>

Important traits for FieldIterator<'a>

Important traits for Iter<'a>

Trait Implementations

impl Send for Structure
[src]

impl Deref for Structure
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for Structure
[src]

Mutably dereferences the value.

impl AsRef<StructureRef> for Structure
[src]

Performs the conversion.

impl AsMut<StructureRef> for Structure
[src]

Performs the conversion.

impl Clone for Structure
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Drop for Structure
[src]

Executes the destructor for this type. Read more

impl Debug for Structure
[src]

Formats the value using the given formatter. Read more

impl Display for Structure
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Structure
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialEq<StructureRef> for Structure
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Structure
[src]

impl FromStr for Structure
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Borrow<StructureRef> for Structure
[src]

Immutably borrows from an owned value. Read more

impl BorrowMut<StructureRef> for Structure
[src]

Mutably borrows from an owned value. Read more

impl StaticType for Structure
[src]

Returns the type identifier of Self.

impl<'a> ToGlibPtr<'a, *const GstStructure> for Structure
[src]

Transfer: none. Read more

Transfer: full. Read more

Transfer: container. Read more

impl<'a> ToGlibPtr<'a, *mut GstStructure> for Structure
[src]

Transfer: none. Read more

Transfer: full. Read more

Transfer: container. Read more

impl<'a> ToGlibPtrMut<'a, *mut GstStructure> for Structure
[src]

Transfer: none. Read more

impl FromGlibPtrNone<*const GstStructure> for Structure
[src]

impl FromGlibPtrNone<*mut GstStructure> for Structure
[src]

impl FromGlibPtrFull<*const GstStructure> for Structure
[src]

impl FromGlibPtrFull<*mut GstStructure> for Structure
[src]

impl<'a> FromValueOptional<'a> for Structure
[src]

impl SetValue for Structure
[src]

impl SetValueOptional for Structure
[src]

impl GlibPtrDefault for Structure
[src]

impl Serialize for Structure
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Structure
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl !Sync for Structure