Trait iroh_gossip::proto::topic::IO

source ·
pub trait IO<PI: Clone> {
    // Required method
    fn push(&mut self, event: impl Into<OutEvent<PI>>);

    // Provided method
    fn push_from_iter(
        &mut self,
        iter: impl IntoIterator<Item = impl Into<OutEvent<PI>>>
    ) { ... }
}
Expand description

A trait for a concrete type to push OutEvents to.

The implementation is generic over this trait, which allows the upper layer to supply a container of their choice for OutEvents emitted from the protocol state.

Required Methods§

source

fn push(&mut self, event: impl Into<OutEvent<PI>>)

Push an event in the IO container

Provided Methods§

source

fn push_from_iter( &mut self, iter: impl IntoIterator<Item = impl Into<OutEvent<PI>>> )

Push all events from an iterator into the IO container

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<PI: Clone> IO<PI> for VecDeque<OutEvent<PI>>

source§

fn push(&mut self, event: impl Into<OutEvent<PI>>)

Implementors§