Type Definition rocket_file_cache::priority_function::PriorityFunction [] [src]

type PriorityFunction = fn(_: usize, _: usize) -> usize;

Custom type of function that is used to determine how to add files to the cache. The first term will be assigned the access count of the file in question, while the second term will be assigned the size (in bytes) of the file in question. The result will represent the priority of the file to remain in or be added to the cache. The files with the largest priorities will be kept in the cache.

A closure that matches this type signature can be specified at cache instantiation to define how it will keep items in the cache.