Queue

Struct Queue 

Source
pub struct Queue<Q>(pub Q);
Expand description

Heterogenous queue Supports pushing, splitting to init and last Mapping and folding

Tuple Fields§

§0: Q

Implementations§

Source§

impl Queue<()>

Source

pub fn new() -> Queue<()>

Source§

impl<Q> Queue<Q>

Source

pub fn push<V>(self, value: V) -> Queue<(Queue<Q>, V)>

Source§

impl<H, T> Queue<(Queue<H>, T)>

Source

pub fn init(&self) -> &Queue<H>

Source

pub fn last(&self) -> &T

Trait Implementations§

Source§

impl<'a> ByRef<'a> for Queue<()>

Source§

type Refs = Queue<()>

Source§

fn by_ref(&'a self) -> Self::Refs

Source§

impl<'a, H, T: 'a, R: 'a> ByRef<'a> for Queue<(H, T)>
where H: ByRef<'a, Refs = R> + 'a,

Source§

type Refs = Queue<(R, &'a T)>

Source§

fn by_ref(&'a self) -> Self::Refs

Source§

impl<Q: Clone> Clone for Queue<Q>

Source§

fn clone(&self) -> Queue<Q>

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<Q: Debug> Debug for Queue<Q>

Source§

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

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

impl<I, F> Foldable<I, F> for Queue<()>

Source§

fn fold(self, init: I, _: F) -> I

fold sequence using Function starting with Init value
Source§

impl<I, F, H, T> Foldable<I, F> for Queue<(H, T)>
where H: for<'a> Foldable<I, &'a mut F>, F: FnMut<(T, I), Output = I>,

Source§

fn fold(self, init: I, f: F) -> I

fold sequence using Function starting with Init value
Source§

impl<'a, F> Functor<F> for &'a Queue<()>

Source§

type Output = Queue<()>

Result of mapping
Source§

fn fmap(self, _: F) -> Queue<()>

Map sequence using Function
Source§

impl<'a, F, H, T, O, U> Functor<F> for &'a Queue<(H, T)>
where &'a H: for<'b> Functor<&'b mut F, Output = U>, F: FnMut<(&'a T,), Output = O>,

Source§

type Output = Queue<(U, O)>

Result of mapping
Source§

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

Map sequence using Function
Source§

impl<'a, F, H, T, O, U> Functor<F> for &'a mut Queue<(H, T)>
where &'a mut H: for<'b> Functor<&'b mut F, Output = U>, F: FnMut<(&'a mut T,), Output = O>,

Source§

type Output = Queue<(U, O)>

Result of mapping
Source§

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

Map sequence using Function
Source§

impl<F> Functor<F> for Queue<()>

Source§

type Output = Queue<()>

Result of mapping
Source§

fn fmap(self, _: F) -> Queue<()>

Map sequence using Function
Source§

impl<F, H, T, O, U> Functor<F> for Queue<(H, T)>
where H: for<'a> Functor<&'a mut F, Output = U>, F: FnMut<(T,), Output = O>,

Source§

type Output = Queue<(U, O)>

Result of mapping
Source§

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

Map sequence using Function
Source§

impl Length for Queue<()>

Source§

impl<H, T> Length for Queue<(H, T)>
where H: Length,

Source§

impl<Q: Ord> Ord for Queue<Q>

Source§

fn cmp(&self, other: &Queue<Q>) -> 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<Q: PartialEq> PartialEq for Queue<Q>

Source§

fn eq(&self, other: &Queue<Q>) -> 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<Q: PartialOrd> PartialOrd for Queue<Q>

Source§

fn partial_cmp(&self, other: &Queue<Q>) -> 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<E> Try<E> for Queue<()>

Source§

type Ok = Queue<()>

Sequence of Ok Results
Source§

fn try(self) -> Result<Queue<()>, E>

Source§

impl<E, H, T, Z> Try<E> for Queue<(H, Result<T, E>)>
where H: Try<E, Ok = Z>,

Source§

type Ok = Queue<(Z, T)>

Sequence of Ok Results
Source§

fn try(self) -> Result<Queue<(Z, T)>, E>

Source§

impl Zip<Queue<()>> for Queue<()>

Source§

type Zipped = Queue<()>

Source§

fn zip(self, _: Queue<()>) -> Queue<()>

Source§

impl<LH, LT, RH, RT, ZH> Zip<Queue<(RH, RT)>> for Queue<(LH, LT)>
where LH: Zip<RH, Zipped = ZH>,

Source§

type Zipped = Queue<(ZH, (LT, RT))>

Source§

fn zip(self, right: Queue<(RH, RT)>) -> Self::Zipped

Source§

impl<Q: Copy> Copy for Queue<Q>

Source§

impl<Q: Eq> Eq for Queue<Q>

Source§

impl<Q> StructuralPartialEq for Queue<Q>

Auto Trait Implementations§

§

impl<Q> Freeze for Queue<Q>
where Q: Freeze,

§

impl<Q> RefUnwindSafe for Queue<Q>
where Q: RefUnwindSafe,

§

impl<Q> Send for Queue<Q>
where Q: Send,

§

impl<Q> Sync for Queue<Q>
where Q: Sync,

§

impl<Q> Unpin for Queue<Q>
where Q: Unpin,

§

impl<Q> UnwindSafe for Queue<Q>
where Q: UnwindSafe,

Blanket Implementations§

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> 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<Q> IntoList for Q
where Q: IntoListImpl<List<()>>,

Source§

type List = <Q as IntoListImpl<List<()>>>::List

Source§

fn into_list(self) -> <Q as IntoList>::List

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.