Enum rocket_file_cache::CachedFile [] [src]

pub enum CachedFile<'a> {
    InMemory(NamedInMemoryFile<'a>),
    FileSystem(NamedFile),
    NotFound,
}

Wrapper around types that represent files and implement Responder<'static>.

When getting a CachedFile from the cache: An InMemory variant indicates that the file is now in the cache after the get. A FileSystem variant indicates that the file is not in the cache, but it can be found in the filesystem. A NotFound variant indicates that the file can not be found in the filesystem or the cache.

Variants

A file that has been loaded into the cache.

A file that exists in the filesystem.

The file does not exist in either the cache or the filesystem.

Methods

impl<'a> CachedFile<'a>
[src]

[src]

A convenience function that wraps the getting of a cached file.

This is done to keep the code required to use the cache as similar to the typical use of Rocket::response::NamedFile.

Trait Implementations

impl<'a> Debug for CachedFile<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> From<NamedInMemoryFile<'a>> for CachedFile<'a>
[src]

[src]

Performs the conversion.

impl From<NamedFile> for CachedFile<'static>
[src]

[src]

Performs the conversion.

impl<'a> Responder<'a> for CachedFile<'a>
[src]

[src]

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

impl<'a, 'b> PartialEq for CachedFile<'a>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.