Struct Packet

pub(in ::sync::mpmc::zero) struct Packet<T> { pub(in ::sync::mpmc::zero) on_stack: bool, pub(in ::sync::mpmc::zero) ready: Atomic<bool>, pub(in ::sync::mpmc::zero) msg: UnsafeCell<Option<T>> }

A slot for passing one message from a sender to a receiver.

Fields

on_stack: bool

Equals true if the packet is allocated on the stack.

ready: Atomic<bool>

Equals true once the packet is ready for reading or writing.

msg: UnsafeCell<Option<T>>

The message.

Implementations

impl<T> Packet<T>

fn empty_on_stack() -> Packet<T>

Creates an empty packet on the stack.

fn message_on_stack(msg: T) -> Packet<T>

Creates a packet on the stack, containing a message.

fn wait_ready(&self)

Waits until the packet becomes ready for reading or writing.

Auto Trait Implementations

impl<T> !Freeze for Packet<T>

impl<T> !RefUnwindSafe for Packet<T>

impl<T> !Sync for Packet<T>

impl<T> Send for Packet<T> where UnsafeCell<Option<T>>: Send,

impl<T> Unpin for Packet<T> where UnsafeCell<Option<T>>: Unpin,

impl<T> UnsafeUnpin for Packet<T> where UnsafeCell<Option<T>>: UnsafeUnpin,

impl<T> UnwindSafe for Packet<T> where UnsafeCell<Option<T>>: UnwindSafe,

Blanket Implementations

impl<T> Any for Packet<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Packet<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Packet<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Packet<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for Packet<T> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for Packet<T>

impl<T, U> Into<U> for Packet<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Packet<T> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for Packet<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>