pub trait PriorityLevel {
// Required method
fn level(&self) -> usize;
}
Expand description
Required trait on OrderedPool
entries that allows ordering.
Priority levels follow the conventions common with schedulers: 0 is the highest priority, and will only get evicted if the cache is full with other entries of the same priority. Larger numeric values indicate increasingly lower priority.
Required Methods§
Sourcefn level(&self) -> usize
fn level(&self) -> usize
Calculate the priority of the instance
An instance’s priority level may change while being mutated; OrderedPool
will account for
that.
The level should not change due to global effects (or internal mutability, if shared access
is later implemented). If it does, the ordering of an OrderedPool
containing it may become
arbitrary, even after the element whose level changed has been removed.