pub trait SyncTransport {
type Error: Debug + Display;
// Required methods
fn send_hash(&mut self, hash: &Hash) -> Result<(), Self::Error>;
fn recv_hash(&mut self) -> Result<Hash, Self::Error>;
fn send_event_hashes(
&mut self,
hashes: &[String],
) -> Result<(), Self::Error>;
fn recv_event_hashes(&mut self) -> Result<Vec<String>, Self::Error>;
fn send_events(&mut self, events: &[Event]) -> Result<(), Self::Error>;
fn recv_events(&mut self) -> Result<Vec<Event>, Self::Error>;
}Expand description
Abstraction over the wire protocol.
Implementations shuttle hashes and events between two replicas. The trait is intentionally simple; higher-level protocols (compression, batching, authentication) are layered on top.
Required Associated Types§
Required Methods§
Sourcefn send_event_hashes(&mut self, hashes: &[String]) -> Result<(), Self::Error>
fn send_event_hashes(&mut self, hashes: &[String]) -> Result<(), Self::Error>
Send a list of event hashes that we want the remote to check.
§Errors
Returns Self::Error if the send fails.