Trait nakamoto_net::Service

source ·
pub trait Service<Id: PeerId = SocketAddr>: StateMachine<Id, Message = [u8]> {
    type Command;

    fn command_received(&mut self, cmd: Self::Command);
}
Expand description

A network service.

Network protocols must implement this trait to be drivable by the reactor.

Required Associated Types

Commands handled by the service. These commands should originate from an external “user” thread. They are passed through the reactor via a channel given to Reactor::run. The reactor calls Service::command_received on the service for each command received.

Required Methods

An external command has been received.

Implementors