Skip to main content

ParamSource

Trait ParamSource 

Source
pub trait ParamSource {
    // Required method
    fn get(&mut self, name: &str) -> Option<Param>;
}
Expand description

Supplies a stage’s parameters on demand, by name. None means “not mine” (the runtime leaves the param unset — useful when a source only owns a shard).

Required Methods§

Source

fn get(&mut self, name: &str) -> Option<Param>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ParamSource for HashMap<String, Param>

A HashMap<String, Param> is a source (mixed f32 / packed).

Source§

fn get(&mut self, name: &str) -> Option<Param>

Source§

impl ParamSource for HashMap<String, Vec<f32>>

A HashMap<String, Vec<f32>> is a source (dense f32; clones on read).

Source§

fn get(&mut self, name: &str) -> Option<Param>

Implementors§

Source§

impl<F> ParamSource for F
where F: FnMut(&str) -> Option<Param>,

Any FnMut(&str) -> Option<Param> is a source — adapt an existing loader inline without defining a type.