pub struct Transition { /* private fields */ }Expand description
A legal move of a run, from one state to another, with what moved it. Its fields are private: the constructors are the only way to one, and each checks the move.
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn begin(
from: RunState,
op: Op,
id: OperationId,
) -> Result<Transition, IllegalTransition>
pub fn begin( from: RunState, op: Op, id: OperationId, ) -> Result<Transition, IllegalTransition>
Operation op (journal id id) begins acting on a run in from: the run moves to the
state the op holds it in.
§Errors
The table has no such move: the op doesn’t move a run, or not from from.
Sourcepub fn succeed(begun: Transition) -> Transition
pub fn succeed(begun: Transition) -> Transition
The operation that made begun reached its goal: the run settles where the op leaves it.
Sourcepub fn undone(begun: Transition) -> Transition
pub fn undone(begun: Transition) -> Transition
The operation that made begun was refused before anything acted on the run: it stands
where it stood before.
Sourcepub fn fail(begun: Transition, cause: ErrorCode) -> Transition
pub fn fail(begun: Transition, cause: ErrorCode) -> Transition
The operation that made begun failed with cause (cancelled when cut short).
Sourcepub fn cut_off(
from: RunState,
id: OperationId,
) -> Result<Transition, IllegalTransition>
pub fn cut_off( from: RunState, id: OperationId, ) -> Result<Transition, IllegalTransition>
Operation id found the run in from, a moving state whose operation’s process died: it
failed, cancelled.
§Errors
from isn’t a moving state.
Sourcepub fn observed(
from: RunState,
to: RunState,
) -> Result<Transition, IllegalTransition>
pub fn observed( from: RunState, to: RunState, ) -> Result<Transition, IllegalTransition>
A status read found a settled run in from to be to (a VM stopped outside the runner:
failed; everything gone: absent). A move to failed is not_ready.
§Errors
The move isn’t one an observation makes (from is moving, or the pair isn’t in the table).
Sourcepub fn adopted(from: RunState) -> Result<Transition, IllegalTransition>
pub fn adopted(from: RunState) -> Result<Transition, IllegalTransition>
A deployment made outside the runner is taken over as a run that is up, from a run an
earlier down left absent.
§Errors
from isn’t absent: something of the run is there already.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
impl Copy for Transition
Source§impl Debug for Transition
impl Debug for Transition
impl Eq for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Forget for Transition
impl Freeze for Transition
impl Move for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
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
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.