pub trait Local {
Show 15 methods
// Required methods
fn cursors(&self) -> Result<Vec<(String, u64)>>;
fn set_cursor(&self, peer_id: &str, last_seq: u64) -> Result<()>;
fn import(&self, header: &SyncHeader, lines: &[String]) -> Result<Imported>;
fn export(
&self,
peer_id: &str,
after_seq: u64,
limit: usize,
) -> Result<Exported>;
fn hello_for(&self, peer_id: &str) -> Result<Hello>;
fn accept_hello(&self, hello: &Hello) -> Result<()>;
fn record_ack(&self, peer_id: &str, acked_seq: u64) -> Result<()>;
fn record_peer_in(&self, peer_id: &str, seq: u64) -> Result<()>;
fn push_report(&self, peer_id: &str) -> Result<Option<u64>>;
fn record_push_report(
&self,
peer_id: &str,
reported: Option<u64>,
) -> Result<()>;
// Provided methods
fn merge_snapshot(
&self,
exporter: &str,
stream: Box<dyn Read + Send>,
) -> Result<Merged> { ... }
fn merging(&self) -> Result<Option<Merging>> { ... }
fn export_snapshot(&self, peer: &Hello) -> Result<Box<dyn Read + Send>> { ... }
fn bootstrap_pending(&self) -> Result<bool> { ... }
fn finish_bootstrap(&self) -> Result<()> { ... }
}Expand description
This machine’s store: sb reaches it through the daemon’s API, the daemon
directly. Records cross it as sealed wire lines, so only the daemon holds
a key and the session only carries lines between it and the peer.
Required Methods§
fn cursors(&self) -> Result<Vec<(String, u64)>>
fn set_cursor(&self, peer_id: &str, last_seq: u64) -> Result<()>
Sourcefn import(&self, header: &SyncHeader, lines: &[String]) -> Result<Imported>
fn import(&self, header: &SyncHeader, lines: &[String]) -> Result<Imported>
header is the stream’s, sent by the peer, not this machine’s.
Sourcefn export(
&self,
peer_id: &str,
after_seq: u64,
limit: usize,
) -> Result<Exported>
fn export( &self, peer_id: &str, after_seq: u64, limit: usize, ) -> Result<Exported>
Records after after_seq, sealed for peer_id.
fn hello_for(&self, peer_id: &str) -> Result<Hello>
Sourcefn accept_hello(&self, hello: &Hello) -> Result<()>
fn accept_hello(&self, hello: &Hello) -> Result<()>
Raises this store’s clock floors from a peer’s hello; fails the sync when the peer’s clock is out of bounds.
Sourcefn record_ack(&self, peer_id: &str, acked_seq: u64) -> Result<()>
fn record_ack(&self, peer_id: &str, acked_seq: u64) -> Result<()>
peer_id has applied this store’s log through acked_seq.
Sourcefn record_peer_in(&self, peer_id: &str, seq: u64) -> Result<()>
fn record_peer_in(&self, peer_id: &str, seq: u64) -> Result<()>
peer_id’s push applied its log through seq here.
Sourcefn push_report(&self, peer_id: &str) -> Result<Option<u64>>
fn push_report(&self, peer_id: &str) -> Result<Option<u64>>
How far into this store’s log peer_id last reported it had applied
when it took a push.
fn record_push_report(&self, peer_id: &str, reported: Option<u64>) -> Result<()>
Provided Methods§
Sourcefn merge_snapshot(
&self,
exporter: &str,
stream: Box<dyn Read + Send>,
) -> Result<Merged>
fn merge_snapshot( &self, exporter: &str, stream: Box<dyn Read + Send>, ) -> Result<Merged>
Spools a snapshot stream from exporter and merges it, or leaves the
merge running where the store lives and says so.
Sourcefn merging(&self) -> Result<Option<Merging>>
fn merging(&self) -> Result<Option<Merging>>
The snapshot merge this store has not finished, if any.
Sourcefn export_snapshot(&self, peer: &Hello) -> Result<Box<dyn Read + Send>>
fn export_snapshot(&self, peer: &Hello) -> Result<Box<dyn Read + Send>>
A snapshot of this store sealed for the peer whose hello this is, which is pinned at the store’s head before the first row is read.
Sourcefn bootstrap_pending(&self) -> Result<bool>
fn bootstrap_pending(&self) -> Result<bool>
This device was paired with an empty store and has not yet merged a snapshot and pulled after it, so its first pull takes a snapshot.
Sourcefn finish_bootstrap(&self) -> Result<()>
fn finish_bootstrap(&self) -> Result<()>
The first pull after a bootstrap snapshot succeeded.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".