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]

[src]

Reads the file at the path into a CachedFile.

Trait Implementations

impl Debug for CachedFile
[src]

[src]

Formats the value using the given formatter.

impl Clone for CachedFile
[src]

[src]

Returns a copy of the value. Read more

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

[src]

Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more