pub struct SimReceiver<T: Serialize + DeserializeOwned, O: Ordering, R: Retries>(/* private fields */);sim only.Expand description
A receiver for an external bincode stream in a simulation.
Implementations§
Source§impl<T: Serialize + DeserializeOwned, O: Ordering, R: Retries> SimReceiver<T, O, R>
impl<T: Serialize + DeserializeOwned, O: Ordering, R: Retries> SimReceiver<T, O, R>
Sourcepub fn assert_no_more(self) -> impl Future<Output = ()>where
T: Debug,
pub fn assert_no_more(self) -> impl Future<Output = ()>where
T: Debug,
Asserts that the stream has ended and no more messages can possibly arrive.
Source§impl<T: Serialize + DeserializeOwned> SimReceiver<T, TotalOrder, ExactlyOnce>
impl<T: Serialize + DeserializeOwned> SimReceiver<T, TotalOrder, ExactlyOnce>
Sourcepub async fn next(&self) -> Option<T>
pub async fn next(&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 fn assert_yields<T2: Debug, I: IntoIterator<Item = T2>>(
&self,
expected: I,
) -> impl use<'_, T, T2, I> + Future<Output = ()>
pub fn assert_yields<T2: Debug, I: IntoIterator<Item = T2>>( &self, expected: I, ) -> impl use<'_, T, T2, I> + Future<Output = ()>
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 fn assert_yields_only<T2: Debug, I: IntoIterator<Item = T2>>(
&self,
expected: I,
) -> impl use<'_, T, T2, I> + Future<Output = ()>
pub fn assert_yields_only<T2: Debug, I: IntoIterator<Item = T2>>( &self, expected: I, ) -> impl use<'_, T, T2, I> + Future<Output = ()>
Asserts that the stream yields only the expected sequence of messages, in order, and then ends.
Source§impl<T: Serialize + DeserializeOwned> SimReceiver<T, NoOrder, ExactlyOnce>
impl<T: Serialize + DeserializeOwned> SimReceiver<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 fn assert_yields_unordered<T2: Debug, I: IntoIterator<Item = T2>>(
&self,
expected: I,
) -> impl use<'_, T, T2, I> + Future<Output = ()>
pub fn assert_yields_unordered<T2: Debug, I: IntoIterator<Item = T2>>( &self, expected: I, ) -> impl use<'_, T, T2, I> + Future<Output = ()>
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 fn assert_yields_only_unordered<T2: Debug, I: IntoIterator<Item = T2>>(
&self,
expected: I,
) -> impl use<'_, T, T2, I> + Future<Output = ()>
pub fn assert_yields_only_unordered<T2: Debug, I: IntoIterator<Item = T2>>( &self, expected: I, ) -> impl use<'_, T, T2, I> + Future<Output = ()>
Asserts that the stream yields only the expected sequence of messages, in some order, and then ends.
Trait Implementations§
Source§impl<T: Serialize + DeserializeOwned, O: Ordering, R: Retries> Clone for SimReceiver<T, O, R>
impl<T: Serialize + DeserializeOwned, O: Ordering, R: Retries> Clone for SimReceiver<T, O, R>
impl<T: Serialize + DeserializeOwned, O: Ordering, R: Retries> Copy for SimReceiver<T, O, R>
Auto Trait Implementations§
impl<T, O, R> Freeze for SimReceiver<T, O, R>
impl<T, O, R> RefUnwindSafe for SimReceiver<T, O, R>
impl<T, O, R> Send for SimReceiver<T, O, R>
impl<T, O, R> Sync for SimReceiver<T, O, R>
impl<T, O, R> Unpin for SimReceiver<T, O, R>
impl<T, O, R> UnwindSafe for SimReceiver<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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§impl<T> ToSinkBuild for T
impl<T> ToSinkBuild for T
§fn iter_to_sink_build(self) -> SendIterBuild<Self>
fn iter_to_sink_build(self) -> SendIterBuild<Self>
§fn stream_to_sink_build(self) -> SendStreamBuild<Self>where
Self: Sized + Stream,
fn stream_to_sink_build(self) -> SendStreamBuild<Self>where
Self: Sized + Stream,
SinkBuild] adaptor chain to send all items from self as a [Stream].