Skip to main content

Algorithm

Trait Algorithm 

Source
pub trait Algorithm {
    type State: Default;

    // Required methods
    fn on_access(state: &mut Self::State, node_id: NodeId);
    fn on_insert(state: &mut Self::State, node_id: NodeId);
    fn on_remove(state: &mut Self::State, node_id: NodeId);
    fn pick_victim(state: &Self::State) -> Option<NodeId>;
}

Required Associated Types§

Required Methods§

Source

fn on_access(state: &mut Self::State, node_id: NodeId)

Source

fn on_insert(state: &mut Self::State, node_id: NodeId)

Source

fn on_remove(state: &mut Self::State, node_id: NodeId)

Source

fn pick_victim(state: &Self::State) -> Option<NodeId>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§