pub struct EtaggedRawResponse<'a> {
pub data: Box<dyn Read + 'a>,
pub is_etag_match: bool,
pub etag: EntityTag,
pub file_name: String,
pub content_type: Option<Mime>,
pub content_length: Option<u64>,
}
Expand description
The response struct used for responding raw data with Etag cache.
Fields
data: Box<dyn Read + 'a>
is_etag_match: bool
etag: EntityTag
file_name: String
content_type: Option<Mime>
content_length: Option<u64>
Implementations
sourceimpl<'a> EtaggedRawResponse<'a>
impl<'a> EtaggedRawResponse<'a>
sourcepub fn from_file<P: AsRef<Path>, S: Into<String>>(
etag_map: &EtagMap,
etag_if_none_match: EtagIfNoneMatch,
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<EtaggedRawResponse<'static>>
pub fn from_file<P: AsRef<Path>, S: Into<String>>(
etag_map: &EtagMap,
etag_if_none_match: EtagIfNoneMatch,
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<EtaggedRawResponse<'static>>
Create a EtaggedRawResponse
instance from a path of a file.
sourcepub fn from_vec<K: Into<String>, S: Into<String>>(
etag_map: &EtagMap,
etag_if_none_match: EtagIfNoneMatch,
key: K,
vec: Vec<u8>,
file_name: S,
content_type: Option<Mime>
) -> EtaggedRawResponse<'static>
pub fn from_vec<K: Into<String>, S: Into<String>>(
etag_map: &EtagMap,
etag_if_none_match: EtagIfNoneMatch,
key: K,
vec: Vec<u8>,
file_name: S,
content_type: Option<Mime>
) -> EtaggedRawResponse<'static>
Create a EtaggedRawResponse
instance from a Vec
sourcepub fn from_reader<R: Read + 'a, S: Into<String>>(
etag_if_none_match: EtagIfNoneMatch,
etag: EntityTag,
reader: R,
file_name: S,
content_type: Option<Mime>,
content_length: Option<u64>
) -> EtaggedRawResponse<'a>
pub fn from_reader<R: Read + 'a, S: Into<String>>(
etag_if_none_match: EtagIfNoneMatch,
etag: EntityTag,
reader: R,
file_name: S,
content_type: Option<Mime>,
content_length: Option<u64>
) -> EtaggedRawResponse<'a>
Create a EtaggedRawResponse
instance from a reader.
Trait Implementations
sourceimpl<'a> Debug for EtaggedRawResponse<'a>
impl<'a> Debug for EtaggedRawResponse<'a>
sourceimpl<'a> Responder<'a> for EtaggedRawResponse<'a>
impl<'a> Responder<'a> for EtaggedRawResponse<'a>
sourcefn respond_to(self, _: &Request<'_>) -> Result<'a>
fn respond_to(self, _: &Request<'_>) -> Result<'a>
Returns
Ok
if a Response
could be generated successfully. Otherwise,
returns an Err
with a failing Status
. Read moreAuto Trait Implementations
impl<'a> !RefUnwindSafe for EtaggedRawResponse<'a>
impl<'a> !Send for EtaggedRawResponse<'a>
impl<'a> !Sync for EtaggedRawResponse<'a>
impl<'a> Unpin for EtaggedRawResponse<'a>
impl<'a> !UnwindSafe for EtaggedRawResponse<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.