pub struct Params {
pub sample_rate: f32,
pub parameters: HashMap<String, ParamValue>,
}Expand description
A flexible set of parameters passed to a node constructor.
Uses HashMap<String, ParamValue> so any node type can extract
whatever named parameters it supports. This is intentionally
open-ended — no fixed schema, no required fields.
See NodeConstructor (in rill-graph) for how builder uses this.
Fields§
§sample_rate: f32Sample rate the node will be initialized with.
parameters: HashMap<String, ParamValue>Arbitrary named parameters.
Implementations§
Source§impl Params
impl Params
Sourcepub fn with(self, key: impl Into<String>, value: ParamValue) -> Params
pub fn with(self, key: impl Into<String>, value: ParamValue) -> Params
Builder-style: insert a parameter and return self.
Sourcepub fn get(&self, key: &str) -> Option<&ParamValue>
pub fn get(&self, key: &str) -> Option<&ParamValue>
Get a parameter by name.
Sourcepub fn insert(
&mut self,
key: impl Into<String>,
value: ParamValue,
) -> Option<ParamValue>
pub fn insert( &mut self, key: impl Into<String>, value: ParamValue, ) -> Option<ParamValue>
Insert or overwrite a parameter.
Sourcepub fn remove(&mut self, key: &str) -> Option<ParamValue>
pub fn remove(&mut self, key: &str) -> Option<ParamValue>
Remove a parameter, returning its value if present.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnsafeUnpin for Params
impl UnwindSafe for Params
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