[−][src]Struct win_variant::SafeArray
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
impl SafeArray
[src]
pub fn new_vector(
vt: VARTYPE,
lower_bound: LONG,
length: u32
) -> Result<SafeArray, SafeArrayError>
[src]
vt: VARTYPE,
lower_bound: LONG,
length: u32
) -> Result<SafeArray, SafeArrayError>
Creates a new vector based safe array.
pub fn destroy(&mut self) -> Result<(), SafeArrayError>
[src]
destroys the safe array properly, do not call this if the array was passed as an argument for a VariantArg.
pub fn dimensions_count(&self) -> Result<u16, SafeArrayError>
[src]
Reutrns the number of dimensions in the array
pub fn dimension_lower_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
[src]
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
Gets the lower bound of the dimension, dimension index starts at 1
pub fn dimension_upper_bound(
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
[src]
&self,
dimension: u32
) -> Result<LONG, SafeArrayError>
Gets the upper bound of the dimension, dimension index starts at 1
pub fn dimensions(&self) -> Result<Vec<SAFEARRAYBOUND>, SafeArrayError>
[src]
Gets all the details of the dimensions in the array.
pub fn get_vartype(&self) -> Result<VARTYPE, SafeArrayError>
[src]
Gets the data type for the elements in the array
Trait Implementations
impl Debug for SafeArray
[src]
impl Drop for SafeArray
[src]
impl From<*mut SAFEARRAY> for SafeArray
[src]
impl Into<VARIANT> for SafeArray
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<&'_ String>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<&String>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<&'_ str>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<&str>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<String>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<String>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<bool>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<bool>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<f32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<f32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<f64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<f64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<i16>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<i16>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<i32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<i32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<i64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<i64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<u16>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<u16>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<u32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<u32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ ArrayBase<OwnedRepr<u64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &ArrayD<u64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<&'_ String, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<&String>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<&'_ str, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<&str>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<String, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<String>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<bool, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(val: &Vec<bool>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<f32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<f32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<f64, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<f64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<i16, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<i16>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<i32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<i32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<i64, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<i64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<u16, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<u16>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<u32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<u32>) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ Vec<u64, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_from(value: &Vec<u64>) -> Result<Self, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<String>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<String>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<bool>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<bool>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<f32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<f32>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<f64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<f64>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<i16>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<i16>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<i32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<i32>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<i64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<i64>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<u16>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<u16>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<u32>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<u32>, Self::Error>
[src]
impl TryInto<ArrayBase<OwnedRepr<u64>, Dim<IxDynImpl>>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<ArrayD<u64>, Self::Error>
[src]
impl TryInto<Vec<String, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<String>, Self::Error>
[src]
impl TryInto<Vec<bool, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<bool>, Self::Error>
[src]
impl TryInto<Vec<f32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<f32>, Self::Error>
[src]
impl TryInto<Vec<f64, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<f64>, Self::Error>
[src]
impl TryInto<Vec<i16, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<i16>, Self::Error>
[src]
impl TryInto<Vec<i32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<i32>, Self::Error>
[src]
impl TryInto<Vec<i64, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<i64>, Self::Error>
[src]
impl TryInto<Vec<u16, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<u16>, Self::Error>
[src]
impl TryInto<Vec<u32, Global>> for SafeArray
[src]
type Error = SafeArrayError
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<Vec<u32>, Self::Error>
[src]
impl TryInto<Vec<u64, Global>> for SafeArray
[src]
Auto Trait Implementations
impl RefUnwindSafe for SafeArray
[src]
impl !Send for SafeArray
[src]
impl !Sync for SafeArray
[src]
impl Unpin for SafeArray
[src]
impl UnwindSafe for SafeArray
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,