pub struct Manager { /* private fields */ }
Implementations§
Source§impl Manager
impl Manager
pub fn new() -> Self
Sourcepub fn get_node(&mut self, id: u32) -> Result<&mut Node, NodeError>
pub fn get_node(&mut self, id: u32) -> Result<&mut Node, NodeError>
Find the node with the given ID in the graph.
§Errors
If the node is not present, returns NodeError::UnknownID
.
Sourcepub fn add_node(
&mut self,
parent_id: u32,
b: Box<dyn Processor>,
) -> Result<u32, NodeError>
pub fn add_node( &mut self, parent_id: u32, b: Box<dyn Processor>, ) -> Result<u32, NodeError>
Find a child node for the node with the given ID. Returns the new node ID.
§Errors
If the parent node is not present, returns NodeError::UnknownID
.
If there are too many nodes, returns NodeError::TooManyChildren
or NodeError::TooManyNodes
.
Auto Trait Implementations§
impl Freeze for Manager
impl !RefUnwindSafe for Manager
impl !Send for Manager
impl !Sync for Manager
impl Unpin for Manager
impl !UnwindSafe for Manager
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