[−][src]Trait abi_stable::InterfaceType
Defines the usable/required traits when creating a
VirtualWrapper<Pointer<ZeroSized< ThisType >>>
from a type that implements ImplType<Interface= ThisType >
.
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 VirtualWrapper
.
On False
,the trait would not be required by and not usable in VirtualWrapper
.
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 ///////////////////////////////////// // 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; } }