pub struct ReqwestUpstream<'a> { /* private fields */ }Expand description
Upstream wrapper that bridges reqwest-middleware’s Next to hitbox’s Upstream trait.
This adapter allows the hitbox cache FSM to call the remaining middleware chain when it needs to fetch fresh data from upstream.
§Type Parameter
The lifetime 'a comes from Next<'a>, representing the middleware
chain’s lifetime. This is why DisabledOffload is used in the middleware -
we cannot spawn background tasks with non-'static lifetimes.
Implementations§
Source§impl<'a> ReqwestUpstream<'a>
impl<'a> ReqwestUpstream<'a>
Sourcepub fn new(next: Next<'a>, extensions: Extensions) -> Self
pub fn new(next: Next<'a>, extensions: Extensions) -> Self
Creates a new upstream wrapper. Typically called internally by
CacheMiddleware.
Trait Implementations§
Source§impl<'a> Upstream<CacheableHttpRequest<Body>> for ReqwestUpstream<'a>
Implementation of Upstream for reqwest-middleware integration.
impl<'a> Upstream<CacheableHttpRequest<Body>> for ReqwestUpstream<'a>
Implementation of Upstream for reqwest-middleware integration.
This allows the hitbox cache FSM to treat the remaining middleware chain as an upstream service that can be called on cache misses.
Auto Trait Implementations§
impl<'a> Freeze for ReqwestUpstream<'a>
impl<'a> !RefUnwindSafe for ReqwestUpstream<'a>
impl<'a> Send for ReqwestUpstream<'a>
impl<'a> Sync for ReqwestUpstream<'a>
impl<'a> Unpin for ReqwestUpstream<'a>
impl<'a> !UnwindSafe for ReqwestUpstream<'a>
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