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).
Object Safety§
This trait is not object safe.