pub struct FunctionRegistry { /* private fields */ }Expand description
Registry of named functions for serialization-safe custom transforms.
Provides the bridge between the non-serializable Transform::Custom(Arc<dyn Fn>)
and the serializable TransformDef::NamedFunction { name, params }.
§Example
use rill_patchbay::function_registry::FunctionRegistry;
let reg = FunctionRegistry::builtin();
let out = reg.apply("tanh", 0.5, &Default::default()).unwrap();
assert!((out - 0.5f64.tanh()).abs() < 1e-10);Implementations§
Source§impl FunctionRegistry
impl FunctionRegistry
Trait Implementations§
Source§impl Clone for FunctionRegistry
impl Clone for FunctionRegistry
Source§fn clone(&self) -> FunctionRegistry
fn clone(&self) -> FunctionRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionRegistry
impl !RefUnwindSafe for FunctionRegistry
impl Send for FunctionRegistry
impl Sync for FunctionRegistry
impl Unpin for FunctionRegistry
impl UnsafeUnpin for FunctionRegistry
impl !UnwindSafe for FunctionRegistry
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