Trait MessagePipe

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

Creates 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§