pub trait MessageReader: Send {
// Required method
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Pull-based async iterator over inbound messages. Real impl wraps
tokio_tungstenite::WebSocketStream; the conformance harness
provides a scripted impl.
Required Methods§
Sourcefn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the next message as a UTF-8 string, or None if the
underlying transport has closed cleanly. Errors should be
surfaced through Error rather than this return type so the
session loop can decide whether to retry.
Trait Implementations§
Source§impl MessageReader for Box<dyn MessageReader>
impl MessageReader for Box<dyn MessageReader>
Source§fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the next message as a UTF-8 string, or
None if the
underlying transport has closed cleanly. Errors should be
surfaced through Error rather than this return type so the
session loop can decide whether to retry.Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".