Skip to main content

Stack

Struct Stack 

Source
pub struct Stack<Inner, Outer> { /* private fields */ }
Expand description

Two middleware composed into one, reifying the closure property as a value: because Stack is itself a Middleware, a composed stack can be named, stored, and passed as one middleware before an executor exists. outer wraps the result of inner, so outer is applied last and therefore observes each execution first.

Implementations§

Source§

impl<Inner, Outer> Stack<Inner, Outer>

Source

pub const fn new(inner: Inner, outer: Outer) -> Self

Compose inner and outer into one middleware. outer wraps inner’s result, so outer observes each execution first.

Trait Implementations§

Source§

impl<Inner: Clone, Outer: Clone> Clone for Stack<Inner, Outer>

Source§

fn clone(&self) -> Stack<Inner, Outer>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Inner: Copy, Outer: Copy> Copy for Stack<Inner, Outer>

Source§

impl<Inner: Debug, Outer: Debug> Debug for Stack<Inner, Outer>

Source§

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

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

impl<Inner: Default, Outer: Default> Default for Stack<Inner, Outer>

Source§

fn default() -> Stack<Inner, Outer>

Returns the “default value” for a type. Read more
Source§

impl<E, Inner, Outer> Middleware<E> for Stack<Inner, Outer>
where E: Executor, Inner: Middleware<E>, Outer: Middleware<Inner::Executor>,

Source§

type Executor = <Outer as Middleware<<Inner as Middleware<E>>::Executor>>::Executor

The wrapped executor type.
Source§

fn wrap(&self, executor: E) -> Self::Executor

Wrap an executor with this middleware.

Auto Trait Implementations§

§

impl<Inner, Outer> Freeze for Stack<Inner, Outer>
where Inner: Freeze, Outer: Freeze,

§

impl<Inner, Outer> RefUnwindSafe for Stack<Inner, Outer>
where Inner: RefUnwindSafe, Outer: RefUnwindSafe,

§

impl<Inner, Outer> Send for Stack<Inner, Outer>
where Inner: Send, Outer: Send,

§

impl<Inner, Outer> Sync for Stack<Inner, Outer>
where Inner: Sync, Outer: Sync,

§

impl<Inner, Outer> Unpin for Stack<Inner, Outer>
where Inner: Unpin, Outer: Unpin,

§

impl<Inner, Outer> UnsafeUnpin for Stack<Inner, Outer>
where Inner: UnsafeUnpin, Outer: UnsafeUnpin,

§

impl<Inner, Outer> UnwindSafe for Stack<Inner, Outer>
where Inner: UnwindSafe, Outer: 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<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.