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

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

Accept an incoming connection from another process wanting to connect.


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