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§
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>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".