Skip to main content

Local

Trait Local 

Source
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§

Source

fn cursors(&self) -> Result<Vec<(String, u64)>>

Source

fn set_cursor(&self, peer_id: &str, last_seq: u64) -> Result<()>

Source

fn import(&self, header: &SyncHeader, lines: &[String]) -> Result<Imported>

header is the stream’s, sent by the peer, not this machine’s.

Source

fn export( &self, peer_id: &str, after_seq: u64, limit: usize, ) -> Result<Exported>

Records after after_seq, sealed for peer_id.

Source

fn hello_for(&self, peer_id: &str) -> Result<Hello>

Source

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.

Source

fn record_ack(&self, peer_id: &str, acked_seq: u64) -> Result<()>

peer_id has applied this store’s log through acked_seq.

Source

fn record_peer_in(&self, peer_id: &str, seq: u64) -> Result<()>

peer_id’s push applied its log through seq here.

Source

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.

Source

fn record_push_report(&self, peer_id: &str, reported: Option<u64>) -> Result<()>

Provided Methods§

Source

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.

Source

fn merging(&self) -> Result<Option<Merging>>

The snapshot merge this store has not finished, if any.

Source

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.

Source

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.

Source

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".

Implementors§