Skip to main content

MpscQueueEntry

Struct MpscQueueEntry 

pub struct MpscQueueEntry { /* private fields */ }
Expand description

供cordyceps多生产者单消费者队列(MPSC queue)持有的不透明节点(opaque node)。

业务节点(node)按创建选项嵌入原任务存储(task allocation),不能由调用者直接构造。 通过MpscEntryHandle转交唯一持有,不复制任务(Task)或移动原异步计算(Future)。 地址一旦交给原生容器(container),须保持到它安全归还;不能同时放入其它队列(queue)。 本类型(type)不提供轮询(poll)、取消(cancellation)或原值访问权限。 没有可变字段(field)出口,不承诺内存布局(memory layout)、Sync或Unpin。

Trait Implementations§

§

impl Linked<Links<MpscQueueEntry>> for MpscQueueEntry

§

unsafe fn from_ptr(pointer: NonNull<Self>) -> Self::Handle

§安全(Safety)

pointer须来自对应into_ptr的唯一持有,仍存活、地址未变且尚未恢复; 调用者须有恢复持有的权限,不能在原生容器(container)仍保管时重复恢复。

§安全(Safety)

pointer须指向合法仍存活的本类型(type),满足Linked要求的持有及固定地址前提。

§

type Handle = MpscEntryHandle

The handle owning nodes in the linked list. Read more
§

fn into_ptr(handle: Self::Handle) -> NonNull<Self>

Convert a Self::Handle to a raw pointer to Self, taking ownership of it in the process.

Auto Trait Implementations§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.