Struct win_variant::SafeArray
source · [−]pub struct SafeArray { /* private fields */ }
Expand description
SafeArray
provides an ergnomic structure that allows for converting
SAFEARRAY
data structures from a VARIANT
into Vec
or ArrayD
. The
structure also destroys the SAFEARRAY
when the SafeArray
instance is
dropped.
If the SafeArray
is converted to a VARIANT
the memory is now owned by
VARIANT
and free_variant
should be called on the VARIANT
to properly
release all the memory.
Implementations
sourceimpl SafeArray
impl SafeArray
sourcepub fn new_vector(
vt: VARTYPE,
lower_bound: LONG,
length: u32
) -> Result<SafeArray, SafeArrayError>
pub fn new_vector(
vt: VARTYPE,
lower_bound: LONG,
length: u32
) -> Result<SafeArray, SafeArrayError>
Creates a new vector based safe array.
sourcepub fn destroy(&mut self) -> Result<(), SafeArrayError>
pub fn destroy(&mut self) -> Result<(), SafeArrayError>
destroys the safe array properly, do not call this if the array was passed as an argument for a VariantArg.
sourcepub fn dimensions_count(&self) -> Result<u16, SafeArrayError>
pub fn dimensions_count(&self) -> Result<u16, SafeArrayError>
Reutrns the number of dimensions in the array
sourcepub fn dimension_lower_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
pub fn dimension_lower_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
Gets the lower bound of the dimension, dimension index starts at 1
sourcepub fn dimension_upper_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
pub fn dimension_upper_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
Gets the upper bound of the dimension, dimension index starts at 1
sourcepub fn dimensions(&self) -> Result<Vec<SAFEARRAYBOUND>, SafeArrayError>
pub fn dimensions(&self) -> Result<Vec<SAFEARRAYBOUND>, SafeArrayError>
Gets all the details of the dimensions in the array.
sourcepub fn get_vartype(&self) -> Result<VARTYPE, SafeArrayError>
pub fn get_vartype(&self) -> Result<VARTYPE, SafeArrayError>
Gets the data type for the elements in the array
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SafeArray
impl !Send for SafeArray
impl !Sync for SafeArray
impl Unpin for SafeArray
impl UnwindSafe for SafeArray
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more