pub struct FMapKeyLocalUpdate<K, U>(pub Snapshot<K>, pub U);Expand description
Modifies a key-value mapping in an authority/fragment pair of FMaps.
It requires that the key is in the fragment.
Tuple Fields§
§0: Snapshot<K>§1: UTrait Implementations§
Source§impl<K, V: RA, U: LocalUpdate<V>> LocalUpdate<FMap<K, V>> for FMapKeyLocalUpdate<K, U>
impl<K, V: RA, U: LocalUpdate<V>> LocalUpdate<FMap<K, V>> for FMapKeyLocalUpdate<K, U>
Source§fn premise(self, from_auth: FMap<K, V>, from_frag: FMap<K, V>) -> bool
fn premise(self, from_auth: FMap<K, V>, from_frag: FMap<K, V>) -> bool
logic(open, inline)
match (from_auth.get(*self.0), from_frag.get(*self.0)) { (Some(auth_v), Some(frag_v)) => self.1.premise(auth_v, frag_v), (_, None) => false, _ => true, }
Source§fn update(
self,
from_auth: FMap<K, V>,
from_frag: FMap<K, V>,
) -> (FMap<K, V>, FMap<K, V>)
fn update( self, from_auth: FMap<K, V>, from_frag: FMap<K, V>, ) -> (FMap<K, V>, FMap<K, V>)
logic(open, inline)
let (auth, frag) = self.1.update(from_auth[*self.0], from_frag[*self.0]); (from_auth.insert(*self.0, auth), from_frag.insert(*self.0, frag))
Source§fn frame_preserving(
self,
from_auth: FMap<K, V>,
from_frag: FMap<K, V>,
frame: Option<FMap<K, V>>,
)
fn frame_preserving( self, from_auth: FMap<K, V>, from_frag: FMap<K, V>, frame: Option<FMap<K, V>>, )
logic ⚠
requires
self.premise(from_auth, from_frag)requires
Some(from_frag).op(frame) == Some(Some(from_auth))ensures
let (to_auth, to_frag) = self.update(from_auth, from_frag); Some(to_frag).op(frame) == Some(Some(to_auth))
Auto Trait Implementations§
impl<K, U> Freeze for FMapKeyLocalUpdate<K, U>where
U: Freeze,
impl<K, U> Objective for FMapKeyLocalUpdate<K, U>
impl<K, U> RefUnwindSafe for FMapKeyLocalUpdate<K, U>where
U: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, U> Send for FMapKeyLocalUpdate<K, U>
impl<K, U> Sync for FMapKeyLocalUpdate<K, U>
impl<K, U> Unpin for FMapKeyLocalUpdate<K, U>
impl<K, U> UnsafeUnpin for FMapKeyLocalUpdate<K, U>where
U: UnsafeUnpin,
impl<K, U> UnwindSafe for FMapKeyLocalUpdate<K, U>where
U: UnwindSafe,
K: 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