pub struct ParamSnapshot {
pub entries: Vec<(String, ParamValue)>,
}Expand description
Sorted, deduplicated snapshot of named player parameters.
Fields§
§entries: Vec<(String, ParamValue)>Parameter entries sorted by key with duplicates removed.
Implementations§
Source§impl ParamSnapshot
impl ParamSnapshot
Sourcepub fn new(entries: Vec<(String, ParamValue)>) -> Self
pub fn new(entries: Vec<(String, ParamValue)>) -> Self
Builds a snapshot, sorting entries by key and dropping duplicate keys.
§Examples
use sim_lib_music_core::{ParamSnapshot, ParamValue};
let snapshot = ParamSnapshot::new(vec![
("gain".to_owned(), ParamValue::I64(1)),
("attack".to_owned(), ParamValue::Bool(true)),
]);
assert_eq!(snapshot.entries[0].0, "attack");
assert_eq!(snapshot.entries[1].0, "gain");Trait Implementations§
Source§impl Clone for ParamSnapshot
impl Clone for ParamSnapshot
Source§fn clone(&self) -> ParamSnapshot
fn clone(&self) -> ParamSnapshot
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 moreSource§impl Debug for ParamSnapshot
impl Debug for ParamSnapshot
Source§impl Default for ParamSnapshot
impl Default for ParamSnapshot
Source§fn default() -> ParamSnapshot
fn default() -> ParamSnapshot
Returns the “default value” for a type. Read more
impl Eq for ParamSnapshot
Source§impl PartialEq for ParamSnapshot
impl PartialEq for ParamSnapshot
impl StructuralPartialEq for ParamSnapshot
Auto Trait Implementations§
impl Freeze for ParamSnapshot
impl RefUnwindSafe for ParamSnapshot
impl Send for ParamSnapshot
impl Sync for ParamSnapshot
impl Unpin for ParamSnapshot
impl UnsafeUnpin for ParamSnapshot
impl UnwindSafe for ParamSnapshot
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