pub struct CachedResponse<EP: EndpointDetails> {
content_type: Option<ContentType>,
body: Option<Bytes>,
ep: PhantomData<EP>,
}Expand description
Cached response
Fields§
§content_type: Option<ContentType>§body: Option<Bytes>§ep: PhantomData<EP>Implementations§
Source§impl<EP: EndpointDetails> CachedResponse<EP>
impl<EP: EndpointDetails> CachedResponse<EP>
Sourcepub fn response_builder(&self) -> HttpResponseBuilder
pub fn response_builder(&self) -> HttpResponseBuilder
Returns a response builder appropriate for this response
Trait Implementations§
Source§impl<EP: EndpointDetails> Clone for CachedResponse<EP>
impl<EP: EndpointDetails> Clone for CachedResponse<EP>
Source§impl<EP: Debug + EndpointDetails> Debug for CachedResponse<EP>
impl<EP: Debug + EndpointDetails> Debug for CachedResponse<EP>
Source§impl<EP: EndpointDetails> Responder for CachedResponse<EP>
impl<EP: EndpointDetails> Responder for CachedResponse<EP>
type Body = BoxBody
Source§fn respond_to(self, _req: &HttpRequest) -> HttpResponse<Self::Body>
fn respond_to(self, _req: &HttpRequest) -> HttpResponse<Self::Body>
Convert self to
HttpResponse.Auto Trait Implementations§
impl<EP> !Freeze for CachedResponse<EP>
impl<EP> RefUnwindSafe for CachedResponse<EP>where
EP: RefUnwindSafe,
impl<EP> Send for CachedResponse<EP>where
EP: Send,
impl<EP> Sync for CachedResponse<EP>where
EP: Sync,
impl<EP> Unpin for CachedResponse<EP>where
EP: Unpin,
impl<EP> UnsafeUnpin for CachedResponse<EP>
impl<EP> UnwindSafe for CachedResponse<EP>where
EP: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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