Struct oaidl::Variant [−][src]
pub struct Variant<T: VariantExt>(_);
Helper struct to wrap a VARIANT compatible type into a VT_VARIANT marked VARIANT
Methods
impl<T: VariantExt> Variant<T>
[src]
impl<T: VariantExt> Variant<T>
Variant<T: VariantExt>
type to wrap an impl of VariantExt
- creates a VARIANT of VT_VARIANT
which wraps an inner variant that points to T.
pub fn new(t: T) -> Variant<T>
[src]
pub fn new(t: T) -> Variant<T>
default constructor
pub fn unwrap(self) -> T
[src]
pub fn unwrap(self) -> T
Get access to the inner value and the Variant is consumed
pub fn borrow(&self) -> &T
[src]
pub fn borrow(&self) -> &T
Borrow reference to inner value
pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
Borrow mutable reference to inner value
pub fn into_variant(&mut self) -> Result<Ptr<VARIANT>, IntoVariantError>
[src]
pub fn into_variant(&mut self) -> Result<Ptr<VARIANT>, IntoVariantError>
Converts the Variant<T>
into a Ptr<VARIANT>
Returns Result<Ptr<VARIANT>, IntoVariantError>
pub fn from_variant(var: Ptr<VARIANT>) -> Result<Variant<T>, FromVariantError>
[src]
pub fn from_variant(var: Ptr<VARIANT>) -> Result<Variant<T>, FromVariantError>
Converts Ptr<VARIANT>
into Variant<T>
Returns Result<Variant<T>>, FromVariantError>
Trait Implementations
impl<T: VariantExt> SafeArrayElement for Variant<T>
[src]
impl<T: VariantExt> SafeArrayElement for Variant<T>
const SFTYPE: u32
SFTYPE: u32 = VT_VARIANT
This is the VT value used to create the SAFEARRAY
fn from_safearray(
psa: *mut SAFEARRAY,
ix: i32
) -> Result<Self, FromSafeArrElemError>
[src]
fn from_safearray(
psa: *mut SAFEARRAY,
ix: i32
) -> Result<Self, FromSafeArrElemError>
gets a type from the safearray at the specified index (default impls use SafeArrayGetElement)
fn into_safearray(
&mut self,
psa: *mut SAFEARRAY,
ix: i32
) -> Result<(), IntoSafeArrElemError>
[src]
fn into_safearray(
&mut self,
psa: *mut SAFEARRAY,
ix: i32
) -> Result<(), IntoSafeArrElemError>
puts a type into the safearray at the specified index (default impls use SafeArrayPutElement)
impl<T: Clone + VariantExt> Clone for Variant<T>
[src]
impl<T: Clone + VariantExt> Clone for Variant<T>
fn clone(&self) -> Variant<T>
[src]
fn clone(&self) -> Variant<T>
Returns 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<T: Copy + VariantExt> Copy for Variant<T>
[src]
impl<T: Copy + VariantExt> Copy for Variant<T>
impl<T: Debug + VariantExt> Debug for Variant<T>
[src]
impl<T: Debug + VariantExt> Debug for Variant<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Eq + VariantExt> Eq for Variant<T>
[src]
impl<T: Eq + VariantExt> Eq for Variant<T>
impl<T: Hash + VariantExt> Hash for Variant<T>
[src]
impl<T: Hash + VariantExt> Hash for Variant<T>
fn hash<__HT: Hasher>(&self, state: &mut __HT)
[src]
fn hash<__HT: Hasher>(&self, state: &mut __HT)
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: Ord + VariantExt> Ord for Variant<T>
[src]
impl<T: Ord + VariantExt> Ord for Variant<T>
fn cmp(&self, other: &Variant<T>) -> Ordering
[src]
fn cmp(&self, other: &Variant<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T: PartialEq + VariantExt> PartialEq for Variant<T>
[src]
impl<T: PartialEq + VariantExt> PartialEq for Variant<T>
fn eq(&self, other: &Variant<T>) -> bool
[src]
fn eq(&self, other: &Variant<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Variant<T>) -> bool
[src]
fn ne(&self, other: &Variant<T>) -> bool
This method tests for !=
.
impl<T: PartialOrd + VariantExt> PartialOrd for Variant<T>
[src]
impl<T: PartialOrd + VariantExt> PartialOrd for Variant<T>
fn partial_cmp(&self, other: &Variant<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Variant<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Variant<T>) -> bool
[src]
fn lt(&self, other: &Variant<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Variant<T>) -> bool
[src]
fn le(&self, other: &Variant<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Variant<T>) -> bool
[src]
fn gt(&self, other: &Variant<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Variant<T>) -> bool
[src]
fn ge(&self, other: &Variant<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: VariantExt> AsRef<T> for Variant<T>
[src]
impl<T: VariantExt> AsRef<T> for Variant<T>
impl<T: VariantExt> AsMut<T> for Variant<T>
[src]
impl<T: VariantExt> AsMut<T> for Variant<T>
impl<T: VariantExt> VariantExt for Variant<T>
[src]
impl<T: VariantExt> VariantExt for Variant<T>
const VARTYPE: u32
VARTYPE: u32 = VT_VARIANT
VARTYPE constant value for the type
fn from_variant(var: Ptr<VARIANT>) -> Result<Self, FromVariantError>
[src]
fn from_variant(var: Ptr<VARIANT>) -> Result<Self, FromVariantError>
Call this associated function on a Ptr to obtain a value T
fn into_variant(&mut self) -> Result<Ptr<VARIANT>, IntoVariantError>
[src]
fn into_variant(&mut self) -> Result<Ptr<VARIANT>, IntoVariantError>
Convert a value of type T into a Ptr