Function hadean::hadean::accept[][src]

pub fn accept(
) -> Pin<Box<dyn Future<Output = Result<(UntypedSender, UntypedReceiver), HadeanError>> + Send>>
Expand description

Accept an incomming connection from some process wanting to connect with us.


If successful, the function returns UntypedSender and UntypedReceiver objects which can be used to exchange raw bytes between the processes.

Note: You may find it useful to convert the sender and receiver into typed equivalents i.e. Sender<T> and Receiver<T>


let (sender, receiver) = hadean::accept().await.unwrap();
let (mut sender, mut receiver): (Sender<String>, Receiver<String>)
    = (sender.into(), receiver.into());
let message =;
println!("received: {}", message);