Skip to main content

InListListener

Trait InListListener 

Source
pub trait InListListener: Send + Sync {
    // Required methods
    fn note_ins_added(&self, node_id: u64);
    fn note_ins_accessed(&self, node_id: u64);
    fn note_ins_removed(&self, node_id: u64);
}
Expand description

Observer that mirrors JE’s INList feeding the evictor’s LRULists.

The tree owns no eviction policy of its own; instead it notifies a registered listener whenever an IN/BIN node enters the resident cache, is accessed, or is removed. The Evictor (in noxu-evictor) implements this trait, but the dependency is one-way (noxu-evictornoxu-tree), so the tree refers to the listener only through this trait object — avoiding a circular crate dependency.

JE reference: IN.fetchTarget / split / rebuildINList call Evictor.addBack; node access calls Evictor.moveBack; node removal calls Evictor.remove.

Required Methods§

Source

fn note_ins_added(&self, node_id: u64)

A node has just become resident in the cache (JE Evictor.addBack).

Source

fn note_ins_accessed(&self, node_id: u64)

A resident node was accessed (JE Evictor.moveBack — LRU touch).

Source

fn note_ins_removed(&self, node_id: u64)

A node was removed from the cache (JE Evictor.remove).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§