Struct tokio::sync::mpsc::list::Tx

source ·
pub(crate) struct Tx<T> {
    block_tail: AtomicPtr<Block<T>>,
    tail_position: AtomicUsize,
}
Expand description

List queue transmit handle.

Fields§

§block_tail: AtomicPtr<Block<T>>

Tail in the Block mpmc list.

§tail_position: AtomicUsize

Position to push the next message. This references a block and offset into the block.

Implementations§

source§

impl<T> Tx<T>

source

pub(crate) fn push(&self, value: T)

Pushes a value into the list.

source

pub(crate) fn close(&self)

Closes the send half of the list.

Similar process as pushing a value, but instead of writing the value & setting the ready flag, the TX_CLOSED flag is set on the block.

source

fn find_block(&self, slot_index: usize) -> NonNull<Block<T>>

source

pub(crate) unsafe fn reclaim_block(&self, block: NonNull<Block<T>>)

source

pub(crate) fn is_closed(&self) -> bool

Trait Implementations§

source§

impl<T> Debug for Tx<T>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for Tx<T>

§

impl<T> RefUnwindSafe for Tx<T>

§

impl<T> Send for Tx<T>

§

impl<T> Sync for Tx<T>

§

impl<T> Unpin for Tx<T>

§

impl<T> !UnwindSafe for Tx<T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.