pub struct NodeRegistry { /* private fields */ }Expand description
Global node registry — populated at startup via register!.
Implementations§
Source§impl NodeRegistry
impl NodeRegistry
pub fn new() -> Self
Sourcepub fn create(&self, type_name: &str) -> Option<Box<dyn DspNode>>
pub fn create(&self, type_name: &str) -> Option<Box<dyn DspNode>>
Instantiate a node by type name. Returns None if not registered.
Examples found in repository?
examples/registry_demo.rs (line 33)
8fn main() {
9 let registry = builtin_registry();
10
11 println!("=== AetherSDK Node Registry ===\n");
12 println!("Registered nodes: {}\n", registry.len());
13
14 for name in registry.list() {
15 let defs = registry.param_defs(name).unwrap_or(&[]);
16 println!(" {name}");
17 for d in defs {
18 println!(" • {:<16} [{:>7.1} – {:>7.1}] default: {:.3}",
19 d.name, d.min, d.max, d.default);
20 }
21 }
22
23 println!("\n=== JSON Schema (first 20 lines) ===\n");
24 let schema = schema_to_json(®istry);
25 for line in schema.lines().take(20) {
26 println!("{line}");
27 }
28 println!("...");
29
30 // Demonstrate instantiation
31 println!("\n=== Instantiation Test ===\n");
32 for name in registry.list() {
33 let node = registry.create(name);
34 println!(" {} → {}", name, if node.is_some() { "✓" } else { "✗" });
35 }
36}Sourcepub fn list(&self) -> Vec<&'static str>
pub fn list(&self) -> Vec<&'static str>
List all registered node type names.
Examples found in repository?
examples/registry_demo.rs (line 14)
8fn main() {
9 let registry = builtin_registry();
10
11 println!("=== AetherSDK Node Registry ===\n");
12 println!("Registered nodes: {}\n", registry.len());
13
14 for name in registry.list() {
15 let defs = registry.param_defs(name).unwrap_or(&[]);
16 println!(" {name}");
17 for d in defs {
18 println!(" • {:<16} [{:>7.1} – {:>7.1}] default: {:.3}",
19 d.name, d.min, d.max, d.default);
20 }
21 }
22
23 println!("\n=== JSON Schema (first 20 lines) ===\n");
24 let schema = schema_to_json(®istry);
25 for line in schema.lines().take(20) {
26 println!("{line}");
27 }
28 println!("...");
29
30 // Demonstrate instantiation
31 println!("\n=== Instantiation Test ===\n");
32 for name in registry.list() {
33 let node = registry.create(name);
34 println!(" {} → {}", name, if node.is_some() { "✓" } else { "✗" });
35 }
36}Sourcepub fn param_defs(&self, type_name: &str) -> Option<&[ParamDef]>
pub fn param_defs(&self, type_name: &str) -> Option<&[ParamDef]>
Get param defs for a node type.
Examples found in repository?
examples/registry_demo.rs (line 15)
8fn main() {
9 let registry = builtin_registry();
10
11 println!("=== AetherSDK Node Registry ===\n");
12 println!("Registered nodes: {}\n", registry.len());
13
14 for name in registry.list() {
15 let defs = registry.param_defs(name).unwrap_or(&[]);
16 println!(" {name}");
17 for d in defs {
18 println!(" • {:<16} [{:>7.1} – {:>7.1}] default: {:.3}",
19 d.name, d.min, d.max, d.default);
20 }
21 }
22
23 println!("\n=== JSON Schema (first 20 lines) ===\n");
24 let schema = schema_to_json(®istry);
25 for line in schema.lines().take(20) {
26 println!("{line}");
27 }
28 println!("...");
29
30 // Demonstrate instantiation
31 println!("\n=== Instantiation Test ===\n");
32 for name in registry.list() {
33 let node = registry.create(name);
34 println!(" {} → {}", name, if node.is_some() { "✓" } else { "✗" });
35 }
36}Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Examples found in repository?
examples/registry_demo.rs (line 12)
8fn main() {
9 let registry = builtin_registry();
10
11 println!("=== AetherSDK Node Registry ===\n");
12 println!("Registered nodes: {}\n", registry.len());
13
14 for name in registry.list() {
15 let defs = registry.param_defs(name).unwrap_or(&[]);
16 println!(" {name}");
17 for d in defs {
18 println!(" • {:<16} [{:>7.1} – {:>7.1}] default: {:.3}",
19 d.name, d.min, d.max, d.default);
20 }
21 }
22
23 println!("\n=== JSON Schema (first 20 lines) ===\n");
24 let schema = schema_to_json(®istry);
25 for line in schema.lines().take(20) {
26 println!("{line}");
27 }
28 println!("...");
29
30 // Demonstrate instantiation
31 println!("\n=== Instantiation Test ===\n");
32 for name in registry.list() {
33 let node = registry.create(name);
34 println!(" {} → {}", name, if node.is_some() { "✓" } else { "✗" });
35 }
36}pub fn is_empty(&self) -> bool
Trait Implementations§
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> 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