Crate rocket_file_cache [−] [src]
Structs
Cache |
The cache holds a number of files whose bytes fit into its size_limit. The cache acts as a proxy to the filesystem, returning cached files if they are in the cache, or reading a file directly from the filesystem if the file is not in the cache. |
CacheBuilder |
A builder for Caches. |
CachedFile |
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. |
Enums
CacheBuildError |
Error types that can be encountered when a cache is built. |
ResponderFile |
Wrapper around types that represent files and implement Responder<'static>. |
Functions
access_priority_function |
This priority function will value files in the cache based solely on the number of times the file was accessed. |
default_priority_function |
The default priority function used for determining if a file should be in the cache. |
normal_priority_function |
Priority is calculated as the size times the access count. |
small_files_access_priority_function |
Favor small files with respect to the number of times file was accessed. |
small_files_priority_function |
Favor small files without respect to the number of times file was accessed. |
Type Definitions
PriorityFunction |
A closure that matches this type signature can be specified at cache instantiation to define how the cache will invalidate or add items to itself. |