pub struct NodeRegistry { /* private fields */ }Expand description
Catalog of registered ops, keyed by op name.
Implementations§
Source§impl NodeRegistry
impl NodeRegistry
pub fn new() -> Self
Sourcepub fn from_inventory() -> Self
pub fn from_inventory() -> Self
Build a registry from every StaticOp submitted via
inventory::submit! across the linked binary.
Sourcepub fn register(&mut self, factory: impl NodeFactory + 'static)
pub fn register(&mut self, factory: impl NodeFactory + 'static)
Register a factory by leaking it into 'static. Convenient for
dynamic registration; built-in ops should prefer
inventory::submit! + Self::from_inventory.
Sourcepub fn register_static(&mut self, factory: &'static dyn NodeFactory)
pub fn register_static(&mut self, factory: &'static dyn NodeFactory)
Register a 'static factory reference (the form produced by
inventory::submit!).
pub fn get(&self, op_name: &str) -> Option<&dyn NodeFactory>
Sourcepub fn op_names(&self) -> Vec<&'static str>
pub fn op_names(&self) -> Vec<&'static str>
All registered op names, sorted for deterministic output.
Sourcepub fn document_schema(&self) -> Value
pub fn document_schema(&self) -> Value
Build a JSON Schema for a complete style document by gathering
each registered op’s NodeFactory::schema under a oneOf. The
returned value is suitable for serving at
/schemas/ezu-style.json and feeding to editor tooling
(Monaco, vscode-json-languageservice, ajv, …).
Trait Implementations§
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