Skip to main content

FMapKeyLocalUpdate

Struct FMapKeyLocalUpdate 

Source
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: U

Trait Implementations§

Source§

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

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>)

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>>, )

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>
where U: Objective, K: Objective,

§

impl<K, U> RefUnwindSafe for FMapKeyLocalUpdate<K, U>

§

impl<K, U> Send for FMapKeyLocalUpdate<K, U>
where U: Send, K: Send,

§

impl<K, U> Sync for FMapKeyLocalUpdate<K, U>
where U: Sync, K: Sync,

§

impl<K, U> Unpin for FMapKeyLocalUpdate<K, U>
where U: Unpin, K: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.