pub struct NodeRegistry { /* private fields */ }Expand description
A catalogue of GraphNode entries keyed by their numeric ID.
Implementations§
Source§impl NodeRegistry
impl NodeRegistry
Sourcepub fn add(&mut self, name: impl Into<String>, kind: NodeKind) -> u64
pub fn add(&mut self, name: impl Into<String>, kind: NodeKind) -> u64
Adds a new node with the given name and kind, assigning a fresh ID. Returns the assigned ID.
Sourcepub fn find_by_kind(&self, kind: &NodeKind) -> Vec<&GraphNode>
pub fn find_by_kind(&self, kind: &NodeKind) -> Vec<&GraphNode>
Returns all nodes whose kind matches kind.
Sourcepub fn enabled_count(&self) -> usize
pub fn enabled_count(&self) -> usize
Returns the number of currently enabled nodes.
Trait Implementations§
Source§impl Clone for NodeRegistry
impl Clone for NodeRegistry
Source§fn clone(&self) -> NodeRegistry
fn clone(&self) -> NodeRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeRegistry
impl Debug for NodeRegistry
Source§impl Default for NodeRegistry
impl Default for NodeRegistry
Source§fn default() -> NodeRegistry
fn default() -> NodeRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NodeRegistry
impl RefUnwindSafe for NodeRegistry
impl Send for NodeRegistry
impl Sync for NodeRegistry
impl Unpin for NodeRegistry
impl UnsafeUnpin for NodeRegistry
impl UnwindSafe for NodeRegistry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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