pub enum UpdateMap<TKey, TValue>{
AddRemove {
add: Option<HashMap<TKey, TValue>>,
remove: Option<Vec<TKey>>,
},
Set {
set: HashMap<TKey, TValue>,
},
}Expand description
Update a map from TKey to TValue, adding and removing or setting the values.
Variants§
Implementations§
Source§impl<TKey, TValue> UpdateMap<TKey, TValue>
impl<TKey, TValue> UpdateMap<TKey, TValue>
Sourcepub fn add_remove(add: HashMap<TKey, TValue>, remove: Vec<TKey>) -> Self
pub fn add_remove(add: HashMap<TKey, TValue>, remove: Vec<TKey>) -> Self
Add items given by add and remove any given by remove
§Arguments
add- New values to add, any existing will be overwritten.remove- Old keys to remove.
Sourcepub fn add(add: HashMap<TKey, TValue>) -> Self
pub fn add(add: HashMap<TKey, TValue>) -> Self
Add items given by add, overwriting any that already exist.
§Arguments
add- New values to add, any existing will be overwritten.
Trait Implementations§
Source§impl<'de, TKey, TValue> Deserialize<'de> for UpdateMap<TKey, TValue>
impl<'de, TKey, TValue> Deserialize<'de> for UpdateMap<TKey, TValue>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<TKey: Hash + Eq, TValue> IntoPatchItem<UpdateMap<TKey, TValue>> for HashMap<TKey, TValue>
impl<TKey: Hash + Eq, TValue> IntoPatchItem<UpdateMap<TKey, TValue>> for HashMap<TKey, TValue>
Auto Trait Implementations§
impl<TKey, TValue> Freeze for UpdateMap<TKey, TValue>
impl<TKey, TValue> RefUnwindSafe for UpdateMap<TKey, TValue>where
TKey: RefUnwindSafe,
TValue: RefUnwindSafe,
impl<TKey, TValue> Send for UpdateMap<TKey, TValue>
impl<TKey, TValue> Sync for UpdateMap<TKey, TValue>
impl<TKey, TValue> Unpin for UpdateMap<TKey, TValue>
impl<TKey, TValue> UnwindSafe for UpdateMap<TKey, TValue>where
TKey: UnwindSafe,
TValue: UnwindSafe,
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