Skip to main content

Transport

Trait Transport 

Source
pub trait Transport {
    // Required methods
    fn host(&self) -> &str;
    fn whoami(&self) -> Result<String>;
    fn export(
        &self,
        after_seq: u64,
        hello: &Hello,
    ) -> Result<(Box<dyn Read + Send>, Box<dyn Remote>)>;
    fn import(
        &self,
    ) -> Result<(Box<dyn Write + Send>, Box<dyn Read + Send>, Box<dyn Remote>)>;

    // Provided methods
    fn snapshot_export(
        &self,
        hello: &Hello,
    ) -> Result<(Box<dyn Read + Send>, Box<dyn Remote>)> { ... }
    fn snapshot_import(
        &self,
    ) -> Result<(Box<dyn Write + Send>, Box<dyn Read + Send>, Box<dyn Remote>)> { ... }
}

Required Methods§

Source

fn host(&self) -> &str

Source

fn whoami(&self) -> Result<String>

Source

fn export( &self, after_seq: u64, hello: &Hello, ) -> Result<(Box<dyn Read + Send>, Box<dyn Remote>)>

Source

fn import( &self, ) -> Result<(Box<dyn Write + Send>, Box<dyn Read + Send>, Box<dyn Remote>)>

The pushed stream goes to the peer’s sb sync-import on the writer; its handshake and result come back on the reader.

Provided Methods§

Source

fn snapshot_export( &self, hello: &Hello, ) -> Result<(Box<dyn Read + Send>, Box<dyn Remote>)>

The peer’s snapshot, sealed for the puller named in hello.

Source

fn snapshot_import( &self, ) -> Result<(Box<dyn Write + Send>, Box<dyn Read + Send>, Box<dyn Remote>)>

A snapshot streamed to the peer, which spools it and answers with the merge it started.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§