OpenAgentID documentation
Source referencesRust module referenceopenagent-weave

openagent-weave · transport

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/adapters/weave/src/transport.rs. SHA-256: 411d7607bb9534c7e74a73f86b1e2cb1e5bd20371a1fa3bf9743c5143e259ee6.

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::TransportCommand

A command sent from [WeaveTransport] to the swarm event loop.

#[derive(Debug)]
pub enum TransportCommand {
    /// Send a request to a peer and receive the response asynchronously.
    SendRequest {
        /// Target peer.
        peer: PeerId,
        /// The handshake request to send.
        request: HandshakeRequest,
        /// Channel to receive the response.
        reply: oneshot::Sender<Result<HandshakeResponse, WeaveAuthError>>,
    },
}

Source line: 30.

transport::WeaveTransport

AuthTransport implementation for Weave/libp2p.

The transport sends commands through a channel that the swarm event loop consumes. This decouples the async transport API from the swarm poll loop.

Usage

use openagent_weave::{WeaveTransport, WeaveAuthConfig};

let (tx, rx) = tokio::sync::mpsc::channel(64);
let transport = WeaveTransport::new(config, tx, peer_store);

// In the swarm loop, consume `rx` and call the behaviour.
pub struct WeaveTransport {

}

Source line: 57.

transport::WeaveTransport::new

Creates a new Weave transport.

pub fn new(
        config: WeaveAuthConfig,
        command_tx: mpsc::Sender<TransportCommand>,
        peer_store: PeerAuthStore,
    ) -> Self;

Source line: 68.

transport::WeaveTransport::register_peer

Register a mapping from an endpoint/DID string to a libp2p PeerId.

The present and prove methods accept an endpoint parameter. For Weave, this should be the peer's base58 PeerId or DID string. Register the mapping here so the transport knows where to route.

pub async fn register_peer(&self, endpoint: &str, peer: PeerId);

Source line: 86.

transport::WeaveTransport::peer_store

Returns the peer auth store.

pub fn peer_store(&self) -> &PeerAuthStore;

Source line: 92.

On this page