weave-strand · replication_api
Source declarations, signatures and documentation for replication_api.
Source: sigil/weave/models/strand/src/replication_api.rs. SHA-256: 758ab0f0e0dc1bb6320c0626ae0461ac481012d508d7e601b3561af03db793b8.
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_api::ReplicationOptions
Options controlling replication behavior (network-agnostic)
#[derive(Debug, Clone, Default)]
pub struct ReplicationOptions {
/// Whether this side initiated the transport connection (reserved)
pub is_initiator: bool,
/// Prefer linear download scheduling (sequential)
pub linear: bool,
/// When true, `download` may walk local storage only (no network).
/// Default false: missing network client fails closed.
pub local_only: bool
}Source line: 10.
replication_api::RangeSpec
Range specification for scheduling block fetches
#[derive(Debug, Clone, Copy)]
pub struct RangeSpec {
/// Start index (inclusive)
pub start: u64,
/// Optional end index (exclusive). None means unbounded to current len
pub end: Option<u64>,
/// Prefer linear scheduling within range
pub linear: bool
}Source line: 22.
replication_api::RangeHandle
Handle for a scheduled range; cancel to stop processing
pub struct RangeHandle {
}Source line: 32.
replication_api::RangeHandle::cancel
Request cancellation of this range (best-effort)
pub fn cancel(&mut self);Source line: 39.
replication_api::RangeHandle::cancel_async
Cancel and await termination
pub async fn cancel_async(mut self) -> Result<()>;Source line: 46.
replication_api::ReplicationHandle
Replication session handle for local scheduling / sparse client I/O
pub struct ReplicationHandle {
}Source line: 56.
replication_api::ReplicationHandle::new
Create a new handle bound to a given strand
pub fn new(strand: Arc<Mutex<Strand>>, opts: ReplicationOptions) -> Self;Source line: 63.
replication_api::ReplicationHandle::download
Request a range download. Returns a handle which can be cancelled.
- If a [
crate::ReplicationClient] is installed, performs real sparse I/O. - If
opts.local_only, walks already-local blocks only. - Otherwise fails closed (no fake network success).
pub async fn download(&self, range: RangeSpec) -> Result<RangeHandle>;Source line: 72.
replication_api::ReplicationHandle::poll_once
Advance replication loop once (no-op when idle)
pub async fn poll_once(&self) -> Result<()>;Source line: 94.
replication_api::create_handle
Create a replication handle with a shallow-cloned strand sharing storage backend
pub async fn create_handle(strand: &Strand, opts: ReplicationOptions) -> ReplicationHandle;Source line: 174.