Struct glib::variant::Variant [−][src]
pub struct Variant(_);
A generic immutable value capable of carrying various types.
See the module documentation for more details.
Methods
impl Variant[src]
impl Variantpub fn type_(&self) -> &VariantTy[src]
pub fn type_(&self) -> &VariantTyReturns the type of the value.
pub fn is<T: StaticVariantType>(&self) -> bool[src]
pub fn is<T: StaticVariantType>(&self) -> boolReturns true if the type of the value corresponds to T.
pub fn get<T: FromVariant>(&self) -> Option<T>[src]
pub fn get<T: FromVariant>(&self) -> Option<T>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]
pub fn get_str(&self) -> Option<&str>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 Clone for Variantfn clone(&self) -> Variant[src]
fn clone(&self) -> VariantReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl StaticType for Variant[src]
impl StaticType for Variantfn static_type() -> Type[src]
fn static_type() -> TypeReturns the type identifier of Self.
impl Send for Variant[src]
impl Send for Variantimpl Sync for Variant[src]
impl Sync for Variantimpl Debug for Variant[src]
impl Debug for Variantfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Display for Variant[src]
impl Display for Variantfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Variant[src]
impl PartialEq for Variantfn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for Variant[src]
impl Eq for Variantimpl PartialOrd for Variant[src]
impl PartialOrd for Variantfn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Hash for Variant[src]
impl Hash for Variantfn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<T: ToVariant> From<T> for Variant[src]
impl<T: ToVariant> From<T> for Variant