Struct rocket_file_cache::cached_file::CachedFile
[−]
[src]
pub struct CachedFile { /* fields omitted */ }
The structure that is returned 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 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