Struct rocket_file_cache::CachedFile
[−]
[src]
pub struct CachedFile { /* fields omitted */ }A wrapper around an in-memory file. This struct is created when when a request to the cache is made. The CachedFile knows its path, so it can set the content type when it is serialized to a response.
Methods
impl CachedFile[src]
fn open(path: PathBuf) -> Result<CachedFile>[src]
Reads the file at the path into a CachedFile.
Trait Implementations
impl Debug for CachedFile[src]
impl Clone for CachedFile[src]
fn clone(&self) -> CachedFile[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq for CachedFile[src]
fn eq(&self, __arg_0: &CachedFile) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &CachedFile) -> bool[src]
This method tests for !=.
impl Responder<'static> for CachedFile[src]
Streams the cached file to the client. Sets or overrides the Content-Type in the response according to the file's extension if the extension is recognized.
If you would like to stream a file with a different Content-Type than that implied by its
extension, convert the CachedFile to a File, and respond with that instead.
Based on NamedFile from rocket::response::NamedFile