pub struct ParamSet {
pub entries: Vec<(Symbol, Value)>,
}Expand description
An ordered set of name-to-Value parameter bindings for a model run.
The concrete inputs supplied to a FEMM evaluation; lookups are by Symbol
and the whole set can be fingerprinted into a StableId. See the
crate README for the FEM role of
parameter sets.
§Examples
use sim_lib_femm_core::ParamSet;
use sim_kernel::{DefaultFactory, Factory, Symbol};
let radius = Symbol::new("radius");
let value = DefaultFactory.string("0.5".to_owned()).unwrap();
let params = ParamSet::new(vec![(radius.clone(), value)]);
assert!(params.get(&radius).is_some());
assert!(params.symbols().contains(&radius));Fields§
§entries: Vec<(Symbol, Value)>The name/value bindings, in insertion order.
Implementations§
Source§impl ParamSet
impl ParamSet
Sourcepub fn get(&self, name: &Symbol) -> Option<&Value>
pub fn get(&self, name: &Symbol) -> Option<&Value>
Look up the Value bound to name, if present.
Sourcepub fn fingerprint(&self, cx: &mut Cx) -> StableId
pub fn fingerprint(&self, cx: &mut Cx) -> StableId
Compute a content StableId over the displayed bindings.
Renders each value through the kernel’s display path under cx, so the
fingerprint reflects value content rather than object identity.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ParamSet
impl !UnwindSafe for ParamSet
impl Freeze for ParamSet
impl Send for ParamSet
impl Sync for ParamSet
impl Unpin for ParamSet
impl UnsafeUnpin for ParamSet
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