pub trait TryExpect<Item>{
// Required methods
fn expect_ok(self) -> impl Stream<Item = Item> + Send;
fn map_expect(self, msg: &str) -> impl Stream<Item = Item> + Send;
}Expand description
Converts fallible stream items into values by expecting success.
Successful items pass through in source order. Errors terminate the current poll by panicking with either a default or caller-supplied message.
Required Methods§
Sourcefn expect_ok(self) -> impl Stream<Item = Item> + Send
fn expect_ok(self) -> impl Stream<Item = Item> + Send
Expects every stream item with the default failure message.
Successful values are unwrapped lazily as the stream is polled. The default message identifies a stream expectation failure.
§Panics
Panics when the source stream yields an error.
Sourcefn map_expect(self, msg: &str) -> impl Stream<Item = Item> + Send
fn map_expect(self, msg: &str) -> impl Stream<Item = Item> + Send
Expects every stream item with msg as the failure message.
Successful values are unwrapped lazily as the stream is polled. The supplied message is used for every failing item.
§Panics
Panics when the source stream yields an error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".