ExternInput

Trait ExternInput 

Source
pub unsafe trait ExternInput<TS: TypeSystem>: ExternType<TS> + Sized {
    type Lease;
    type Owned;

    // Required methods
    unsafe fn into_foreign_parameter(
        self,
    ) -> ComResult<(Self::ForeignType, Self::Lease)>;
    unsafe fn from_foreign_parameter(
        source: Self::ForeignType,
    ) -> ComResult<Self::Owned>;
}
Expand description

Defines a type that may be used as a parameter type in Intercom interfaces.

§Safety

Implementing this trait allows Intercom to use the type as an input type. This trait will be used within the code generated in the procedural macros. It is important to ensure this trait is implemented in such a way that its use in the macros is sound.

Required Associated Types§

Required Methods§

Source

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

§Safety

The returned ForeignType value is valid only as long as the Lease is held.

Source

unsafe fn from_foreign_parameter( source: Self::ForeignType, ) -> ComResult<Self::Owned>

§Safety

The validity of the returned Owned value depends on the source type. In general it shouldn’t be used past the lifetime of the source reference.

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.

Implementations on Foreign Types§

Source§

impl ExternInput<AutomationTypeSystem> for String

Source§

impl ExternInput<RawTypeSystem> for String

Source§

impl<'a> ExternInput<AutomationTypeSystem> for &'a str

Source§

impl<'a> ExternInput<RawTypeSystem> for &'a str

Source§

type Lease = CString

Source§

type Owned = &'a str

Source§

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

Source§

unsafe fn from_foreign_parameter( source: Self::ForeignType, ) -> ComResult<Self::Owned>

Source§

impl<'a, TS: TypeSystem, I> ExternInput<TS> for Option<&'a ComItf<I>>

Source§

type Lease = ()

Source§

type Owned = Option<ComItf<I>>

Source§

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

Source§

unsafe fn from_foreign_parameter( source: Self::ForeignType, ) -> ComResult<Self::Owned>

Source§

impl<TS: TypeSystem> ExternInput<TS> for c_void

Source§

impl<TS: TypeSystem> ExternInput<TS> for bool

Source§

impl<TS: TypeSystem> ExternInput<TS> for f32

Source§

impl<TS: TypeSystem> ExternInput<TS> for f64

Source§

impl<TS: TypeSystem> ExternInput<TS> for i8

Source§

impl<TS: TypeSystem> ExternInput<TS> for i16

Source§

impl<TS: TypeSystem> ExternInput<TS> for i32

Source§

impl<TS: TypeSystem> ExternInput<TS> for i64

Source§

impl<TS: TypeSystem> ExternInput<TS> for isize

Source§

impl<TS: TypeSystem> ExternInput<TS> for u8

Source§

impl<TS: TypeSystem> ExternInput<TS> for u16

Source§

impl<TS: TypeSystem> ExternInput<TS> for u32

Source§

impl<TS: TypeSystem> ExternInput<TS> for u64

Source§

impl<TS: TypeSystem> ExternInput<TS> for ()

Source§

impl<TS: TypeSystem> ExternInput<TS> for usize

Source§

impl<TS: TypeSystem, I> ExternInput<TS> for Option<ComRc<I>>

Source§

type Lease = Option<ComRc<I>>

Source§

type Owned = Option<ComRc<I>>

Source§

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

Source§

unsafe fn from_foreign_parameter(source: Self::ForeignType) -> ComResult<Self>

Source§

impl<TS: TypeSystem, TPtr: ForeignType + ?Sized> ExternInput<TS> for *const TPtr

Source§

impl<TS: TypeSystem, TPtr: ForeignType + ?Sized> ExternInput<TS> for *mut TPtr

Implementors§

Source§

impl ExternInput<AutomationTypeSystem> for BString

Source§

impl ExternInput<AutomationTypeSystem> for CString

Source§

impl ExternInput<RawTypeSystem> for BString

Source§

impl ExternInput<RawTypeSystem> for CString

Source§

impl<'a> ExternInput<AutomationTypeSystem> for &'a BStr

Source§

impl<'a> ExternInput<AutomationTypeSystem> for &'a CStr

Source§

impl<'a> ExternInput<RawTypeSystem> for &'a BStr

Source§

impl<'a> ExternInput<RawTypeSystem> for &'a CStr

Source§

impl<'a, TS: TypeSystem, I> ExternInput<TS> for &'a ComItf<I>

Source§

impl<TS: TypeSystem> ExternInput<TS> for Variant

Source§

impl<TS: TypeSystem> ExternInput<TS> for TypeSystemName

Source§

impl<TS: TypeSystem> ExternInput<TS> for HRESULT

Source§

impl<TS: TypeSystem> ExternInput<TS> for BSTR

Source§

impl<TS: TypeSystem> ExternInput<TS> for GUID

Source§

impl<TS: TypeSystem, I> ExternInput<TS> for ComRc<I>