mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-05 20:51:37 +00:00
Add an error associated type to ProtocolsHandler (#795)
This commit is contained in:
@ -29,7 +29,7 @@ use crate::{
|
||||
}
|
||||
};
|
||||
use futures::prelude::*;
|
||||
use std::{io, time::Duration};
|
||||
use std::time::Duration;
|
||||
use tokio_timer::Timeout;
|
||||
|
||||
/// Prototype for a `NodeHandlerWrapper`.
|
||||
@ -123,7 +123,7 @@ where
|
||||
{
|
||||
type InEvent = TProtoHandler::InEvent;
|
||||
type OutEvent = TProtoHandler::OutEvent;
|
||||
type Error = io::Error; // TODO: better error type
|
||||
type Error = TProtoHandler::Error;
|
||||
type Substream = TProtoHandler::Substream;
|
||||
// The first element of the tuple is the unique upgrade identifier
|
||||
// (see `unique_dial_upgrade_id`).
|
||||
@ -198,7 +198,7 @@ where
|
||||
self.handler.shutdown();
|
||||
}
|
||||
|
||||
fn poll(&mut self) -> Poll<Option<NodeHandlerEvent<Self::OutboundOpenInfo, Self::OutEvent>>, io::Error> {
|
||||
fn poll(&mut self) -> Poll<Option<NodeHandlerEvent<Self::OutboundOpenInfo, Self::OutEvent>>, Self::Error> {
|
||||
// Continue negotiation of newly-opened substreams on the listening side.
|
||||
// We remove each element from `negotiating_in` one by one and add them back if not ready.
|
||||
for n in (0..self.negotiating_in.len()).rev() {
|
||||
|
Reference in New Issue
Block a user