Skip to main content

brokapi_sansio/
outbound.rs

1//! Outbound frames queued by sans-io cores for the transport layer.
2
3/// A wire message a core wants sent, returned by [`BrokerCore::poll_transmit`](crate::BrokerCore::poll_transmit).
4///
5/// # Examples
6///
7/// ```
8/// use brokapi_sansio::Outbound;
9///
10/// let Outbound::WsText(text) = Outbound::WsText(r#"{"op":"ping"}"#.to_string());
11/// assert!(text.contains("ping"));
12/// ```
13#[derive(Debug, Clone, PartialEq, Eq)]
14pub enum Outbound {
15    /// A WebSocket text frame. The string is sent as it is: UTF-8, no added framing.
16    WsText(String),
17}