[−][src]Struct lifted::K2
An instance of a type produced by a binary type constructor.
You can freely convert between the wrapper and implementation types
with new
and the inner_*
methods:
use lifted::types::ResultC; let great: Result<i32, String> = Ok(42); let mut wrapped: K2<ResultC, i32, String> = K2::new(great); assert!(wrapped.inner().is_ok()); *wrapped.inner_mut() = Err("does not compute".into()); assert!(wrapped.into_inner().is_err());
Implementations
impl<Me: ?Sized + Kind2<T, U>, T, U> K2<Me, T, U>
[src]
pub fn new(t: <Me as Kind2<T, U>>::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 Kind2<T, U>>::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 Kind2<T, U>>::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 Kind2<T, U>>::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);
impl<C: Kind2<A, B>, A, B> K2<C, A, B>
[src]
pub fn flatten(curried: K1<K2P1_1<C, A>, B>) -> Self
[src]
pub fn unflatten(self) -> K1<K2P1_1<C, A>, B>
[src]
Trait Implementations
impl<Me: ?Sized + Kind2<T, U>, T, U> Clone for K2<Me, T, U> where
<Me as Kind2<T, U>>::Inner: Clone,
[src]
<Me as Kind2<T, U>>::Inner: Clone,
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Me: ?Sized + Kind2<T, U>, T, U> Debug for K2<Me, T, U> where
<Me as Kind2<T, U>>::Inner: Debug,
[src]
<Me as Kind2<T, U>>::Inner: Debug,
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 + Kind2<T, U>, T, U> PartialEq<K2<Me, T, U>> for K2<Me, T, U> where
<Me as Kind2<T, U>>::Inner: PartialEq,
[src]
<Me as Kind2<T, U>>::Inner: PartialEq,
Auto Trait Implementations
impl<Me: ?Sized, T, U> RefUnwindSafe for K2<Me, T, U> where
Me: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
Me: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<Me, T, U> !Send for K2<Me, T, U>
impl<Me, T, U> !Sync for K2<Me, T, U>
impl<Me: ?Sized, T, U> Unpin for K2<Me, T, U> where
Me: Unpin,
T: Unpin,
U: Unpin,
Me: Unpin,
T: Unpin,
U: Unpin,
impl<Me: ?Sized, T, U> UnwindSafe for K2<Me, T, U> where
Me: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Me: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,