Trait typewit::TypeWitnessTypeArg

source ·
pub trait TypeWitnessTypeArg {
    type Arg: ?Sized;
}
Expand description

Gets the type argument that this type witness witnesses.

example shared with MakeTypeWitness

A type witness is an enum whose variants only have TypeEq fields. Each variant requires the enum’s type parameter to be a specific type.

This trait should be implemented generically, as generic as the type definition of the implementor, doing so will help type inference.

Required Associated Types§

source

type Arg: ?Sized

The type parameter used for type witnesses.

Usually, enums that implement this trait have variants with TypeEq<Self::Arg, SomeType> fields.

Implementors§

source§

impl<L: ?Sized, R: ?Sized> TypeWitnessTypeArg for TypeEq<L, R>

§

type Arg = L

source§

impl<L: ?Sized, R: ?Sized, W> TypeWitnessTypeArg for MetaBaseTypeWit<L, R, W>

§

type Arg = W

source§

impl<const B: bool> TypeWitnessTypeArg for BoolWit<B>

§

type Arg = Bool<B>