Skip to main content

ValueTableImpl

Trait ValueTableImpl 

Source
pub trait ValueTableImpl:
    StaticType
    + Into<Value>
    + Send
    + Sync
    + 'static {
    // Required methods
    fn serialize(&self) -> Result<GString, BoolError>;
    fn deserialize(
        s: &str,
        pspec: Option<&ParamSpec>,
    ) -> Result<Self, BoolError>;

    // Provided methods
    fn compare(&self, _other: &Self) -> Option<Ordering> { ... }
    fn hash(&self) -> Option<u32> { ... }
}
Expand description

How GStreamer serializes, deserializes, compares and hashes values of a type.

After value_register(), GstValueExt works for values of this type, so for example properties of this type can be set from a string in gst-launch-1.0 or a pipeline description.

Required Methods§

Source

fn serialize(&self) -> Result<GString, BoolError>

Returns the string representation of self.

Source

fn deserialize(s: &str, pspec: Option<&ParamSpec>) -> Result<Self, BoolError>

Creates a value from its string representation.

pspec is the property the value is deserialized for, if any.

Provided Methods§

Source

fn compare(&self, _other: &Self) -> Option<Ordering>

Compares self with other, returning None if they are not comparable.

The default considers values not comparable.

Source

fn hash(&self) -> Option<u32>

Returns a hash of self, consistent with compare(), or None if the value can’t be hashed, which is the default.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§