Wrapper

Trait Wrapper 

Source
pub trait Wrapper<T> {
    type Cont<U>: ?Sized;

    // Required methods
    fn get(&self) -> &T;
    fn view(&self) -> Self::Cont<&T>;
}
Expand description

The Wrapper trait established a higher-kinded interface for single-value containers.

Required Associated Types§

Source

type Cont<U>: ?Sized

Required Methods§

Source

fn get(&self) -> &T

returns a reference to the inner value

Source

fn view(&self) -> Self::Cont<&T>

returns a view of the container containing an immutable reference to the inner value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Wrapper<T> for T

Source§

type Cont<U> = U