Trait rust2fun::higher::Higher

source ·
pub trait Higher {
    type Param;
    type Target<T>: Higher<Param = T>;

    // Provided method
    fn unsafe_cast<T, R>(self) -> R
       where Self: Higher<Param = T> + Sized,
             R: Higher<Param = T> { ... }
}
Expand description

Implementation of Lightweight Higher Kinded Type for a type of kind * -> *.

Required Associated Types§

source

type Param

Type parameter abstracted by Higher, e.g. Option<Param>.

source

type Target<T>: Higher<Param = T>

Swapped higher type, e.g. Target = Option<T>.

Provided Methods§

source

fn unsafe_cast<T, R>(self) -> Rwhere Self: Higher<Param = T> + Sized, R: Higher<Param = T>,

Unsafe cast from one Higher type to another. This is a safe operation as long as the resulting type is the same as the original type. Might be useful for building abstractions.

Implementations on Foreign Types§

source§

impl<P> Higher for Option<P>

§

type Param = P

§

type Target<T> = Option<T>

source§

impl<K, V> Higher for HashMap<K, V>

§

type Param = V

§

type Target<T> = HashMap<K, T, RandomState>

source§

impl<P> Higher for LinkedList<P>

§

type Param = P

§

type Target<T> = LinkedList<T, Global>

source§

impl<P> Higher for Vec<P>

§

type Param = P

§

type Target<T> = Vec<T, Global>

source§

impl<P> Higher for VecDeque<P>

§

type Param = P

§

type Target<T> = VecDeque<T, Global>

source§

impl<P, E> Higher for Result<P, E>

§

type Param = P

§

type Target<T> = Result<T, E>

source§

impl<P> Higher for PhantomData<P>

§

type Param = P

§

type Target<T> = PhantomData<T>

source§

impl<P> Higher for BinaryHeap<P>

§

type Param = P

§

type Target<T> = BinaryHeap<T, Global>

source§

impl<P> Higher for BTreeSet<P>

§

type Param = P

§

type Target<T> = BTreeSet<T, Global>

source§

impl<P> Higher for HashSet<P>

§

type Param = P

§

type Target<T> = HashSet<T, RandomState>

source§

impl<P> Higher for Box<P>

§

type Param = P

§

type Target<T> = Box<T, Global>

Implementors§

source§

impl<P> Higher for NEVec<P>

§

type Param = P

§

type Target<T> = NEVec<T>

source§

impl<P, E> Higher for Validated<P, E>

§

type Param = P

§

type Target<T> = Validated<T, E>