pub struct IdentificationCache { /* private fields */ }Expand description
A freshness-keyed cache of identification results, safe to share across
threads. A cache miss (or any lock failure) falls back to a direct
identify, so the cache is only ever an
optimization. A changed top-level mtime or size (an added/removed/replaced
immediate child, or a rewritten file) invalidates the entry; see the module
docs for the depth-1 limitation.
Implementations§
Source§impl IdentificationCache
impl IdentificationCache
Sourcepub fn identify(&self, record: &ModelRecord) -> IdentifiedModel
pub fn identify(&self, record: &ModelRecord) -> IdentifiedModel
Identify record, returning a cached result when the model’s bytes are
unchanged since the last identification.
Trait Implementations§
Source§impl Default for IdentificationCache
impl Default for IdentificationCache
Source§fn default() -> IdentificationCache
fn default() -> IdentificationCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for IdentificationCache
impl RefUnwindSafe for IdentificationCache
impl Send for IdentificationCache
impl Sync for IdentificationCache
impl Unpin for IdentificationCache
impl UnsafeUnpin for IdentificationCache
impl UnwindSafe for IdentificationCache
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