Display impl for ReqId

This commit is contained in:
Robert Habermeier 2016-12-27 13:54:51 +01:00
parent 55dbfbf35b
commit 9b4f90718f
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,7 @@ use util::{Bytes, Mutex, RwLock, U256};
use time::{Duration, SteadyTime};
use std::collections::HashMap;
use std::fmt;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
@ -122,6 +123,12 @@ mod timeout {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ReqId(usize);
impl fmt::Display for ReqId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Request #{}", self.0)
}
}
// A pending peer: one we've sent our status to but
// may not have received one for.
struct PendingPeer {