pub trait MessagePipe<T>: Sized {
    // Required methods
    fn new() -> (Self, Self);
    fn send(&mut self, value: T);
    fn recv(&mut self) -> Option<T>;
}
🔬This is a nightly-only experimental API. (proc_macro_internals #27812)
Expand description

A message pipe used for communicating between server and client threads.

Required Methods§

source

fn new() -> (Self, Self)

🔬This is a nightly-only experimental API. (proc_macro_internals #27812)

Create a new pair of endpoints for the message pipe.

source

fn send(&mut self, value: T)

🔬This is a nightly-only experimental API. (proc_macro_internals #27812)

Send a message to the other endpoint of this pipe.

source

fn recv(&mut self) -> Option<T>

🔬This is a nightly-only experimental API. (proc_macro_internals #27812)

Receive a message from the other endpoint of this pipe.

Returns None if the other end of the pipe has been destroyed, and no message was received.

Implementors§