[−][src]Trait abi_stable::InterfaceType
Defines the usable/required traits when creating a
DynTrait<Pointer<()>,ThisInterfaceType>
from a type that implements ImplType<Interface= ThisInterfaceType >
.
This trait can only be implemented within the impl_InterfaceType
macro,
giving a default value to each associated type,
so that adding associated types is not a breaking change.
The value of every associated type is True
/False
.
On True
,the trait would be required by and usable in DynTrait
.
On False
,the trait would not be required by and not usable in DynTrait
.
Example
use abi_stable::{ StableAbi, impl_InterfaceType, erased_types::InterfaceType, type_level::bools::*, }; #[repr(C)] #[derive(StableAbi)] pub struct FooInterface; impl_InterfaceType!{ impl InterfaceType for FooInterface { type Clone=True; type Debug=True; ///////////////////////////////////// //// defaulted associated types ///////////////////////////////////// // Changing this to require/unrequire in minor versions,is an abi breaking change. // type Send=True; // Changing this to require/unrequire in minor versions,is an abi breaking change. // type Sync=True; // type Iterator=False; // type DoubleEndedIterator=False; // type Default=False; // type Display=False; // type Serialize=False; // type Eq=False; // type PartialEq=False; // type Ord=False; // type PartialOrd=False; // type Hash=False; // type Deserialize=False; // type FmtWrite=False; // type IoWrite=False; // type IoSeek=False; // type IoRead=False; // type IoBufRead=False; } }
Associated Types
type Send
Changing this to require/unrequire in minor versions,is an abi breaking change.
type Sync
Changing this to require/unrequire in minor versions,is an abi breaking change.