Trait oaidl::SafeArrayExt
source · pub trait SafeArrayExt<T: SafeArrayElement> {
fn into_safearray(&mut self) -> Result<Ptr<SAFEARRAY>, SafeArrayError>;
fn from_safearray(psa: Ptr<SAFEARRAY>) -> Result<Vec<T>, SafeArrayError>;
}
Expand description
Workhorse trait and main interface for converting to/from SAFEARRAY.
Default impl is on ExactSizeIterator<Item=SafeArrayElement>
Required Methods§
sourcefn into_safearray(&mut self) -> Result<Ptr<SAFEARRAY>, SafeArrayError>
fn into_safearray(&mut self) -> Result<Ptr<SAFEARRAY>, SafeArrayError>
Use t.into_safearray()
to convert a type into a SAFEARRAY
sourcefn from_safearray(psa: Ptr<SAFEARRAY>) -> Result<Vec<T>, SafeArrayError>
fn from_safearray(psa: Ptr<SAFEARRAY>) -> Result<Vec<T>, SafeArrayError>
Use T::from_safearray(psa)
to convert a safearray pointer into the relevant T
Implementors§
impl<Itr, Elem> SafeArrayExt<<Itr as Iterator>::Item> for Itrwhere
Itr: ExactSizeIterator,
Itr::Item: SafeArrayElement<Element = Elem> + TryConvert<Elem, ElementError>,
Elem: TryConvert<Itr::Item, ElementError>,
Blanket implementation, requires that TryConvert
is implement between Itr::Item
and Elem
where
Elem
is the target type for conversion into/from the SAFEARRAY