Weave documentation
Rust referencestrand-vault

strand-vault · replication

Source declarations, signatures and documentation for replication.

Reviewed implementation boundary: Vault construction does not automatically replay WAL entries. Snapshotting is a best-effort directory copy; replication mode/live settings are not implemented as runtime controls, and the capability preamble is not ACT authorization verification. See /libraries/strand-vault/overview.

Source: sigil/weave/libs/strand-vault/src/replication.rs. SHA-256: ec882f5e29ed5c7effecf365a4da97f499517ca462f6c926679878954fa9f7bc.

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.

replication::ReplicationMode

Replication mode

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ReplicationMode {
    /// Push local changes to remote
    Push,
    /// Pull remote changes to local
    Pull,
    /// Bidirectional sync
    Sync,
}

Source line: 16.

replication::ReplicationOptions

Options for replication

#[derive(Debug, Clone)]
pub struct ReplicationOptions {
/// Strands to replicate

pub strands: Vec<StrandId>,
/// Replication mode

pub mode: ReplicationMode,
/// Enable live mode (continuous replication)

pub live: bool,
/// Enable encryption

pub encrypted: bool,
/// Bandwidth limit in bytes/sec (None = unlimited)

pub bandwidth_limit: Option<u64>,
/// Capability token for auth (opaque)

pub capability: Option<Vec<u8>>,
/// Optional per-strand starting sequence for resumable replication

pub start_from: Option<Vec<(StrandId, u64)>>
}

Source line: 27.

replication::ReplicationStream

Replication stream for multiple strands

pub struct ReplicationStream {

}

Source line: 65.

replication::ReplicationStream::replicate

Run replication over a stream

#[instrument(name = "strand_vault.replicate", skip_all, fields(strands = %self.strands.len()))]
pub async fn replicate<S>(&mut self, mut stream: S) -> Result<()>
    where
        S: AsyncRead + AsyncWrite + Unpin + Send + 'static,;

Source line: 90.

replication::VaultReplicator

Handles incoming replication connections

pub struct VaultReplicator {

}

Source line: 285.

replication::VaultReplicator::new

pub fn new(vault: StrandVault) -> Self;

Source line: 290.

replication::VaultReplicator::handle_stream

Handle an incoming replication stream

pub async fn handle_stream<S>(&mut self, mut stream: S) -> Result<()>
    where
        S: AsyncRead + AsyncWrite + Unpin + Send + 'static,;

Source line: 295.

replication::StrandVault::replicate

Create a replication stream for multiple strands

pub async fn replicate(&self, opts: ReplicationOptions) -> Result<ReplicationStream>;

Source line: 450.

replication::StrandVault::accept_replication

Accept incoming replication

pub async fn accept_replication<S>(&self, stream: S) -> Result<()>
    where
        S: AsyncRead + AsyncWrite + Unpin + Send + 'static,;

Source line: 477.

On this page