Trait winsafe::prelude::oleaut_Variant
source · pub trait oleaut_Variant: Default {
Show 27 methods
// Required methods
fn raw(&self) -> &[u8; 16];
unsafe fn from_raw(vt: VT, data: &[u8]) -> Self;
fn vt(&self) -> VT;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn is_null(&self) -> bool { ... }
fn new_bool(val: bool) -> Self
where Self: Sized { ... }
fn bool(&self) -> Option<bool> { ... }
fn new_bstr(val: &str) -> HrResult<Self>
where Self: Sized { ... }
fn bstr(&self) -> Option<String> { ... }
fn new_f32(val: f32) -> Self
where Self: Sized { ... }
fn f32(&self) -> Option<f32> { ... }
fn new_f64(val: f64) -> Self
where Self: Sized { ... }
fn f64(&self) -> Option<f64> { ... }
fn new_i8(val: i8) -> Self
where Self: Sized { ... }
fn i8(&self) -> Option<i8> { ... }
fn new_i16(val: i16) -> Self
where Self: Sized { ... }
fn i16(&self) -> Option<i16> { ... }
fn new_i32(val: i32) -> Self
where Self: Sized { ... }
fn i32(&self) -> Option<i32> { ... }
fn new_time(val: &SYSTEMTIME) -> SysResult<Self>
where Self: Sized { ... }
fn time(&self) -> Option<SYSTEMTIME> { ... }
fn new_u8(val: u8) -> Self
where Self: Sized { ... }
fn u8(&self) -> Option<u8> { ... }
fn new_u16(val: u16) -> Self
where Self: Sized { ... }
fn u16(&self) -> Option<u16> { ... }
fn new_u32(val: u32) -> Self
where Self: Sized { ... }
fn u32(&self) -> Option<u32> { ... }
}
Available on crate features
kernel
and oleaut
only.Expand description
This trait is enabled with the oleaut
feature, and provides common methods
for VARIANT
and PROPVARIANT
.
Prefer importing this trait through the prelude:
use winsafe::prelude::*;
Required Methods§
sourcefn raw(&self) -> &[u8; 16]
fn raw(&self) -> &[u8; 16]
Returns a reference to the raw data being held.
This method can be used as an escape hatch to interoperate with other libraries.
Provided Methods§
sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Tells whether no value is being held, that is, the variant type is
co::VT::EMPTY
.
sourcefn is_null(&self) -> bool
fn is_null(&self) -> bool
Tells whether the object holds an SQL style null, that is, the variant
type is co::VT::NULL
.
sourcefn new_bstr(val: &str) -> HrResult<Self>where
Self: Sized,
fn new_bstr(val: &str) -> HrResult<Self>where
Self: Sized,
Creates a new object holding a BSTR
value.
sourcefn new_time(val: &SYSTEMTIME) -> SysResult<Self>where
Self: Sized,
fn new_time(val: &SYSTEMTIME) -> SysResult<Self>where
Self: Sized,
Creates a new object holding a date/time value.
sourcefn time(&self) -> Option<SYSTEMTIME>
fn time(&self) -> Option<SYSTEMTIME>
If the object holds a date/time value, returns it, otherwise None
.
Object Safety§
This trait is not object safe.