pub enum VacateOutcome {
Released {
generation: u64,
released: Assignee,
},
Stale {
current: Option<Assignee>,
},
}Expand description
What RunStore::vacate_assignee did — it releases a seat only while
that seat still holds the generation the caller observed, so “released”
and “someone else got there first” are two answers, not one.
§Why a release has to name a generation
A release is issued by a caller that read the holder earlier and then
decided it should go: A7 reads a holder, asks its adapter for
T-ALIVE, and releases on Disconnected; O8’s cascade reads a
holder, matches it against a deleted operator’s names, and releases.
Both decisions are about the Assignee that was read, and both have
.await points between the read and the write, during which an
acquire (which never excludes — A8) can seat somebody else.
Addressed at (run, slot) alone, such a release would delete whatever
holder happened to be there — a holder whose liveness was never asked
for and whose deletion no premise in the model supports. That is a lost
update, not A8: the acquirer was answered 200 with its generation
(Q4) and has no channel to learn it was undone. Carrying the
observed generation turns the write back into the decision that was
actually made.
gen alone identifies the holder because G is Run-wide and advances
on every assignment event, so a generation is never reused — a seat
holding expected_gen is holding the very instance the caller read,
including when a re-acquire put the same operator back (A8).
Variants§
Released
The seat still held the observed generation, so it was released and
the slot is now Vacant.
Fields
Stale
The seat did not hold the observed generation, so nothing was
written: no holder removed, G not advanced, updated_at
untouched.
The caller’s reading is stale — either an acquire moved the seat
on (A8 already decided that contest, and the newer holder
stands) or the seat was released by someone else in between. Either
way the release is not re-issued against the new state: the
decision behind it was made about a holder that is no longer there.
Trait Implementations§
Source§impl Clone for VacateOutcome
impl Clone for VacateOutcome
Source§fn clone(&self) -> VacateOutcome
fn clone(&self) -> VacateOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VacateOutcome
impl Debug for VacateOutcome
impl Eq for VacateOutcome
Source§impl PartialEq for VacateOutcome
impl PartialEq for VacateOutcome
impl StructuralPartialEq for VacateOutcome
Auto Trait Implementations§
impl Freeze for VacateOutcome
impl RefUnwindSafe for VacateOutcome
impl Send for VacateOutcome
impl Sync for VacateOutcome
impl Unpin for VacateOutcome
impl UnsafeUnpin for VacateOutcome
impl UnwindSafe for VacateOutcome
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more