Function hadean::hadean::connect[][src]

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

Connect with another process that is ready to accept incoming connections.


  • pid - identifier of the process we are interested in connecting with


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::connect(pid).await.unwrap();
let (mut sender, mut receiver): (Sender<String>, Receiver<String>)
    = (sender.into(), receiver.into());
let message =;
println!("received: {}", message);