[−][src]Struct thruster_core::middleware::MiddlewareChain
The MiddlewareChain is used to wrap a series of middleware functions in such a way that the tail can be accessed and modified later on. This allows Thruster to properly compose pieces of middleware into a single long chain rather than relying on disperate parts.
Fields
runnable: Arc<Runnable<T>>
Methods
impl<T: 'static> MiddlewareChain<T>
[src]
pub fn new() -> Self
[src]
Creates a new, blank (i.e. will panic if run,) MiddlewareChain
pub fn assign(&mut self, chain: Runnable<T>)
[src]
Assign a runnable function to this middleware chain
pub fn run(&self, context: T) -> MiddlewareReturnValue<T>
[src]
Run the middleware chain once
pub fn chain(&mut self, chain: MiddlewareChain<T>)
[src]
Concatenate two middleware chains. This will make this chains tail point
to the next chain. That means that calling next
in the final piece of
this chain will invoke the next chain rather than an "End of chain" panic
pub fn is_assigned(&self) -> bool
[src]
Tells if the chain has been assigned OR whether it is unassigned but has an assigned tail. If is only chained but has no assigned runnable, then this chain acts as a passthrough to the next one.
Trait Implementations
impl<T: 'static> Clone for MiddlewareChain<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: 'static> Default for MiddlewareChain<T>
[src]
Auto Trait Implementations
impl<T> Send for MiddlewareChain<T>
impl<T> Sync for MiddlewareChain<T>
impl<T> Unpin for MiddlewareChain<T>
impl<T> !UnwindSafe for MiddlewareChain<T>
impl<T> !RefUnwindSafe for MiddlewareChain<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,