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§
Sourceunsafe fn into_foreign_parameter(
self,
) -> ComResult<(Self::ForeignType, Self::Lease)>
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.
Sourceunsafe fn from_foreign_parameter(
source: Self::ForeignType,
) -> ComResult<Self::Owned>
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.