Skip to main content

MruEntry

Trait MruEntry 

Source
pub trait MruEntry:
    Keyed
    + Clone
    + Serialize
    + DeserializeOwned
    + Send
    + 'static {
    // Provided methods
    fn is_pinned(&self) -> bool { ... }
    fn set_pinned(&mut self, _pinned: bool) { ... }
    fn touch(&mut self) { ... }
}
Expand description

An item that can live in an MruList. Requires Keyed for its stable merge identity; adds the pin / touch vocabulary an MRU list specifically needs on top.

Provided Methods§

Source

fn is_pinned(&self) -> bool

Whether this entry should resist eviction by cap_to_max. Default: never pinned.

Source

fn set_pinned(&mut self, _pinned: bool)

Set the pinned flag. Default: ignore.

Source

fn touch(&mut self)

Hook called by MruList::add and MruList::touch to mark this entry as freshly used. Apps that track a last_opened timestamp update it here. Default: no-op.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§