Struct rocket_raw_response::RawResponse
source · pub struct RawResponse<'a> {
pub data: Box<dyn Read + 'a>,
pub file_name: String,
pub content_type: Option<Mime>,
pub content_length: Option<u64>,
}
Expand description
The response struct used for responding raw data.
Fields§
§data: Box<dyn Read + 'a>
§file_name: String
§content_type: Option<Mime>
§content_length: Option<u64>
Implementations§
source§impl<'a> RawResponse<'a>
impl<'a> RawResponse<'a>
sourcepub fn from_file<P: AsRef<Path>, S: Into<String>>(
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<RawResponse<'static>>
pub fn from_file<P: AsRef<Path>, S: Into<String>>(
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<RawResponse<'static>>
Create a RawResponse
instance from a path of a file.
sourcepub fn from_vec<S: Into<String>>(
vec: Vec<u8>,
file_name: S,
content_type: Option<Mime>
) -> RawResponse<'static>
pub fn from_vec<S: Into<String>>(
vec: Vec<u8>,
file_name: S,
content_type: Option<Mime>
) -> RawResponse<'static>
Create a RawResponse
instance from a Vec
sourcepub fn from_reader<R: Read + 'a, S: Into<String>>(
reader: R,
file_name: S,
content_type: Option<Mime>,
content_length: Option<u64>
) -> RawResponse<'a>
pub fn from_reader<R: Read + 'a, S: Into<String>>(
reader: R,
file_name: S,
content_type: Option<Mime>,
content_length: Option<u64>
) -> RawResponse<'a>
Create a RawResponse
instance from a reader.
Trait Implementations§
source§impl<'a> Debug for RawResponse<'a>
impl<'a> Debug for RawResponse<'a>
source§impl<'a> Responder<'a> for RawResponse<'a>
impl<'a> Responder<'a> for RawResponse<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RawResponse<'a>
impl<'a> !Send for RawResponse<'a>
impl<'a> !Sync for RawResponse<'a>
impl<'a> Unpin for RawResponse<'a>
impl<'a> !UnwindSafe for RawResponse<'a>
Blanket Implementations§
§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.