Skip to main content

Cons

Struct Cons 

Source
pub struct Cons<T, R> {
    pub value: T,
    pub rest: R,
}

Fields§

§value: T§rest: R

Trait Implementations§

Source§

impl<T, R: HList> Access<T, Zero> for Cons<T, R>

Source§

type Remainder = R

Source§

fn take(self) -> (T, Self::Remainder)

Source§

fn get(&self) -> &T

Source§

fn get_mut(&mut self) -> &mut T

Source§

impl<T, U, R: Access<U, N>, N> Access<U, Succ<N>> for Cons<T, R>

Source§

type Remainder = Cons<T, <R as Access<U, N>>::Remainder>

Source§

fn take(self) -> (U, Self::Remainder)

Source§

fn get(&self) -> &U

Source§

fn get_mut(&mut self) -> &mut U

Source§

impl<'a, F, T: 'a> Any<'a, F> for Cons<T, Nil>
where F: CallOnce<(&'a T,), Output = bool>,

Source§

fn any(&'a self, f: F) -> bool

Source§

impl<'a, F, T: 'a, R> Any<'a, F> for Cons<T, R>
where F: CallMut<(&'a T,), Output = bool>, R: Any<'a, F> + NonEmpty,

Source§

fn any(&'a self, f: F) -> bool

Source§

impl<'a, F, T: 'a, N> Any<'a, F, (N, ())> for Cons<T, Nil>
where F: CallOnce<(&'a T,), N, Output = bool>,

Source§

fn any(&'a self, f: F) -> bool

Source§

impl<'a, F, T: 'a, R, N, M> Any<'a, F, (N, M)> for Cons<T, R>
where F: CallMut<(&'a T,), N, Output = bool>, R: Any<'a, F, M> + NonEmpty,

Source§

fn any(&'a self, f: F) -> bool

Source§

impl<'a, T: 'a, R: AsRef<'a>> AsRef<'a> for Cons<T, R>

Source§

type Ref = Cons<&'a T, <R as AsRef<'a>>::Ref>

Source§

type RefMut = Cons<&'a mut T, <R as AsRef<'a>>::RefMut>

Source§

fn as_ref(&'a self) -> Self::Ref

Source§

fn as_mut(&'a mut self) -> Self::RefMut

Source§

impl<Args, N, F, R: Call<Args, N>> Call<Args, Succ<N>> for Cons<F, R>

Source§

fn call(&self, args: Args) -> Self::Output

Source§

impl<Args, F: Fn(Args) -> O, O, R> Call<Args, Zero> for Cons<F, R>

Source§

fn call(&self, args: Args) -> Self::Output

Source§

impl<Args, N, F, R: CallMut<Args, N>> CallMut<Args, Succ<N>> for Cons<F, R>

Source§

fn call_mut(&mut self, args: Args) -> Self::Output

Source§

impl<Args, F: FnMut(Args) -> O, O, R> CallMut<Args, Zero> for Cons<F, R>

Source§

fn call_mut(&mut self, args: Args) -> Self::Output

Source§

impl<Args, N, F, R: CallOnce<Args, N>> CallOnce<Args, Succ<N>> for Cons<F, R>

Source§

type Output = <R as CallOnce<Args, N>>::Output

Source§

fn call_once(self, args: Args) -> Self::Output

Source§

impl<Args, F: FnOnce(Args) -> O, O, R> CallOnce<Args, Zero> for Cons<F, R>

Source§

type Output = O

Source§

fn call_once(self, args: Args) -> Self::Output

Source§

impl<T: Clone, R: Clone> Clone for Cons<T, R>

Source§

fn clone(&self) -> Cons<T, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, R: Concat<L>, L: HList> Concat<L> for Cons<T, R>

Source§

type Output = Cons<T, <R as Concat<L>>::Output>

Source§

fn concat(self, other: L) -> Self::Output

Source§

impl<T, R: HList> Convert for Cons<T, R>

Source§

type HList = Cons<T, R>

Source§

fn into_hlist(self) -> Self::HList

Source§

fn from_hlist(this: Self::HList) -> Self

Source§

impl<T: Debug, R: Debug> Debug for Cons<T, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, R> DeepTransformFrom<Cons<T, R>, ()> for Nil

Source§

fn deep_transform_from(_: Cons<T, R>) -> Self

Source§

impl<T, Rt, L: DeepTransform<Rt, Ri>, I, Ri> DeepTransformFrom<Cons<Unnamed<T>, L>, (I, Ri)> for Cons<Unnamed<T>, Rt>

Source§

fn deep_transform_from(list: Cons<Unnamed<T>, L>) -> Self

Source§

impl<T, Rt, L, I, Ti, Ri, Name> DeepTransformFrom<L, (I, Ti, Ri)> for Cons<Named<T, Name>, Rt>
where L: RemoveField<Name, I>, L::Value: DeepTransform<T, Ti>, L::Remainder: DeepTransform<Rt, Ri>,

Source§

fn deep_transform_from(list: L) -> Self

Source§

impl<T: Hash, R: Hash> Hash for Cons<T, R>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T, R, C, N, M> IntoSuperset<C, Cons<PhantomData<N>, M>> for CoCons<T, R>
where C: Access<T, N>, R: IntoSuperset<C, M>,

Source§

fn into_superset(self) -> C

Source§

impl<F: CallOnce<(T,)>, T> Map<F> for Cons<T, Nil>

Source§

type Output = Cons<<F as CallOnce<(T,)>>::Output, Nil>

Source§

fn map(self, f: F) -> Self::Output

Source§

impl<F: CallMut<(T,)>, T, R: NonEmpty + Map<F>> Map<F> for Cons<T, R>

Source§

type Output = Cons<<F as CallOnce<(T,)>>::Output, <R as Map<F>>::Output>

Source§

fn map(self, f: F) -> Self::Output

Source§

impl<F: CallOnce<(T,), N>, T, N> Map<F, (N, ())> for Cons<T, Nil>

Source§

type Output = Cons<<F as CallOnce<(T,), N>>::Output, Nil>

Source§

fn map(self, f: F) -> Self::Output

Source§

impl<F: CallMut<(T,), N>, T, R: NonEmpty + Map<F, M>, N, M> Map<F, (N, M)> for Cons<T, R>

Source§

type Output = Cons<<F as CallOnce<(T,), N>>::Output, <R as Map<F, M>>::Output>

Source§

fn map(self, f: F) -> Self::Output

Source§

impl<T: Ord, R: Ord> Ord for Cons<T, R>

Source§

fn cmp(&self, other: &Cons<T, R>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq, R: PartialEq> PartialEq for Cons<T, R>

Source§

fn eq(&self, other: &Cons<T, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, R: PartialOrd> PartialOrd for Cons<T, R>

Source§

fn partial_cmp(&self, other: &Cons<T, R>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T, Name, R: RemoveField<Name, N>, N> RemoveField<Name, Succ<N>> for Cons<T, R>

Source§

type Value = <R as RemoveField<Name, N>>::Value

Source§

type Remainder = Cons<T, <R as RemoveField<Name, N>>::Remainder>

Source§

fn remove_field(self) -> (Self::Value, Self::Remainder)

Source§

impl<T, Name, R> RemoveField<Name, Zero> for Cons<Named<T, Name>, R>

Source§

type Value = T

Source§

type Remainder = R

Source§

fn remove_field(self) -> (Self::Value, Self::Remainder)

Source§

impl<T, U, R: HList, S: HList, N, M> Split<Cons<U, S>, Cons<PhantomData<N>, M>> for Cons<T, R>
where Self: Access<U, N>, <Self as Access<U, N>>::Remainder: Split<S, M>,

Source§

type Remainder = <<Cons<T, R> as Access<U, N>>::Remainder as Split<S, M>>::Remainder

Source§

fn split(self) -> (Cons<U, S>, Self::Remainder)

Source§

impl<T, R> Transform for Cons<T, R>
where Self: AnonType,

Source§

type Canon = Cons<T, R>

Source§

fn from_canon(anon: Self::Canon) -> Self

Source§

fn into_canon(self) -> Self::Canon

Source§

fn transform<O: Transform, N>(self) -> O
where Self::Canon: Shuffle<O::Canon, N>,

Source§

fn deep_transform<O: Transform, N>(self) -> O
where Self::Canon: DeepTransform<O::Canon, N>,

Source§

impl<A, F, T, O, E> TryFold<A, F> for Cons<T, Nil>
where F: CallOnce<(A, T), Output = Result<O, E>>,

Source§

type Output = O

Source§

type Error = CoCons<E, CoNil>

Source§

fn try_fold(self, acc: A, f: F) -> Result<Self::Output, Self::Error>

Source§

impl<A, F, T, R, O, E> TryFold<A, F> for Cons<T, R>
where F: CallMut<(A, T), Output = Result<O, E>>, R: NonEmpty + TryFold<O, F> + HList,

Source§

type Output = <R as TryFold<O, F>>::Output

Source§

type Error = CoCons<E, <R as TryFold<O, F>>::Error>

Source§

fn try_fold(self, acc: A, f: F) -> Result<Self::Output, Self::Error>

Source§

impl<A, F, T, O, E, N> TryFold<A, F, (N, ())> for Cons<T, Nil>
where F: CallOnce<(A, T), N, Output = Result<O, E>>,

Source§

type Output = O

Source§

type Error = CoCons<E, CoNil>

Source§

fn try_fold(self, acc: A, f: F) -> Result<Self::Output, Self::Error>

Source§

impl<A, F, T, R, O, E, N, M> TryFold<A, F, (N, M)> for Cons<T, R>
where F: CallMut<(A, T), N, Output = Result<O, E>>, R: NonEmpty + TryFold<O, F, M> + HList,

Source§

type Output = <R as TryFold<O, F, M>>::Output

Source§

type Error = CoCons<E, <R as TryFold<O, F, M>>::Error>

Source§

fn try_fold(self, acc: A, f: F) -> Result<Self::Output, Self::Error>

Source§

impl<T, U, R: UnZip> UnZip for Cons<(T, U), R>

Source§

type Left = Cons<T, <R as UnZip>::Left>

Source§

type Right = Cons<U, <R as UnZip>::Right>

Source§

type Flipped = Cons<(U, T), <R as UnZip>::Flipped>

Source§

fn unzip(self) -> (Self::Left, Self::Right)

Source§

fn flip(self) -> Self::Flipped

Source§

impl<T, U, R: Zip<S>, S> Zip<Cons<U, S>> for Cons<T, R>

Source§

type Output = Cons<(T, U), <R as Zip<S>>::Output>

Source§

fn zip(self, other: Cons<U, S>) -> Self::Output

Source§

impl<T, R: AnonType, Name> AnonType for Cons<Named<T, Name>, R>

Source§

impl<T, R: AnonType> AnonType for Cons<Unnamed<T>, R>

Source§

impl<T: Copy, R: Copy> Copy for Cons<T, R>

Source§

impl<T: Eq, R: Eq> Eq for Cons<T, R>

Source§

impl<T, R: HList> HList for Cons<T, R>

Source§

impl<T, R: HList> NonEmpty for Cons<T, R>

Source§

impl<T, R> StructuralPartialEq for Cons<T, R>

Auto Trait Implementations§

§

impl<T, R> Freeze for Cons<T, R>
where T: Freeze, R: Freeze,

§

impl<T, R> RefUnwindSafe for Cons<T, R>

§

impl<T, R> Send for Cons<T, R>
where T: Send, R: Send,

§

impl<T, R> Sync for Cons<T, R>
where T: Sync, R: Sync,

§

impl<T, R> Unpin for Cons<T, R>
where T: Unpin, R: Unpin,

§

impl<T, R> UnsafeUnpin for Cons<T, R>
where T: UnsafeUnpin, R: UnsafeUnpin,

§

impl<T, R> UnwindSafe for Cons<T, R>
where T: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Access for T

Source§

fn field<N, T, Name: 'static>(&self) -> &T
where Self: Access<Named<T, Name>, N>,

Source§

fn field_mut<N, T, Name: 'static>(&mut self) -> &mut T
where Self: Access<Named<T, Name>, N>,

Source§

fn take_field<N, T, Name>(self) -> (T, Self::Remainder)
where Self: Access<Named<T, Name>, N>,

Source§

impl<'a, F, T, TagList> All<'a, F, TagList> for T
where T: Any<'a, Not<F>, TagList>,

Source§

fn all(&'a self, f: F) -> bool

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, U, I> DeepTransform<T, I> for U
where T: DeepTransformFrom<U, I>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoNamed for T
where T: AnonType,

Source§

fn into_named<T, N>(self) -> T
where Self: Shuffle<T::Canon, N>, T: Transform,

Source§

impl<T, R, C, N, M> IntoSubset<CoCons<T, R>, Cons<PhantomData<N>, M>> for C
where R: CoProd, C: Access<T, N>, <C as Access<T, N>>::Remainder: IntoSubset<R, M>,

Source§

type Remainder = <<C as Access<T, N>>::Remainder as IntoSubset<R, M>>::Remainder

Source§

fn into_subset( self, ) -> Result<CoCons<T, R>, <C as IntoSubset<CoCons<T, R>, Cons<PhantomData<N>, M>>>::Remainder>

Source§

impl<T, U, N> Shuffle<U, N> for T
where T: HList + Split<U, N, Remainder = Nil>, U: HList,

Source§

fn shuffle(self) -> T

Source§

impl<T> Split<Nil, Nil> for T
where T: HList,

Source§

type Remainder = T

Source§

fn split(self) -> (Nil, <T as Split<Nil, Nil>>::Remainder)

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.