Type Alias thruster::MiddlewareReturnValue
source · pub type MiddlewareReturnValue<C> = ReusableBoxFuture<MiddlewareResult<C>>;
Aliased Type§
struct MiddlewareReturnValue<C> { /* private fields */ }
Implementations§
source§impl<T> ReusableBoxFuture<T>
impl<T> ReusableBoxFuture<T>
sourcepub fn new<F>(future: F) -> ReusableBoxFuture<T> ⓘwhere
F: Future<Output = T> + Send + 'static,
pub fn new<F>(future: F) -> ReusableBoxFuture<T> ⓘwhere F: Future<Output = T> + Send + 'static,
Create a new ReusableBoxFuture<T>
containing the provided future.
sourcepub fn set<F>(&mut self, future: F)where
F: Future<Output = T> + Send + 'static,
pub fn set<F>(&mut self, future: F)where F: Future<Output = T> + Send + 'static,
Replace the future currently stored in this box.
This reallocates if and only if the layout of the provided future is different from the layout of the currently stored future.
sourcepub fn try_set<F>(&mut self, future: F) -> Result<(), F>where
F: Future<Output = T> + Send + 'static,
pub fn try_set<F>(&mut self, future: F) -> Result<(), F>where F: Future<Output = T> + Send + 'static,
Replace the future currently stored in this box.
This function never reallocates, but returns an error if the provided future has a different size or alignment from the currently stored future.