1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
/// Used to identify which `Evented` value is associated with an `Event`
/// notification returned by `Poll`.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Token(pub usize);

impl From<usize> for Token {
    fn from(val: usize) -> Token {
        Token(val)
    }
}

impl From<Token> for usize {
    fn from(val: Token) -> usize {
        val.0
    }
}