Struct synfx_dsp_jit::DSPNodeTypeLibrary
source · [−]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
sourceimpl 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 Send for DSPNodeTypeLibrary
impl Sync for DSPNodeTypeLibrary
impl Unpin for DSPNodeTypeLibrary
impl !UnwindSafe for DSPNodeTypeLibrary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more