pub struct HmrState { /* private fields */ }Expand description
A serializable bag of preserved state entries.
Each entry is a (key, value) string pair. The
caller is responsible for serializing non-string
values (numbers, booleans, etc.) to strings before
insertion.
§Wire format
{"entries": {"k1": "v1", "k2": "v2"}}Implementations§
Source§impl HmrState
impl HmrState
Sourcepub fn from_entries<I>(entries: I) -> Self
pub fn from_entries<I>(entries: I) -> Self
Creates an HmrState from an iterator of
(key, value) pairs. Later pairs overwrite
earlier ones for the same key.
Sourcepub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
Sets a key-value pair. Overwrites any existing value for the key.
Trait Implementations§
impl Eq for HmrState
impl StructuralPartialEq for HmrState
Auto Trait Implementations§
impl Freeze for HmrState
impl RefUnwindSafe for HmrState
impl Send for HmrState
impl Sync for HmrState
impl Unpin for HmrState
impl UnsafeUnpin for HmrState
impl UnwindSafe for HmrState
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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