[][src]Trait abi_stable::InterfaceType

pub trait InterfaceType: Sized {
type Send;
type Sync;
type Clone;
type Default;
type Display;
type Debug;
type Serialize;
type Eq;
type PartialEq;
type Ord;
type PartialOrd;
type Hash;
type Deserialize;
type Iterator;
type DoubleEndedIterator;
type FmtWrite;
type IoWrite;
type IoSeek;
type IoRead;
type IoBufRead;
}

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.

type Clone

type Default

type Display

type Debug

type Serialize

type Eq

type PartialEq

type Ord

type PartialOrd

type Hash

type Deserialize

type Iterator

type DoubleEndedIterator

type FmtWrite

type IoWrite

type IoSeek

type IoRead

type IoBufRead

Loading content...

Implementations on Foreign Types

impl InterfaceType for ()[src]

Loading content...

Implementors

impl InterfaceType for CloneInterface[src]

type Clone = True

type IoWrite = False

type PartialEq = False

type DoubleEndedIterator = False

type Default = False

type Serialize = False

type Ord = False

type Sync = True

type Debug = False

type Iterator = False

type IoRead = False

type Send = True

type IoBufRead = False

type Eq = False

type Deserialize = False

type Hash = False

type PartialOrd = False

type IoSeek = False

type Display = False

type FmtWrite = False

impl InterfaceType for DefaultInterface[src]

type Default = True

type DoubleEndedIterator = False

type Hash = False

type Display = False

type Send = True

type IoSeek = False

type PartialEq = False

type Clone = False

type Ord = False

type Eq = False

type Serialize = False

type Deserialize = False

type FmtWrite = False

type IoWrite = False

type Debug = False

type PartialOrd = False

type IoRead = False

type Sync = True

type Iterator = False

type IoBufRead = False

impl InterfaceType for FmtWriteInterface[src]

type Debug = True

type FmtWrite = True

type Iterator = False

type Send = True

type PartialEq = False

type Sync = True

type Deserialize = False

type Serialize = False

type Default = False

type Ord = False

type IoRead = False

type Display = False

type IoSeek = False

type Clone = False

type Hash = False

type PartialOrd = False

type DoubleEndedIterator = False

type IoWrite = False

type IoBufRead = False

type Eq = False

impl InterfaceType for PartialEqInterface[src]

type Debug = True

type PartialEq = True

type Serialize = False

type Ord = False

type Deserialize = False

type DoubleEndedIterator = False

type Display = False

type Default = False

type Iterator = False

type Eq = False

type Hash = False

type Send = True

type FmtWrite = False

type IoSeek = False

type IoRead = False

type IoBufRead = False

type Sync = True

type Clone = False

type IoWrite = False

type PartialOrd = False

impl<K, V> InterfaceType for MutIterInterface<K, V>[src]

impl<K, V> InterfaceType for RefIterInterface<K, V>[src]

impl<K, V> InterfaceType for ValIterInterface<K, V>[src]

impl<T> InterfaceType for DEIteratorInterface<T>[src]

type Iterator = True

type DoubleEndedIterator = True

type IoBufRead = False

type FmtWrite = False

type Debug = False

type PartialEq = False

type IoWrite = False

type IoRead = False

type Display = False

type Deserialize = False

type Sync = True

type IoSeek = False

type PartialOrd = False

type Hash = False

type Clone = False

type Serialize = False

type Ord = False

type Eq = False

type Send = True

type Default = False

impl<T> InterfaceType for IteratorInterface<T>[src]

type Iterator = True

type Eq = False

type Deserialize = False

type Hash = False

type PartialEq = False

type IoBufRead = False

type PartialOrd = False

type Serialize = False

type Send = True

type FmtWrite = False

type IoRead = False

type Ord = False

type IoWrite = False

type Sync = True

type Clone = False

type Default = False

type IoSeek = False

type Display = False

type DoubleEndedIterator = False

type Debug = False

Loading content...