Struct gmime::Variant [−]
pub struct Variant(_);
A generic immutable value capable of carrying various types.
See the module documentation for more details.
Methods
impl Variant
impl Variantpub fn type_(&self) -> &VariantTy
pub fn type_(&self) -> &VariantTyReturns the type of the value.
pub fn is<T>(&self) -> bool where
T: StaticVariantType,
pub fn is<T>(&self) -> bool where
T: StaticVariantType, Returns true if the type of the value corresponds to T.
pub fn get<T>(&self) -> Option<T> where
T: FromVariant,
pub fn get<T>(&self) -> Option<T> where
T: FromVariant, Tries to extract a value of type T.
Returns Some if T matches the variant's type.
pub fn get_str(&self) -> Option<&str>
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 Sync for Variant
impl Sync for Variantimpl Hash for Variant
impl Hash for Variantfn hash<H>(&self, state: &mut H) where
H: Hasher,
fn hash<H>(&self, state: &mut H) where
H: Hasher, 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 PartialEq<Variant> for Variant
impl PartialEq<Variant> for Variantfn eq(&self, other: &Variant) -> bool
fn eq(&self, other: &Variant) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for Variant
impl Eq for Variantimpl Clone for Variant
impl Clone for Variantfn clone(&self) -> Variant
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 Debug for Variant
impl Debug for Variantfn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl<T> From<T> for Variant where
T: ToVariant,
impl<T> From<T> for Variant where
T: ToVariant, impl Display for Variant
impl Display for Variantfn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl StaticType for Variant
impl StaticType for Variantfn static_type() -> Type
fn static_type() -> TypeReturns the type identifier of Self.
impl Send for Variant
impl Send for Variant