mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 08:11:39 +00:00
Add an error associated type to ProtocolsHandler (#795)
This commit is contained in:
@ -33,7 +33,7 @@ use std::{
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use tokio_timer::Delay;
|
||||
use tokio_timer::{self, Delay};
|
||||
use void::{Void, unreachable};
|
||||
|
||||
/// Protocol handler that handles pinging the remote at a regular period.
|
||||
@ -153,6 +153,7 @@ where
|
||||
{
|
||||
type InEvent = Void;
|
||||
type OutEvent = OutEvent;
|
||||
type Error = io::Error; // TODO: more precise error type
|
||||
type Substream = TSubstream;
|
||||
type InboundProtocol = DeniedUpgrade;
|
||||
type OutboundProtocol = Ping<Instant>;
|
||||
|
@ -30,7 +30,6 @@ use libp2p_core::{
|
||||
upgrade::DeniedUpgrade
|
||||
};
|
||||
use log::warn;
|
||||
use std::io;
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use void::{Void, unreachable};
|
||||
|
||||
@ -72,6 +71,7 @@ where
|
||||
{
|
||||
type InEvent = Void;
|
||||
type OutEvent = Void;
|
||||
type Error = Void;
|
||||
type Substream = TSubstream;
|
||||
type InboundProtocol = Ping<()>;
|
||||
type OutboundProtocol = DeniedUpgrade;
|
||||
@ -118,7 +118,7 @@ where
|
||||
&mut self,
|
||||
) -> Poll<
|
||||
Option<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent>>,
|
||||
io::Error,
|
||||
Self::Error,
|
||||
> {
|
||||
// Removes each substream one by one, and pushes them back if they're not ready (which
|
||||
// should be the case 99% of the time).
|
||||
|
Reference in New Issue
Block a user