pub struct DSPNodeTypeLibrary { /* private fields */ }Expand description
This structure holds all the DSPNodeType definitions and provides them to the crate::JIT and [crate::jit::DSPFunctionTranslator].
Implementations§
Source§impl DSPNodeTypeLibrary
impl DSPNodeTypeLibrary
Sourcepub fn add(&mut self, typ: Arc<dyn DSPNodeType>)
pub fn add(&mut self, typ: Arc<dyn DSPNodeType>)
Add the given DSPNodeType to this library.
Sourcepub fn get_type_by_name(&self, typ_name: &str) -> Option<Arc<dyn DSPNodeType>>
pub fn get_type_by_name(&self, typ_name: &str) -> Option<Arc<dyn DSPNodeType>>
Retrieves a DSPNodeType by it’s name.
Sourcepub fn for_each<T, F: FnMut(&Arc<dyn DSPNodeType>) -> Result<(), T>>(
&self,
f: F,
) -> Result<(), T>
pub fn for_each<T, F: FnMut(&Arc<dyn DSPNodeType>) -> Result<(), T>>( &self, f: F, ) -> Result<(), T>
Iterate through all types in the Library:
use synfx_dsp_jit::*;
let lib = DSPNodeTypeLibrary::new();
// ...
lib.for_each(|typ| -> Result<(), ()> {
println!("Type available: {}", typ.name());
Ok(())
}).expect("no error");Auto Trait Implementations§
impl !RefUnwindSafe for DSPNodeTypeLibrary
impl !UnwindSafe for DSPNodeTypeLibrary
impl Freeze for DSPNodeTypeLibrary
impl Send for DSPNodeTypeLibrary
impl Sync for DSPNodeTypeLibrary
impl Unpin for DSPNodeTypeLibrary
impl UnsafeUnpin for DSPNodeTypeLibrary
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