pub unsafe trait AbiExportableImplementation {
type AbiInterface: ?Sized + AbiExportable;
const ABI_ENTRY: unsafe extern "C" fn(AbiProtocol);
// Required method
fn new() -> Box<Self::AbiInterface>;
}Expand description
Trait that is to be implemented for the implementation of a trait whose dyn trait type
implements AbiExportable.
If MyExampleTrait is an ABI-exportable trait, and MyExampleImplementation is an
implementation of MyExampleTrait, then:
- The
AbiInterfaceassociated type must bedyn MyExampleTrait AbiExportableImplementationmust be implemented forMyExampleImplementation
§Safety
The following must be fulfilled:
- ABI_ENTRY must be a valid function, implementing the AbiProtocol-protocol.
- AbiInterface must be ‘dyn SomeTrait’, where ‘SomeTrait’ is an exported trait.
Required Associated Constants§
Sourceconst ABI_ENTRY: unsafe extern "C" fn(AbiProtocol)
const ABI_ENTRY: unsafe extern "C" fn(AbiProtocol)
An entry point which implements the AbiProtocol protocol
Required Associated Types§
Sourcetype AbiInterface: ?Sized + AbiExportable
type AbiInterface: ?Sized + AbiExportable
The type ‘dyn SomeTrait’.
Required Methods§
Sourcefn new() -> Box<Self::AbiInterface>
fn new() -> Box<Self::AbiInterface>
A method which must be able to return a default-implementation of dyn SomeTrait.
I.e, the returned box is a boxed dyn trait, not ‘Self’ (the actual implementation type).
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.