pub trait StreamExecutorTestExt: MessageStream + Unpin {
// Provided methods
fn next_unwrap_pending(&mut self) { ... }
fn next_unwrap_ready(&mut self) -> StreamExecutorResult<Message> { ... }
fn next_unwrap_ready_chunk(&mut self) -> StreamExecutorResult<StreamChunk> { ... }
fn next_unwrap_ready_barrier(&mut self) -> StreamExecutorResult<Barrier> { ... }
fn next_unwrap_ready_watermark(&mut self) -> StreamExecutorResult<Watermark> { ... }
fn expect_barrier<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Barrier> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn expect_chunk<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamChunk> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn expect_watermark<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Watermark> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Trait for testing StreamExecutor
more easily.
With next_unwrap_ready
, we can retrieve the next message from the executor without await
ing,
so that we can immediately panic if the executor is not ready instead of getting stuck. This is
useful for testing.
Provided Methods§
sourcefn next_unwrap_pending(&mut self)
fn next_unwrap_pending(&mut self)
Asserts that the executor is pending (not ready) now.
Panics if it is ready.
sourcefn next_unwrap_ready(&mut self) -> StreamExecutorResult<Message>
fn next_unwrap_ready(&mut self) -> StreamExecutorResult<Message>
Asserts that the executor is ready now, returning the next message.
Panics if it is pending.
sourcefn next_unwrap_ready_chunk(&mut self) -> StreamExecutorResult<StreamChunk>
fn next_unwrap_ready_chunk(&mut self) -> StreamExecutorResult<StreamChunk>
Asserts that the executor is ready on a StreamChunk
now, returning the next chunk.
Panics if it is pending or the next message is not a StreamChunk
.