[][src]Struct gstreamer_base::Value

#[repr(C)]
pub struct Value(_, _);

A generic value capable of carrying various types.

Once created the type of the value can't be changed.

Some types (e.g. String and objects) support None values while others (e.g. numeric types) don't.

Value does not implement the Send trait, but SendValue can be used instead.

See the module documentation for more details.

Methods

impl Value[src]

pub fn from_type(type_: Type) -> Value[src]

Creates a new Value that is initialized with type_

pub fn downcast<'a, T>(self) -> Result<TypedValue<T>, Value> where
    T: FromValueOptional<'a> + SetValue
[src]

Tries to downcast to a TypedValue.

Returns Ok(TypedValue<T>) if the value carries a type corresponding to T and Err(self) otherwise.

pub fn downcast_ref<'a, T>(&self) -> Option<&TypedValue<T>> where
    T: FromValueOptional<'a> + SetValue
[src]

Tries to downcast to a &TypedValue.

Returns Some(&TypedValue<T>) if the value carries a type corresponding to T and None otherwise.

pub fn get<'a, T>(&'a self) -> Option<T> where
    T: FromValueOptional<'a>, 
[src]

Tries to get a value of type T.

Returns Some if the type is correct and the value is not None.

This function doesn't distinguish between type mismatches and correctly typed None values. Use downcast or is for that.

pub fn is<'a, T>(&self) -> bool where
    T: FromValueOptional<'a> + SetValue
[src]

Returns true if the type of the value corresponds to T or is a sub-type of T.

pub fn type_(&self) -> Type[src]

Returns the type of the value.

pub fn type_transformable(src: Type, dst: Type) -> bool[src]

Returns whether Values of type src can be transformed to type dst.

pub fn try_into_send_value<'a, T>(self) -> Result<SendValue, Value> where
    T: FromValueOptional<'a> + SetValue + Send
[src]

Trait Implementations

impl GstValueExt for Value[src]

impl ToValue for Value[src]

impl FromGlibPtrNone<*const GValue> for Value[src]

impl FromGlibPtrNone<*mut GValue> for Value[src]

impl Drop for Value[src]

impl<'a> ToGlibContainerFromSlice<'a, *mut GValue> for &'a Value[src]

impl<'a> ToGlibContainerFromSlice<'a, *const GValue> for &'a Value[src]

impl FromGlibContainerAsVec<*mut GValue, *const *mut GValue> for Value[src]

impl FromGlibContainerAsVec<*mut GValue, *mut *mut GValue> for Value[src]

impl Clone for Value[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> ToGlibPtrMut<'a, *mut GValue> for Value[src]

type Storage = &'a mut Value

impl Uninitialized for Value[src]

impl Debug for Value[src]

impl FromGlibPtrFull<*mut GValue> for Value[src]

impl FromGlibPtrArrayContainerAsVec<*mut GValue, *mut *mut GValue> for Value[src]

impl FromGlibPtrArrayContainerAsVec<*mut GValue, *const *mut GValue> for Value[src]

impl<'a> ToGlibPtr<'a, *const GValue> for Value[src]

type Storage = &'a Value

fn to_glib_container(&'a self) -> Stash<'a, P, Self>[src]

Transfer: container. Read more

fn to_glib_full(&self) -> P[src]

Transfer: full. Read more

impl From<SendValue> for Value[src]

impl<'a, T> From<&'a T> for Value where
    T: SetValue + ?Sized
[src]

impl<'a, T> From<Option<&'a T>> for Value where
    T: SetValueOptional + ?Sized
[src]

impl<T> From<TypedValue<T>> for Value[src]

Auto Trait Implementations

impl !Send for Value

impl !Sync for Value

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]