#[repr(C)]pub struct VARIANT { /* private fields */ }
oleaut
only.Expand description
VARIANT
struct.
Automatically calls
VariantClear
when the object goes out of scope.
The Default
implementation returns a
co::VT::EMPTY
value.
Implementations§
source§impl VARIANT
impl VARIANT
sourcepub fn new_idispatch(val: &impl oleaut_IDispatch) -> Self
pub fn new_idispatch(val: &impl oleaut_IDispatch) -> Self
Creates a new object holding an IDispatch
COM
value.
Note that val
will be cloned into the VARIANT
– that is,
IUnknown::AddRef
will be called –, so val
will remain valid to be used thereafter.
sourcepub fn idispatch<T>(&self) -> Option<T>where
T: oleaut_IDispatch,
pub fn idispatch<T>(&self) -> Option<T>where
T: oleaut_IDispatch,
If the object holds an IDispatch
COM value,
returns it, otherwise None
.
Note that the returned object will be a clone – that is,
IUnknown::AddRef
will be called.
sourcepub fn new_iunknown<T>(val: &impl ole_IUnknown) -> Self
pub fn new_iunknown<T>(val: &impl ole_IUnknown) -> Self
Creates a new object holding an IUnknown
COM value.
Note that val
will be cloned into the VARIANT
– that is,
IUnknown::AddRef
will be called –, so val
will remain valid to be used thereafter.
sourcepub fn iunknown<T>(&self) -> Option<T>where
T: ole_IUnknown,
pub fn iunknown<T>(&self) -> Option<T>where
T: ole_IUnknown,
If the object holds an IUnknown
COM value, returns
it, otherwise None
.
Note that the returned object will be a clone – that is,
IUnknown::AddRef
will be called.
Trait Implementations§
source§impl oleaut_Variant for VARIANT
impl oleaut_Variant for VARIANT
source§unsafe fn from_raw(vt: VT, data: &[u8]) -> Self
unsafe fn from_raw(vt: VT, data: &[u8]) -> Self
u8
elements will be
actually copied. Read moresource§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
co::VT::EMPTY
.source§fn is_null(&self) -> bool
fn is_null(&self) -> bool
co::VT::NULL
.source§fn new_bstr(val: &str) -> HrResult<Self>where
Self: Sized,
fn new_bstr(val: &str) -> HrResult<Self>where
Self: Sized,
BSTR
value.source§fn bstr(&self) -> Option<String>
fn bstr(&self) -> Option<String>
BSTR
value, returns it, otherwise
None
.source§fn new_time(val: &SYSTEMTIME) -> SysResult<Self>where
Self: Sized,
fn new_time(val: &SYSTEMTIME) -> SysResult<Self>where
Self: Sized,
source§fn time(&self) -> Option<SYSTEMTIME>
fn time(&self) -> Option<SYSTEMTIME>
None
.