openagent-ws · server
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/adapters/websocket/rust/src/server.rs. SHA-256: 3c53322097a362242fd8fbdab4d5b681606bb2c9f50a79a9d415da5013dbaf04.
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.
server::OpenAgentWsHandler
Server-side OAAP WebSocket handler.
Holds the server's identity material. Call accept on each
incoming WebSocket connection to run the 4-step authentication handshake.
pub struct OpenAgentWsHandler {
}Source line: 32.
server::OpenAgentWsHandler::new
Creates a new handler with the server's identity.
Arguments
did— Server'sdid:oas:*identifier.signing_key— 32-byte Ed25519 signing key.verifying_key— 32-byte Ed25519 verifying key.
pub fn new(did: impl Into<String>, signing_key: [u8; 32], verifying_key: [u8; 32]) -> Self;Source line: 48.
server::OpenAgentWsHandler::with_encryption
Sets whether sessions use encryption (default: true).
pub fn with_encryption(mut self, encrypted: bool) -> Self;Source line: 59.
server::OpenAgentWsHandler::with_timeout
Overrides the per-step handshake timeout (default: 5s).
pub fn with_timeout(mut self, duration: Duration) -> Self;Source line: 65.
server::OpenAgentWsHandler::accept
Runs the 4-step OAAP handshake on an accepted WebSocket connection.
Returns an [AuthenticatedSession] on success. The caller should then
use session.send() / session.receive() for all subsequent
communication.
Errors
Returns [WsError] if the handshake fails for any reason: timeout,
unexpected frame, bad signature, transport error.
pub async fn accept(
&self,
mut ws: WsServerStream,
) -> Result<AuthenticatedSession<WsServerStream>>;Source line: 80.