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
impl Linked<Links<MpscQueueEntry>> for MpscQueueEntry
§unsafe fn from_ptr(pointer: NonNull<Self>) -> Self::Handle
unsafe fn from_ptr(pointer: NonNull<Self>) -> Self::Handle
§安全(Safety)
pointer须来自对应into_ptr的唯一持有,仍存活、地址未变且尚未恢复; 调用者须有恢复持有的权限,不能在原生容器(container)仍保管时重复恢复。
§unsafe fn links(pointer: NonNull<Self>) -> NonNull<Links<Self>>
unsafe fn links(pointer: NonNull<Self>) -> NonNull<Links<Self>>
§安全(Safety)
pointer须指向合法仍存活的本类型(type),满足Linked要求的持有及固定地址前提。
§type Handle = MpscEntryHandle
type Handle = MpscEntryHandle
The handle owning nodes in the linked list. Read more
§fn into_ptr(handle: Self::Handle) -> NonNull<Self>
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§
impl !Freeze for MpscQueueEntry
impl !RefUnwindSafe for MpscQueueEntry
impl !Sync for MpscQueueEntry
impl !Unpin for MpscQueueEntry
impl !UnsafeUnpin for MpscQueueEntry
impl !UnwindSafe for MpscQueueEntry
impl Forget for MpscQueueEntry
impl Move for MpscQueueEntry
impl Send for MpscQueueEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more