[][src]Struct glib::variant::Variant

pub struct Variant(_);

A generic immutable value capable of carrying various types.

See the module documentation for more details.

Methods

impl Variant[src]

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

Returns the type of the value.

pub fn is<T: StaticVariantType>(&self) -> bool[src]

Returns true if the type of the value corresponds to T.

pub fn get<T: FromVariant>(&self) -> Option<T>[src]

Tries to extract a value of type T.

Returns Some if T matches the variant's type.

pub fn get_str(&self) -> Option<&str>[src]

Tries to extract a &str.

Returns Some if the variant has a string type (s, o or g type strings).

Trait Implementations

impl Clone for Variant[src]

impl Debug for Variant[src]

impl Display for Variant[src]

impl Eq for Variant[src]

impl<T: ToVariant> From<T> for Variant[src]

impl Hash for Variant[src]

impl PartialEq<Variant> for Variant[src]

impl PartialOrd<Variant> for Variant[src]

impl Send for Variant[src]

impl StaticType for Variant[src]

impl Sync for Variant[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.