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§

Create a RawResponse instance from a path of a file.

Create a RawResponse instance from a Vec.

Create a RawResponse instance from a reader.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.