fix compile warnings (#10993)
* fix warnings * fix: failing build, use `spec` as dev-dependency
This commit is contained in:
committed by
Andronik Ordian
parent
505e284932
commit
dab2a6bd4b
@@ -145,7 +145,7 @@ impl From<Option<io::Error>> for AddressResolveError {
|
||||
}
|
||||
|
||||
impl error::Error for Error {
|
||||
fn source(&self) -> Option<&(error::Error + 'static)> {
|
||||
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||
match self {
|
||||
Error::Decompression(e) => Some(e),
|
||||
Error::Rlp(e) => Some(e),
|
||||
|
||||
@@ -75,7 +75,7 @@ pub enum NetworkIoMessage {
|
||||
/// Register a new protocol handler.
|
||||
AddHandler {
|
||||
/// Handler shared instance.
|
||||
handler: Arc<NetworkProtocolHandler + Sync>,
|
||||
handler: Arc<dyn NetworkProtocolHandler + Sync>,
|
||||
/// Protocol Id.
|
||||
protocol: ProtocolId,
|
||||
/// Supported protocol versions and number of packet IDs reserved by the protocol (packet count).
|
||||
@@ -361,15 +361,15 @@ impl<'a, T> NetworkContext for &'a T where T: ?Sized + NetworkContext {
|
||||
/// `Message` is the type for message data.
|
||||
pub trait NetworkProtocolHandler: Sync + Send {
|
||||
/// Initialize the handler
|
||||
fn initialize(&self, _io: &NetworkContext) {}
|
||||
fn initialize(&self, _io: &dyn NetworkContext) {}
|
||||
/// Called when new network packet received.
|
||||
fn read(&self, io: &NetworkContext, peer: &PeerId, packet_id: u8, data: &[u8]);
|
||||
fn read(&self, io: &dyn NetworkContext, peer: &PeerId, packet_id: u8, data: &[u8]);
|
||||
/// Called when new peer is connected. Only called when peer supports the same protocol.
|
||||
fn connected(&self, io: &NetworkContext, peer: &PeerId);
|
||||
fn connected(&self, io: &dyn NetworkContext, peer: &PeerId);
|
||||
/// Called when a previously connected peer disconnects.
|
||||
fn disconnected(&self, io: &NetworkContext, peer: &PeerId);
|
||||
fn disconnected(&self, io: &dyn NetworkContext, peer: &PeerId);
|
||||
/// Timer function called after a timeout created with `NetworkContext::timeout`.
|
||||
fn timeout(&self, _io: &NetworkContext, _timer: TimerToken) {}
|
||||
fn timeout(&self, _io: &dyn NetworkContext, _timer: TimerToken) {}
|
||||
}
|
||||
|
||||
/// Non-reserved peer modes.
|
||||
|
||||
Reference in New Issue
Block a user