pub struct SimReceiver<'a, T, O: Ordering, R: Retries>(/* private fields */);
sim
and stageleft_runtime
only.Expand description
A receiver for an external bincode stream in a simulation.
Implementations§
Source§impl<'a, T, O: Ordering, R: Retries> SimReceiver<'a, T, O, R>
impl<'a, T, O: Ordering, R: Retries> SimReceiver<'a, T, O, R>
Sourcepub async fn assert_no_more(self)where
T: Debug,
pub async fn assert_no_more(self)where
T: Debug,
Asserts that the stream has ended and no more messages can possibly arrive.
Source§impl<'a, T> SimReceiver<'a, T, TotalOrder, ExactlyOnce>
impl<'a, T> SimReceiver<'a, T, TotalOrder, ExactlyOnce>
Sourcepub async fn next(&mut self) -> Option<T>
pub async fn next(&mut self) -> Option<T>
Receives the next message from the external bincode stream. This will wait until a message
is available, or return None
if no more messages can possibly arrive.
Sourcepub async fn collect<C: Default + Extend<T>>(self) -> C
pub async fn collect<C: Default + Extend<T>>(self) -> C
Collects all remaining messages from the external bincode stream into a collection. This will wait until no more messages can possibly arrive.
Sourcepub async fn assert_yields(&mut self, expected: impl IntoIterator<Item = T>)
pub async fn assert_yields(&mut self, expected: impl IntoIterator<Item = T>)
Asserts that the stream yields exactly the expected sequence of messages, in order.
This does not check that the stream ends, use Self::assert_yields_only
for that.
Sourcepub async fn assert_yields_only(self, expected: impl IntoIterator<Item = T>)
pub async fn assert_yields_only(self, expected: impl IntoIterator<Item = T>)
Asserts that the stream yields only the expected sequence of messages, in order, and then ends.
Source§impl<'a, T> SimReceiver<'a, T, NoOrder, ExactlyOnce>
impl<'a, T> SimReceiver<'a, T, NoOrder, ExactlyOnce>
Sourcepub async fn collect_sorted<C: Default + Extend<T> + AsMut<[T]>>(self) -> Cwhere
T: Ord,
pub async fn collect_sorted<C: Default + Extend<T> + AsMut<[T]>>(self) -> Cwhere
T: Ord,
Collects all remaining messages from the external bincode stream into a collection, sorting them. This will wait until no more messages can possibly arrive.
Sourcepub async fn assert_yields_unordered(
&mut self,
expected: impl IntoIterator<Item = T>,
)
pub async fn assert_yields_unordered( &mut self, expected: impl IntoIterator<Item = T>, )
Asserts that the stream yields exactly the expected sequence of messages, in some order.
This does not check that the stream ends, use Self::assert_yields_only_unordered
for that.
Sourcepub async fn assert_yields_only_unordered(
self,
expected: impl IntoIterator<Item = T>,
)
pub async fn assert_yields_only_unordered( self, expected: impl IntoIterator<Item = T>, )
Asserts that the stream yields only the expected sequence of messages, in some order, and then ends.
Auto Trait Implementations§
impl<'a, T, O, R> Freeze for SimReceiver<'a, T, O, R>
impl<'a, T, O, R> !RefUnwindSafe for SimReceiver<'a, T, O, R>
impl<'a, T, O, R> !Send for SimReceiver<'a, T, O, R>
impl<'a, T, O, R> !Sync for SimReceiver<'a, T, O, R>
impl<'a, T, O, R> Unpin for SimReceiver<'a, T, O, R>
impl<'a, T, O, R> !UnwindSafe for SimReceiver<'a, T, O, R>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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