pub trait SidecarCache:
Serialize
+ DeserializeOwned
+ Sized {
const EXTENSION: &str;
// Provided methods
fn cache_path_for<P: AsRef<Path>>(fasta_path: P) -> PathBuf { ... }
fn write<P: AsRef<Path>>(&self, fasta_path: P) -> StoreResult<PathBuf> { ... }
fn load_if_fresh<P: AsRef<Path>>(fasta_path: P) -> Option<Self> { ... }
}Expand description
Trait for FASTA sidecar cache files (e.g. .refget.json, .seqcol.json).
Provides default implementations for cache_path_for, write, and load_if_fresh
based on the cache file extension.
Required Associated Constants§
Provided Methods§
Sourcefn cache_path_for<P: AsRef<Path>>(fasta_path: P) -> PathBuf
fn cache_path_for<P: AsRef<Path>>(fasta_path: P) -> PathBuf
Return the standard cache path for a given FASTA file.
Sourcefn write<P: AsRef<Path>>(&self, fasta_path: P) -> StoreResult<PathBuf>
fn write<P: AsRef<Path>>(&self, fasta_path: P) -> StoreResult<PathBuf>
Write the cache to its standard sidecar path.
Sourcefn load_if_fresh<P: AsRef<Path>>(fasta_path: P) -> Option<Self>
fn load_if_fresh<P: AsRef<Path>>(fasta_path: P) -> Option<Self>
Try to load a cache file for the given FASTA, returning None if
the cache is missing or stale (older than the FASTA or its index).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.