[][src]Struct lifted::K1

pub struct K1<Me: ?Sized, T> { /* fields omitted */ }

An instance of a type produced by a unary type constructor.

You can freely convert between the wrapper and implementation types with new and the inner_* methods:

use lifted::types::OptionC;

let something: Option<i32> = Some(42);
let mut wrapped: K1<OptionC, i32> = K1::new(something);

assert!(wrapped.inner().is_some());

wrapped.inner_mut().take();

assert!(wrapped.into_inner().is_none());

Implementations

impl<Me: ?Sized + Kind1<T>, T> K1<Me, T>[src]

pub fn new(t: <Me as Kind1<T>>::Inner) -> Self[src]

Wrap an instance in the higher-kinded wrapper.

use lifted::types::OptionC;
let wrapped: K1<OptionC, i32> = K1::new(None);

There is also an alias in the Kind1 trait which you can use to produce a wrapped type.

let wrapped: K1<OptionC, i32> = OptionC::new(Some(42));

pub fn inner(&self) -> &<Me as Kind1<T>>::Inner[src]

Get a shared reference to the implementation type.

use lifted::types::OptionC;

let nothing: K1<OptionC, i32> = OptionC::new(None);
assert!(nothing.inner().is_none());

pub fn inner_mut(&mut self) -> &mut <Me as Kind1<T>>::Inner[src]

Get an exclusive reference to the implementation type.

use lifted::types::OptionC;

let mut nothing: K1<OptionC, i32> = OptionC::new(None);
*nothing.inner_mut() = Some(42);
assert!(nothing.inner().is_some());

pub fn into_inner(self) -> <Me as Kind1<T>>::Inner[src]

Extract the implementation type from the wrapper.

use lifted::types::OptionC;

let wrapped: K1<OptionC, i32> = OptionC::new(Some(42));
let unwrapped = wrapped.into_inner();
assert_eq!(Some(42), unwrapped);

Trait Implementations

impl<Me: ?Sized + Kind1<T>, T> Clone for K1<Me, T> where
    <Me as Kind1<T>>::Inner: Clone
[src]

impl<Me: ?Sized + Kind1<T>, T> Debug for K1<Me, T> where
    <Me as Kind1<T>>::Inner: Debug
[src]

impl<C: Kind2<A, B>, A, B> From<K1<K2P1_1<C, A>, B>> for K2<C, A, B>[src]

impl<C: Kind2<A, B>, A, B> From<K1<K2P1_2<C, B>, A>> for K2<C, A, B>[src]

impl<C: Kind2<A, B>, A, B> From<K2<C, A, B>> for K1<K2P1_1<C, A>, B>[src]

impl<C: Kind2<A, B>, A, B> From<K2<C, A, B>> for K1<K2P1_2<C, B>, A>[src]

impl<Me: ?Sized + Kind1<T>, T> PartialEq<K1<Me, T>> for K1<Me, T> where
    <Me as Kind1<T>>::Inner: PartialEq
[src]

Auto Trait Implementations

impl<Me: ?Sized, T> RefUnwindSafe for K1<Me, T> where
    Me: RefUnwindSafe,
    T: RefUnwindSafe

impl<Me, T> !Send for K1<Me, T>

impl<Me, T> !Sync for K1<Me, T>

impl<Me: ?Sized, T> Unpin for K1<Me, T> where
    Me: Unpin,
    T: Unpin

impl<Me: ?Sized, T> UnwindSafe for K1<Me, T> where
    Me: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.