Skip to main content

Step

Enum Step 

Source
pub enum Step<C> {
    Command {
        node: NodeId,
        cmd: C,
    },
    Crash(NodeId),
    Restart(NodeId),
    Suspend(NodeId),
    Resume(NodeId),
    CrashOnNextWrite(NodeId),
    Sever(NodeId, NodeId),
    Reconnect(NodeId, NodeId),
    Partition(Vec<Vec<NodeId>>),
    Heal,
    BreakSession(NodeId, NodeId),
}
Expand description

One thing done to a run from outside it.

The vocabulary is exactly the simulator’s own mutators, so that anything a hand-written test can do to a run is something a description can say. The two opt-ins that are not faults — the codec check and session-event delivery — belong to how the run is built rather than to what happens during it, and so live in the constructor a scenario is run with.

Variants§

§

Command

Hand a command to a process.

Fields

§node: NodeId
§cmd: C
§

Crash(NodeId)

Crash a process: it loses everything volatile.

§

Restart(NodeId)

Restart a crashed process, which takes its startup branch.

§

Suspend(NodeId)

Suspend a process: it stops, keeping its state and everything addressed to it.

§

Resume(NodeId)

Resume a suspended process.

§

CrashOnNextWrite(NodeId)

Arm a process’s next durable write to be the one it dies inside.

§

Sever(NodeId, NodeId)

Cut one pair off from each other, leaving every other pair alone.

§

Reconnect(NodeId, NodeId)

Restore one pair, leaving every other severing in place.

§

Partition(Vec<Vec<NodeId>>)

Split the network into groups, replacing whatever was severed before.

§

Heal

Restore full connectivity, discarding every severing however it was made.

§

BreakSession(NodeId, NodeId)

End the session between a pair, losing an unknown suffix of what was in flight.

Implementations§

Source§

impl<C> Step<C>

Source

pub fn nodes(&self) -> Vec<NodeId>

Every process this step names, in the order it names them.

Source

pub fn mentions(&self, node: NodeId) -> bool

Whether this step mentions node.

Trait Implementations§

Source§

impl<C: Clone> Clone for Step<C>

Source§

fn clone(&self) -> Step<C>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug> Debug for Step<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: Eq> Eq for Step<C>

Source§

impl<C: PartialEq> PartialEq for Step<C>

Source§

fn eq(&self, other: &Step<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<C: PartialEq> StructuralPartialEq for Step<C>

Auto Trait Implementations§

§

impl<C> Freeze for Step<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for Step<C>
where C: RefUnwindSafe,

§

impl<C> Send for Step<C>
where C: Send,

§

impl<C> Sync for Step<C>
where C: Sync,

§

impl<C> Unpin for Step<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for Step<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for Step<C>
where 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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more