Trait SafeArrayExt

Source
pub trait SafeArrayExt<T: SafeArrayElement> {
    // Required methods
    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§

Source

fn into_safearray(&mut self) -> Result<Ptr<SAFEARRAY>, SafeArrayError>

Use t.into_safearray() to convert a type into a SAFEARRAY

Source

fn from_safearray(psa: Ptr<SAFEARRAY>) -> Result<Vec<T>, SafeArrayError>

Use T::from_safearray(psa) to convert a safearray pointer into the relevant T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Itr, Elem> SafeArrayExt<<Itr as Iterator>::Item> for Itr
where 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