pub struct HttpStreamingCache<T: StreamingCacheManager> {
pub mode: CacheMode,
pub manager: T,
pub options: HttpCacheOptions,
}Expand description
Streaming version of HTTP cache that supports streaming request/response bodies without buffering them in memory.
Fields§
§mode: CacheModeDetermines the manager behavior.
manager: TManager instance that implements the StreamingCacheManager trait.
options: HttpCacheOptionsOverride the default cache options.
Trait Implementations§
Source§impl<T: Clone + StreamingCacheManager> Clone for HttpStreamingCache<T>
impl<T: Clone + StreamingCacheManager> Clone for HttpStreamingCache<T>
Source§fn clone(&self) -> HttpStreamingCache<T>
fn clone(&self) -> HttpStreamingCache<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + StreamingCacheManager> Debug for HttpStreamingCache<T>
impl<T: Debug + StreamingCacheManager> Debug for HttpStreamingCache<T>
Source§impl<T: StreamingCacheManager> HttpCacheStreamInterface for HttpStreamingCache<T>
impl<T: StreamingCacheManager> HttpCacheStreamInterface for HttpStreamingCache<T>
Source§type Body = <T as StreamingCacheManager>::Body
type Body = <T as StreamingCacheManager>::Body
The body type used by this cache implementation
Source§fn analyze_request(
&self,
parts: &Parts,
mode_override: Option<CacheMode>,
) -> Result<CacheAnalysis>
fn analyze_request( &self, parts: &Parts, mode_override: Option<CacheMode>, ) -> Result<CacheAnalysis>
Analyze a request to determine cache behavior
Source§async fn lookup_cached_response(
&self,
key: &str,
) -> Result<Option<(Response<Self::Body>, CachePolicy)>>
async fn lookup_cached_response( &self, key: &str, ) -> Result<Option<(Response<Self::Body>, CachePolicy)>>
Look up a cached response for the given cache key, returning a streaming body
Source§async fn process_response<B>(
&self,
analysis: CacheAnalysis,
response: Response<B>,
) -> Result<Response<Self::Body>>
async fn process_response<B>( &self, analysis: CacheAnalysis, response: Response<B>, ) -> Result<Response<Self::Body>>
Process a fresh response from upstream and potentially cache it with streaming support
Source§fn prepare_conditional_request(
&self,
parts: &mut Parts,
_cached_response: &Response<Self::Body>,
policy: &CachePolicy,
) -> Result<()>
fn prepare_conditional_request( &self, parts: &mut Parts, _cached_response: &Response<Self::Body>, policy: &CachePolicy, ) -> Result<()>
Update request headers for conditional requests (e.g., If-None-Match)
Auto Trait Implementations§
impl<T> Freeze for HttpStreamingCache<T>where
T: Freeze,
impl<T> !RefUnwindSafe for HttpStreamingCache<T>
impl<T> Send for HttpStreamingCache<T>
impl<T> Sync for HttpStreamingCache<T>
impl<T> Unpin for HttpStreamingCache<T>where
T: Unpin,
impl<T> !UnwindSafe for HttpStreamingCache<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more