l1fe-weave-core · network::protocol
Source declarations, signatures and documentation for network::protocol.
Reviewed implementation boundary: Some core wrappers derive transport keys from DID strings. Do not infer secret key custody or authenticated peers from a supplied DID string; inspect the chosen wrapper and transport configuration. See /libraries/weave-core/overview.
Source: sigil/weave/libs/weave-core/src/network/protocol.rs. SHA-256: 24373f5bf31aba4fefd06532f0dae5782ae4f7ea7fcfbbac483937d1705acabe.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
Module condition:
#[cfg(feature = "p2p")]network::protocol::WEAVE_PROTOCOL
The Weave protocol constant
#[cfg(feature = "p2p")]
pub const WEAVE_PROTOCOL: &str;Source line: 15.
network::protocol::WeaveProtocol
The Weave protocol name
#[cfg(feature = "p2p")]
#[derive(Debug, Clone)]
pub struct WeaveProtocol;Source line: 19.
network::protocol::ProtocolMessage
Protocol message types
#[cfg(feature = "p2p")]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ProtocolMessage {
/// Request strand data
StrandRequest {
/// Strand DID
strand_did: String,
/// Start index
start: u64,
/// Length
length: Option<u64>,
},
/// Strand data response
StrandResponse {
/// Strand entries
entries: Vec<crate::storage::StrandEntry>,
},
/// Request file from Locus
LocusRequest {
/// Locus DID
locus_did: String,
/// File path
path: String,
},
/// Locus file response
LocusResponse {
/// File data
data: Vec<u8>,
/// Metadata
metadata: crate::storage::LocusMetadata,
},
/// Announce content
ContentAnnounce {
/// Content DID
did: String,
/// Content type
content_type: String,
},
/// Sync request
SyncRequest {
/// Source DID
source: String,
/// Target DID
target: String,
/// Sync metadata
metadata: Vec<u8>,
},
}Source line: 29.
network::protocol::WeaveCodec
Codec for the Weave protocol
#[cfg(feature = "p2p")]
#[derive(Clone, Default)]
pub struct WeaveCodec;Source line: 78.
network::protocol::ProtocolHandler
Protocol handler
#[cfg(feature = "p2p")]
pub struct ProtocolHandler {
}Source line: 148.
network::protocol::ProtocolHandler::new
Create a new protocol handler
#[cfg(feature = "p2p")]
pub fn new(peer_id: PeerId) -> Self;Source line: 155.
network::protocol::ProtocolHandler::handle_request
Handle incoming request
#[cfg(feature = "p2p")]
pub async fn handle_request(&self, request: ProtocolMessage) -> Result<ProtocolMessage>;Source line: 160.