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
28
29
30
31
32
33
34
use async_trait::async_trait;
use std::io;

mod mapped;
pub use mapped::*;

mod mpsc;
pub use mpsc::*;

mod oneshot;
pub use oneshot::*;

mod tcp;
pub use tcp::*;

#[cfg(unix)]
mod unix;

#[cfg(unix)]
pub use unix::*;

#[cfg(windows)]
mod windows;

#[cfg(windows)]
pub use windows::*;

/// Represents a type that has a listen interface for receiving raw streams
#[async_trait]
pub trait Listener: Send + Sync {
    type Output;

    async fn accept(&mut self) -> io::Result<Self::Output>;
}