[][src]Trait abi_stable::InterfaceType

pub trait InterfaceType: Sized + 'static + Send + Sync + GetImplFlags + StableAbi {
type Clone;
type Default;
type Display;
type Debug;
type Serialize;
type Eq;
type PartialEq;
type Ord;
type PartialOrd;
type Hash;
type Deserialize;
}

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;
    }
}


Associated Types

type Clone

type Default

type Display

type Debug

type Serialize

type Eq

type PartialEq

type Ord

type PartialOrd

type Hash

type Deserialize

Loading content...

Implementations on Foreign Types

impl InterfaceType for ()[src]

type Display = False

type Serialize = False

type Default = False

type Clone = False

type Debug = False

type PartialOrd = False

type Ord = False

type Hash = False

type Deserialize = False

type Eq = False

type PartialEq = False

Loading content...

Implementors

Loading content...