Skip to main content

PriorityQueueHandle

Trait PriorityQueueHandle 

Source
pub trait PriorityQueueHandle<D: Priority> {
    const LOAD_PURE: Option<unsafe fn(&Self) -> &D> = None;
}
Expand description

The “handle” for an entry in a PriorityQueue.

Allows for skipping a read lock on the owning PriorityQueue if a reference to the data can be retrieved without a reference to the owning queue.

Provided Associated Constants§

Source

const LOAD_PURE: Option<unsafe fn(&Self) -> &D> = None

If the entry can be loaded with only the handle (without needing access to the queue itself), then this can optionally be set to a function which loads it directly.

It is up to the caller to ensure that none of the referenced data used can be changed while a ref is held (e.g. make sure that update_node is not called on the node, or if it is called, none of the data referenced will be mutated)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<N: ArenaQueueNode> PriorityQueueHandle<<N as ArenaQueueNode>::Data> for ArenaQueueHandle<N>

Source§

const LOAD_PURE: Option<unsafe fn(&Self) -> &N::Data> = None

Source§

impl<N: BoxQueueNode> PriorityQueueHandle<<N as BoxQueueNode>::Data> for BoxQueueHandle<N>

Source§

const LOAD_PURE: Option<unsafe fn(&Self) -> &N::Data>