pub trait SafeArrayElementwhere
    Self: Sized,{ }
Expand description

Helper trait implemented for types that can be converted into a safe array.

Implemented for types:

Example usage

Generally, you shouldn’t implement this on your types without great care. Therefore this example only shows the basic interface, but not implementation details.

extern crate oaidl;
extern crate winapi;
 
use std::vec::IntoIter;
use oaidl::{SafeArrayElement, SafeArrayExt, SafeArrayError};
 
fn main() -> Result<(), SafeArrayError> {
    let v = vec![-3i16, -2, -1, 0, 1, 2, 3];
    let arr = v.into_iter().into_safearray()?;
    let out = IntoIter::<i16>::from_safearray(arr)?;    
    println!("{:?}", out);
    Ok(())
}

Implementations on Foreign Types§

source§

impl SafeArrayElement for u32

SafeArrayElement impl for u32. This allows it to be converted into SAFEARRAY with vt = VT_UI4.

source§

impl SafeArrayElement for u16

SafeArrayElement impl for u16. This allows it to be converted into SAFEARRAY with vt = VT_UI2.

source§

impl SafeArrayElement for u8

SafeArrayElement impl for u8. This allows it to be converted into SAFEARRAY with vt = VT_UI1.

source§

impl SafeArrayElement for f64

SafeArrayElement impl for f64. This allows it to be converted into SAFEARRAY with vt = VT_R8.

source§

impl SafeArrayElement for i8

SafeArrayElement impl for i8. This allows it to be converted into SAFEARRAY with vt = VT_I1.

source§

impl SafeArrayElement for U16String

SafeArrayElement impl for U16String. This allows it to be converted into SAFEARRAY with vt = VT_BSTR. This overrides the default implementation of into_safearray because *mut *mut u16 is the incorrect type to put in a SAFEARRAY.

source§

impl SafeArrayElement for f32

SafeArrayElement impl for f32. This allows it to be converted into SAFEARRAY with vt = VT_R4.

source§

impl SafeArrayElement for i32

SafeArrayElement impl for i32. This allows it to be converted into SAFEARRAY with vt = VT_I4.

source§

impl SafeArrayElement for i16

SafeArrayElement impl for i16. This allows it to be converted into SAFEARRAY with vt = VT_I2.

Implementors§

source§

impl SafeArrayElement for Currency

SafeArrayElement impl for Currency:struct.Currency.html . This allows it to be converted into SAFEARRAY with vt = VT_CY.

source§

impl SafeArrayElement for Date

SafeArrayElement impl for [‘Date’]: struct.Date.html. This allows it to be converted into SAFEARRAY with vt = VT_DATE.

source§

impl SafeArrayElement for DecWrapper

SafeArrayElement impl for [‘DecWrapper’]. This allows it to be converted into SAFEARRAY with vt = VT_DECIMAL.

source§

impl SafeArrayElement for Int

SafeArrayElement impl for Int. This allows it to be converted into SAFEARRAY with vt = VT_INT.

source§

impl SafeArrayElement for Ptr<IDispatch>

SafeArrayElementimpl for ['Ptr<IDispatch>']. This allows it to be converted into SAFEARRAY with vt =VT_DISPATCH. This overrides the default impl of from_safearrayandinto_safearray` because *mut IDispatch doesn’t need an additional indirection to be put into a SAFEARRAY.

source§

impl SafeArrayElement for Ptr<IUnknown>

SafeArrayElementimpl for ['Ptr<IUnknown>']. This allows it to be converted into SAFEARRAY with vt =VT_UNKNOWN. This overrides the default impl of from_safearrayandinto_safearray` because *mut IUnknown doesn’t need an additional indirection to be put into a SAFEARRAY.

source§

impl SafeArrayElement for SCode

SafeArrayElement impl for [‘SCode’]. This allows it to be converted into SAFEARRAY with vt = VT_ERROR.

source§

impl SafeArrayElement for UInt

SafeArrayElement impl for UInt. This allows it to be converted into SAFEARRAY with vt = VT_INT.

source§

impl SafeArrayElement for VariantBool

SafeArrayElement impl for [‘VariantBool’]. This allows it to be converted into SAFEARRAY with vt = VT_BOOL.

source§

impl<D, T> SafeArrayElement for Variant<D, T>where D: VariantExt<T>,

SafeArrayElementimpl for ['Variant<D,T>']. This allows it to be converted into SAFEARRAY with vt =VT_VARIANT. This overrides the default impl of from_safearrayandinto_safearraybecause*mut VARIANTdoesn't need an additional indirection to be put into aSAFEARRAY`.