pub unsafe trait ExternOutput<TS: TypeSystem>: ExternType<TS> + Sized {
// Required methods
fn into_foreign_output(self) -> ComResult<Self::ForeignType>;
unsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>;
// Provided method
unsafe fn drop_foreign_output(source: Self::ForeignType) { ... }
}Expand description
Defines a type that may be used as an output type in Intercom interfaces.
§Safety
Implementing this trait allows Intercom to use the type as an output 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 Methods§
fn into_foreign_output(self) -> ComResult<Self::ForeignType>
Sourceunsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
unsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
§Safety
The source ownership is transferred to the function invoker. In case of
pointers, the function (or the Self type) is given the ownership of
the memory. The caller must ensure that it owns the source parameter
and is allowed to pass the ownership in this way.
Provided Methods§
Sourceunsafe fn drop_foreign_output(source: Self::ForeignType)
unsafe fn drop_foreign_output(source: Self::ForeignType)
§Safety
The source ownership is transferred to the function invoker. In case of
pointers, the function (or the Self type) is given the ownership of
the memory. The caller must ensure that it owns the source parameter
and is allowed to pass the ownership in this way.
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.