pub struct SaveData {
pub fields: HashMap<String, SaveValue>,
pub version: SchemaVersion,
}Expand description
Flexible key→value store that migrations read and modify.
Fields§
§fields: HashMap<String, SaveValue>§version: SchemaVersionImplementations§
Source§impl SaveData
impl SaveData
pub fn new(version: SchemaVersion) -> Self
pub fn get(&self, key: &str) -> Option<&SaveValue>
pub fn get_mut(&mut self, key: &str) -> Option<&mut SaveValue>
pub fn set(&mut self, key: impl Into<String>, value: SaveValue)
pub fn remove(&mut self, key: &str) -> Option<SaveValue>
pub fn contains(&self, key: &str) -> bool
Sourcepub fn sum_numeric(&self) -> f64
pub fn sum_numeric(&self) -> f64
Sum all integer and float values for checksum computation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SaveData
impl RefUnwindSafe for SaveData
impl Send for SaveData
impl Sync for SaveData
impl Unpin for SaveData
impl UnsafeUnpin for SaveData
impl UnwindSafe for SaveData
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