pub struct Registry(/* private fields */);Implementations§
Source§impl Registry
impl Registry
pub fn new() -> Self
Sourcepub fn register<S: Stage + 'static>(&mut self, stage: S) -> usize
pub fn register<S: Stage + 'static>(&mut self, stage: S) -> usize
Add a node to the registry. This returns a unique identifier for that node, which can be used to add it to a crate::Graph
Sourcepub fn validate_node_type<S: Stage + 'static>(&self, id: usize) -> Result<()>
pub fn validate_node_type<S: Stage + 'static>(&self, id: usize) -> Result<()>
Returns an error if the registry doesn’t contain a node with a stage of the specified type with the given id.
Sourcepub fn unregister<S: Stage + 'static>(
&mut self,
id: usize,
) -> Result<Option<Node<S>>>
pub fn unregister<S: Stage + 'static>( &mut self, id: usize, ) -> Result<Option<Node<S>>>
Remove a node from the registry and return it. This will return an error if S doesn’t match the stage type for that node.
Sourcepub fn unregister_and_drop(&mut self, id: usize) -> Result<()>
pub fn unregister_and_drop(&mut self, id: usize) -> Result<()>
Remove a node from the registry and drop it.
Auto Trait Implementations§
impl Freeze for Registry
impl !RefUnwindSafe for Registry
impl !Send for Registry
impl !Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
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