Skip to main content

LoadCommitter

Struct LoadCommitter 

Source
pub struct LoadCommitter<T, C: Container<Value = FMap<Timestamp, (T, SyncView)>>>(/* private fields */);
Expand description

Wrapper around a single atomic load operation, where multiple ghost steps can be performed.

Note: this committer has no observable effect on ghost ressources. Thus, it is optional to shoot it, and nothing prevent the user from shooting it several times.

Implementations§

Source§

impl<T, C: Container<Value = FMap<Timestamp, (T, SyncView)>> + HasTimestamp> LoadCommitter<T, C>

Source

pub fn ward(self) -> C

Identity of the committer

This is used so that we can only use the committer with the right [AtomicOwn].

logic(opaque)

Source

pub fn val(self) -> T

Value held by the [AtomicOwn].

logic(opaque)

Source

pub fn shoot(&self, own: &Perm<C>, view: &mut SyncView) -> Timestamp

‘Shoot’ the committer

This does the read on the atomic in ghost code.

requires

self.ward() == *own.ward()

ensures

(*view).le_log(^view)

ensures

self.ward().get_timestamp(*view) <= result

ensures

result <= self.ward().get_timestamp(^view)

ensures

match own.val().get(result) {
    Some((v, v_view)) => v == self.val() && v_view.le_log(^view),
    None => false
}

terminates

ghost

Auto Trait Implementations§

§

impl<T, C> Freeze for LoadCommitter<T, C>

§

impl<T, C> Objective for LoadCommitter<T, C>
where T: Objective, C: Objective,

§

impl<T, C> RefUnwindSafe for LoadCommitter<T, C>

§

impl<T, C> Send for LoadCommitter<T, C>
where T: Send, C: Send,

§

impl<T, C> Sync for LoadCommitter<T, C>
where T: Sync, C: Sync,

§

impl<T, C> Unpin for LoadCommitter<T, C>
where T: Unpin, C: Unpin,

§

impl<T, C> UnsafeUnpin for LoadCommitter<T, C>

§

impl<T, C> UnwindSafe for LoadCommitter<T, C>
where T: UnwindSafe, C: 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.