aboutsummaryrefslogtreecommitdiff
path: root/karyons_p2p/src/net/mod.rs
blob: 9cdc74859ccad1967b2e8ffe215a1d9a6921ab3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
mod connection_queue;
mod connector;
mod listener;
mod slots;

pub use connection_queue::ConnQueue;
pub use connector::Connector;
pub use listener::Listener;
pub use slots::ConnectionSlots;

use std::fmt;

/// Defines the direction of a network connection.
#[derive(Clone, Debug)]
pub enum ConnDirection {
    Inbound,
    Outbound,
}

impl fmt::Display for ConnDirection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match self {
            ConnDirection::Inbound => write!(f, "Inbound"),
            ConnDirection::Outbound => write!(f, "Outbound"),
        }
    }
}