Skip to main content

GossipSyncEngine

Struct GossipSyncEngine 

Source
pub struct GossipSyncEngine { /* private fields */ }
Expand description

Push-pull gossip engine for in-process synchronization tests and example flows.

Implementations§

Source§

impl GossipSyncEngine

Source

pub fn new(local_peer_id: impl Into<String>, config: GossipConfig) -> Self

Source

pub fn peers(&self) -> &[PeerAddress]

Source

pub fn config(&self) -> &GossipConfig

Source

pub fn local_peer_id(&self) -> &str

Source

pub fn has_gene(&self, gene_id: &str) -> bool

Source

pub fn gene_version(&self, gene_id: &str) -> Option<u64>

Source

pub fn register_envelope(&self, envelope: EvolutionEnvelope) -> usize

Source

pub fn build_digest(&self) -> GossipDigest

Source

pub fn build_fetch_query_for_digest(&self, digest: &GossipDigest) -> FetchQuery

Source

pub fn respond_to_fetch(&self, query: &FetchQuery) -> FetchResponse

Source

pub fn apply_fetch_response(&self, response: &FetchResponse) -> Vec<String>

Source

pub async fn sync_once_with( &self, remote: &GossipSyncEngine, ) -> GossipSyncReport

Source

pub async fn start_sync_loop(self) -> JoinHandle<()>

Source

pub fn serialize_digest_json(digest: &GossipDigest) -> Result<Vec<u8>, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.