You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
distant/distant-net/src/common/listener.rs

35 lines
491 B
Rust

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>;
}