pub struct MiddlewareChain { /* private fields */ }Expand description
A chain of middleware that processes HTTP requests sequentially.
Implementations§
Source§impl MiddlewareChain
impl MiddlewareChain
Sourcepub fn new(http: Arc<dyn HttpClient>) -> Self
pub fn new(http: Arc<dyn HttpClient>) -> Self
Creates a new MiddlewareChain with the underlying HTTP client.
Sourcepub fn with_middleware(self, middleware: impl Middleware + 'static) -> Self
pub fn with_middleware(self, middleware: impl Middleware + 'static) -> Self
Adds a middleware to the chain.
Sourcepub async fn send(&self, request: HttpRequest) -> Result<HttpResponse>
pub async fn send(&self, request: HttpRequest) -> Result<HttpResponse>
Sends the request through the middleware chain.
Auto Trait Implementations§
impl Freeze for MiddlewareChain
impl !RefUnwindSafe for MiddlewareChain
impl Send for MiddlewareChain
impl Sync for MiddlewareChain
impl Unpin for MiddlewareChain
impl UnsafeUnpin for MiddlewareChain
impl !UnwindSafe for MiddlewareChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more