pub struct Registry { /* private fields */ }Expand description
Maps node kinds (llm, if-else, …) to factories.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Registry with every built-in core node.
Sourcepub fn register<F>(&mut self, kind: &str, factory: F) -> &mut Self
pub fn register<F>(&mut self, kind: &str, factory: F) -> &mut Self
Register (or replace) a factory for kind.
Sourcepub fn register_described<F>(
&mut self,
descriptor: NodeDescriptor,
factory: F,
) -> &mut Self
pub fn register_described<F>( &mut self, descriptor: NodeDescriptor, factory: F, ) -> &mut Self
Register (or replace) a factory together with its catalog descriptor.
The descriptor’s kind is the registered node type.
Sourcepub fn describe(&mut self, descriptor: NodeDescriptor) -> &mut Self
pub fn describe(&mut self, descriptor: NodeDescriptor) -> &mut Self
Attach or replace the descriptor of an already-registered kind.
Sourcepub fn descriptor(&self, kind: &str) -> Option<NodeDescriptor>
pub fn descriptor(&self, kind: &str) -> Option<NodeDescriptor>
Descriptor of a kind. Kinds registered without one get a bare descriptor.
Sourcepub fn descriptors(&self) -> Vec<NodeDescriptor>
pub fn descriptors(&self) -> Vec<NodeDescriptor>
Catalog of every registered kind, sorted by kind.
Sourcepub fn alias(&mut self, alias: &str, kind: &str) -> &mut Self
pub fn alias(&mut self, alias: &str, kind: &str) -> &mut Self
Register an alias resolving to an already-registered kind.
pub fn contains(&self, kind: &str) -> bool
pub fn kinds(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Forget for Registry
impl Freeze for Registry
impl Move for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin 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