Trait nakamoto_net::simulator::Peer
source · pub trait Peer<P>: Deref<Target = P> + DerefMut<Target = P> + 'staticwhere
P: StateMachine,{
fn init(&mut self);
fn addr(&self) -> SocketAddr;
}
Expand description
A simulated peer. Protocol instances have to be wrapped in this type to be simulated.
Required Methods
sourcefn init(&mut self)
fn init(&mut self)
Initialize the peer. This should at minimum initialize the protocol with the current time.
sourcefn addr(&self) -> SocketAddr
fn addr(&self) -> SocketAddr
Get the peer address.