Remove HostTrait altogether (#8681)
This commit is contained in:
committed by
Marek Kotewicz
parent
2060ea5de3
commit
3d76417353
@@ -333,17 +333,12 @@ impl<'a, T> NetworkContext for &'a T where T: ?Sized + NetworkContext {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HostInfo {
|
||||
/// Returns public key
|
||||
fn id(&self) -> &NodeId;
|
||||
}
|
||||
|
||||
/// Network IO protocol handler. This needs to be implemented for each new subprotocol.
|
||||
/// All the handler function are called from within IO event loop.
|
||||
/// `Message` is the type for message data.
|
||||
pub trait NetworkProtocolHandler: Sync + Send {
|
||||
/// Initialize the handler
|
||||
fn initialize(&self, _io: &NetworkContext, _host_info: &HostInfo) {}
|
||||
fn initialize(&self, _io: &NetworkContext) {}
|
||||
/// Called when new network packet received.
|
||||
fn read(&self, io: &NetworkContext, peer: &PeerId, packet_id: u8, data: &[u8]);
|
||||
/// Called when new peer is connected. Only called when peer supports the same protocol.
|
||||
|
||||
Reference in New Issue
Block a user