Skip to content

Commit

Permalink
WIP: you have to add Pin...
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Sep 20, 2019
1 parent c1a4a7f commit d5769b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions zebra-network/src/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use std::{
net::SocketAddr,
task::{Context, Poll},
pin::Pin,
};

use chrono::{DateTime, Utc};
Expand Down Expand Up @@ -35,12 +36,11 @@ pub struct Peer {
/// resolves to a connected peer once the handshake completes.
pub struct PeerConnector;

/*
// Not sure how to deal with Unpin and async blocks...
impl Service<SocketAddr> for PeerConnector {
type Response = Peer;
type Error = Error;
type Future = Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Unpin>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;

fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
Expand All @@ -50,10 +50,9 @@ impl Service<SocketAddr> for PeerConnector {
let fut = async {
unimplemented!()
};
Box::new(fut)
fut.boxed()
}
}
*/

impl PeerConnector {
/// Connect to the remote peer.
Expand Down

0 comments on commit d5769b4

Please sign in to comment.