pub struct CacheBuster { /* private fields */ }Implementations§
Source§impl CacheBuster
impl CacheBuster
pub fn new(asset_directory: &str) -> Self
pub fn gen_cache(&mut self)
Sourcepub fn get_file(&self, original_asset_file_path: &str) -> String
pub fn get_file(&self, original_asset_file_path: &str) -> String
Takes a path from root domain to a static asset (as it would be called from a browser, so with a leading slash) and returns the version of the filepath that contains a unique hash.
e.g. “/static/image/favicon/favicon.ico” -> “/static/image/favicon/favicon.66189abc248d80832e458ee37e93c9e8.ico”
§Panics
Panics if the file is not found in the cache.
pub fn get_cache(&self) -> BTreeMap<String, String>
Sourcepub fn print_to_file(&self, output_dir: &str)
pub fn print_to_file(&self, output_dir: &str)
§Panics
Panics if the file cannot be created or written to.
Trait Implementations§
Source§impl Clone for CacheBuster
impl Clone for CacheBuster
Source§fn clone(&self) -> CacheBuster
fn clone(&self) -> CacheBuster
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheBuster
impl Debug for CacheBuster
Auto Trait Implementations§
impl Freeze for CacheBuster
impl RefUnwindSafe for CacheBuster
impl Send for CacheBuster
impl Sync for CacheBuster
impl Unpin for CacheBuster
impl UnwindSafe for CacheBuster
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more