pub trait MediaSocket: Send {
// Required methods
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<WsIn>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_text<'life0, 'async_trait>(
&'life0 mut self,
s: String,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_binary<'life0, 'async_trait>(
&'life0 mut self,
b: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), FlowcatError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A bidirectional media socket carrying text/binary WebSocket frames.
Implementations are driven (via MediaTransport)
by the S2S pipeline: recv yields inbound
frames; send_text/send_binary push outbound frames.
Required Methods§
Sourcefn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<WsIn>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<WsIn>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive the next inbound frame, or None once the socket is exhausted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".