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]
fn type_(&self) -> &VariantTy
Returns the type of the value.
fn is<T: StaticVariantType>(&self) -> bool
Returns true if the type of the value corresponds to T.
fn get<T: FromVariant>(&self) -> Option<T>
Tries to extract a value of type T.
Returns Some if T matches the variant's type.
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]
fn clone(&self) -> Variant
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Send for Variant[src]
impl Sync for Variant[src]
impl Debug for Variant[src]
impl Display for Variant[src]
impl PartialEq for Variant[src]
fn eq(&self, other: &Self) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl Eq for Variant[src]
impl Hash for Variant[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
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more