savefile_abi

Trait AbiExportableImplementation

source
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 AbiInterface associated type must be dyn MyExampleTrait
  • AbiExportableImplementation must be implemented for MyExampleImplementation

§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§

source

const ABI_ENTRY: unsafe extern "C" fn(_: AbiProtocol)

An entry point which implements the AbiProtocol protocol

Required Associated Types§

source

type AbiInterface: ?Sized + AbiExportable

The type ‘dyn SomeTrait’.

Required Methods§

source

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.

Implementors§