glib::variant

Trait FromVariant

Source
pub trait FromVariant: Sized + StaticVariantType {
    // Required method
    fn from_variant(variant: &Variant) -> Option<Self>;
}
Expand description

Extracts a value.

Required Methods§

Source

fn from_variant(variant: &Variant) -> Option<Self>

Tries to extract a value.

Returns Some if the variant’s type matches Self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromVariant for bool

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for f64

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for i16

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for i32

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for i64

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for u8

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for u16

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for u32

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for u64

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for ()

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for String

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for OsString

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl FromVariant for PathBuf

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<K, V> FromVariant for BTreeMap<K, V>
where K: FromVariant + Eq + Ord, V: FromVariant,

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<K, V, H> FromVariant for HashMap<K, V, H>

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0> FromVariant for (T0,)
where T0: FromVariant,

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1> FromVariant for (T0, T1)
where T0: FromVariant, T1: FromVariant,

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2> FromVariant for (T0, T1, T2)
where T0: FromVariant, T1: FromVariant, T2: FromVariant,

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3> FromVariant for (T0, T1, T2, T3)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4> FromVariant for (T0, T1, T2, T3, T4)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5> FromVariant for (T0, T1, T2, T3, T4, T5)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6> FromVariant for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromVariant for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T: FromVariant> FromVariant for Vec<T>

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Source§

impl<T: StaticVariantType + FromVariant> FromVariant for Option<T>

Source§

fn from_variant(variant: &Variant) -> Option<Self>

Implementors§