Skip to main content

Gossip

Struct Gossip 

Source
pub struct Gossip<N, const MTU: usize = 256, const OUT: usize = 2048> { /* private fields */ }
Expand description

Epidemic gossip flood over a 4-connected torus mesh.

Implements NetworkWrite (wrap + flood) and NetworkRead (receive, dedup, forward, deliver).

Implementations§

Source§

impl<N, const MTU: usize, const OUT: usize> Gossip<N, MTU, OUT>
where N: Datalink,

Source

pub fn address(&self) -> Address

Returns this node’s own address.

Source

pub fn builder() -> GossipBuilder<N, MTU, OUT>

Creates a new gossip node with directional links.

Trait Implementations§

Source§

impl<N, const MTU: usize, const OUT: usize> NetworkRead for Gossip<N, MTU, OUT>
where N: Datalink,

Source§

type Error = GossipError<<N as Datalink>::ReadError>

Error type for read operations.
Source§

async fn read(&mut self, buffer: &mut [u8]) -> Result<usize, Self::Error>

Reads a packet into the provided buffer, returning its length.
Source§

impl<N, const MTU: usize, const OUT: usize> NetworkWrite for Gossip<N, MTU, OUT>
where N: Datalink,

Source§

type Error = GossipError<<N as Datalink>::WriteError>

Error type for write operations.
Source§

async fn write(&mut self, data: &[u8]) -> Result<(), Self::Error>

Writes a packet to the network.

Auto Trait Implementations§

§

impl<N, const MTU: usize, const OUT: usize> Freeze for Gossip<N, MTU, OUT>
where N: Freeze,

§

impl<N, const MTU: usize, const OUT: usize> RefUnwindSafe for Gossip<N, MTU, OUT>
where N: RefUnwindSafe,

§

impl<N, const MTU: usize, const OUT: usize> Send for Gossip<N, MTU, OUT>
where N: Send,

§

impl<N, const MTU: usize, const OUT: usize> Sync for Gossip<N, MTU, OUT>
where N: Sync,

§

impl<N, const MTU: usize, const OUT: usize> Unpin for Gossip<N, MTU, OUT>
where N: Unpin,

§

impl<N, const MTU: usize, const OUT: usize> UnsafeUnpin for Gossip<N, MTU, OUT>
where N: UnsafeUnpin,

§

impl<N, const MTU: usize, const OUT: usize> UnwindSafe for Gossip<N, MTU, OUT>
where N: UnwindSafe,

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.