openagent-ws · session
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/adapters/websocket/rust/src/session.rs. SHA-256: 6a62576fb7175db89350d6f835a0a351a791eeaa23ac997d206d7bb3c5108b3f.
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.
session::AuthenticatedSession
An authenticated WebSocket session with an optional encryption layer.
Created by [crate::server::OpenAgentWsHandler::accept] or
[crate::client::OpenAgentWsClient::connect] after a successful OAAP
handshake.
pub struct AuthenticatedSession<S> {
}Source line: 34.
session::AuthenticatedSession<S>::session_id_hex
Returns the hex-encoded session ID.
pub fn session_id_hex(&self) -> String;Source line: 108.
session::AuthenticatedSession<S>::peer_did
Returns the peer's DID.
pub fn peer_did(&self) -> &str;Source line: 113.
session::AuthenticatedSession<S>::is_encrypted
Returns whether this session uses encryption.
pub fn is_encrypted(&self) -> bool;Source line: 118.
session::AuthenticatedSession<S>::send
Sends a payload over the authenticated session.
If the session was established with encryption, the payload is AES-256-GCM encrypted with a fresh random nonce. Otherwise, it is sent as plaintext.
pub async fn send(&mut self, payload: &[u8]) -> Result<()>;Source line: 133.
session::AuthenticatedSession<S>::receive
Receives the next message payload from the authenticated session.
Validates session ID, verifies sequence ordering, and decrypts if the session is encrypted.
pub async fn receive(&mut self) -> Result<Vec<u8>>;Source line: 173.