pub struct PriorityManager { /* private fields */ }Expand description
Manages priority assignments for all nodes in a graph.
Implementations§
Source§impl PriorityManager
impl PriorityManager
Sourcepub fn set_default_class(&mut self, class: PriorityClass)
pub fn set_default_class(&mut self, class: PriorityClass)
Set the default priority class for newly registered nodes.
Sourcepub fn default_class(&self) -> PriorityClass
pub fn default_class(&self) -> PriorityClass
Get the default priority class.
Sourcepub fn register(
&mut self,
node_id: PriorityNodeId,
class: PriorityClass,
label: &str,
)
pub fn register( &mut self, node_id: PriorityNodeId, class: PriorityClass, label: &str, )
Register a node with a specific priority class.
Sourcepub fn register_default(&mut self, node_id: PriorityNodeId, label: &str)
pub fn register_default(&mut self, node_id: PriorityNodeId, label: &str)
Register a node with the default priority class.
Sourcepub fn get(&self, node_id: PriorityNodeId) -> Option<&NodePriorityEntry>
pub fn get(&self, node_id: PriorityNodeId) -> Option<&NodePriorityEntry>
Get the priority entry for a node.
Sourcepub fn effective_priority(&self, node_id: PriorityNodeId) -> i32
pub fn effective_priority(&self, node_id: PriorityNodeId) -> i32
Get the effective priority for a node (returns 0 if not registered).
Sourcepub fn apply_boost(&mut self, node_id: PriorityNodeId, boost: i32) -> bool
pub fn apply_boost(&mut self, node_id: PriorityNodeId, boost: i32) -> bool
Apply a boost to a node’s priority.
Sourcepub fn set_class(
&mut self,
node_id: PriorityNodeId,
class: PriorityClass,
) -> bool
pub fn set_class( &mut self, node_id: PriorityNodeId, class: PriorityClass, ) -> bool
Change a node’s priority class.
Sourcepub fn unregister(&mut self, node_id: PriorityNodeId) -> bool
pub fn unregister(&mut self, node_id: PriorityNodeId) -> bool
Unregister a node.
Sourcepub fn sorted_by_priority(&self) -> Vec<PriorityNodeId>
pub fn sorted_by_priority(&self) -> Vec<PriorityNodeId>
Get all node IDs sorted by effective priority (highest first).
Sourcepub fn nodes_in_class(&self, class: PriorityClass) -> Vec<PriorityNodeId>
pub fn nodes_in_class(&self, class: PriorityClass) -> Vec<PriorityNodeId>
Get all nodes in a specific priority class.
Sourcepub fn promote_class(&mut self, from: PriorityClass, to: PriorityClass) -> usize
pub fn promote_class(&mut self, from: PriorityClass, to: PriorityClass) -> usize
Promote all nodes of one class to a higher class.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PriorityManager
impl RefUnwindSafe for PriorityManager
impl Send for PriorityManager
impl Sync for PriorityManager
impl Unpin for PriorityManager
impl UnsafeUnpin for PriorityManager
impl UnwindSafe for PriorityManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more