pub enum Blocked {
Idle,
Sleeping {
next_wakeup: Instant,
},
Deadlock(Vec<SendBlock>),
Breakpoint(Name, Effect),
Busy {
external_effects: usize,
stages: Vec<Name>,
},
Terminated(Name),
}Expand description
Classification of why SimulationRunning::run_until_blocked has stopped.
Variants§
Idle
All stages are suspended on Effect::Receive.
Sleeping
The simulation is waiting for a wakeup with no external effects pending.
Deadlock(Vec<SendBlock>)
All stages are suspended on either Effect::Receive or Effect::Send.
Breakpoint(Name, Effect)
The given breakpoint was hit.
Busy
The given stages are suspended on effects other than Effect::Receive
while none are suspended on Effect::Send. The given number of
external effects are currently unresolved.
Terminated(Name)
The given stage has terminated.
Implementations§
Source§impl Blocked
impl Blocked
Sourcepub fn assert_idle(&self)
pub fn assert_idle(&self)
Assert that the blocking reason is Idle.
Sourcepub fn assert_sleeping(&self) -> Instant
pub fn assert_sleeping(&self) -> Instant
Assert that the blocking reason is Sleeping.
Sourcepub fn assert_sleeping_until(&self, until: Instant)
pub fn assert_sleeping_until(&self, until: Instant)
Assert that the blocking reason is Sleeping until the given instant.
Sourcepub fn assert_deadlock(
&self,
names: impl IntoIterator<Item = impl AsRef<str> + Debug>,
)
pub fn assert_deadlock( &self, names: impl IntoIterator<Item = impl AsRef<str> + Debug>, )
Assert that the blocking reason is Deadlock by at least the given stages.
Sourcepub fn assert_busy(
&self,
names: impl IntoIterator<Item = impl AsRef<str> + Debug>,
) -> &Self
pub fn assert_busy( &self, names: impl IntoIterator<Item = impl AsRef<str> + Debug>, ) -> &Self
Assert that the blocking reason is Busy by at least the given stages.
pub fn assert_external_effects(&self, effects: usize)
Sourcepub fn assert_breakpoint(self, name: impl AsRef<str>) -> Effect
pub fn assert_breakpoint(self, name: impl AsRef<str>) -> Effect
Assert that the blocking reason is Breakpoint by the given name.
Sourcepub fn assert_terminated(self, name: impl AsRef<str>)
pub fn assert_terminated(self, name: impl AsRef<str>)
Assert that the blocking reason is Terminated by the given name.
Trait Implementations§
impl StructuralPartialEq for Blocked
Auto Trait Implementations§
impl !RefUnwindSafe for Blocked
impl !Sync for Blocked
impl !UnwindSafe for Blocked
impl Freeze for Blocked
impl Send for Blocked
impl Unpin for Blocked
impl UnsafeUnpin for Blocked
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> 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