openagent-ws · transport
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/adapters/websocket/rust/src/transport.rs. SHA-256: 5d57dbb937bafb15a6c437c9b23cb383321f954c96469cb5d92ab2d3b49fb201.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
transport::WsStream
The raw WebSocket stream type (over TCP, possibly TLS).
pub type WsStream = WebSocketStream<MaybeTlsStream<TcpStream>>;Source line: 21.
transport::WsServerStream
The raw WebSocket stream type for a server-side accepted connection (plain TCP).
pub type WsServerStream = WebSocketStream<TcpStream>;Source line: 24.
transport::OaapFrame
Typed OAAP frames dispatched from the WebSocket.
#[derive(Debug)]
pub enum OaapFrame {
/// Step 1: `oaap:present`.
Present(PresentFrame),
/// Step 2: `oaap:challenge`.
Challenge(ChallengeFrame),
/// Step 3: `oaap:prove`.
Prove(ProveFrame),
/// Step 4: `oaap:established`.
Established(EstablishedFrame),
/// Post-handshake data.
Message(MessageFrame),
}Source line: 28.
transport::send_frame
Sends a serializable frame as a JSON text message.
pub async fn send_frame<S, F>(ws: &mut S, frame: &F) -> Result<()>
where
S: SinkExt<Message> + Unpin,
S::Error: std::fmt::Display,
F: serde::Serialize,;Source line: 42.
transport::recv_frame
Reads the next text frame from the WebSocket, deserializes and dispatches it.
Binary frames are silently skipped. Ping/Pong are handled by tungstenite
automatically. Close frames cause [WsError::HandshakeClosed] with step = 0.
pub async fn recv_frame<S>(ws: &mut S) -> Result<OaapFrame>
where
S: StreamExt<Item = std::result::Result<Message, tokio_tungstenite::tungstenite::Error>>
+ Unpin,;Source line: 59.