weave-strand · replication_client
Source declarations, signatures and documentation for replication_client.
Source: sigil/weave/models/strand/src/replication_client.rs. SHA-256: 33e817099e04f94b9103c7dacaced5236bff26f4e114eb0eb861fd80e35e03e3.
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_client::ReplicationClient
Network-facing sparse download surface used by Strand when a block is missing locally. Implementations live in weave-sdk (session + DHT I/O).
#[async_trait]
pub trait ReplicationClient: Send + Sync {
/// Fetch one missing block and ensure it is durable in local storage
/// before returning its bytes.
async fn fetch_block(&self, _seq: u64) -> Result<Vec<u8>>;
/// Ensure every block in `[start, end)` (or `[start, len)` when `end` is
/// `None`) is present locally. May perform network I/O.
async fn ensure_range(&self, start: u64, end: Option<u64>) -> Result<()>;
}Source line: 17.
replication_client::UnsupportedReplicationClient
Fail-closed client used when sparse mode is enabled but no real network hook was installed. Never reports success for missing blocks.
#[derive(Debug, Default, Clone, Copy)]
pub struct UnsupportedReplicationClient;Source line: 30.
replication_client::SharedReplicationClient
Shared handle installed on a Strand.
pub type SharedReplicationClient = Arc<dyn ReplicationClient>;Source line: 49.
replication_client::unsupported_network
Helper: return the fail-closed unsupported error for APIs that previously pretended network work succeeded.
pub fn unsupported_network(op: &'static str) -> StrandError;Source line: 53.