pub struct SingleWaiterNotify { /* private fields */ }Expand description
Lightweight single-waiter notifier optimized for SPSC pattern
Much lighter than tokio::sync::Notify:
- No waitlist allocation (just AtomicWaker + one atomic state)
- Reuses common AtomicWaker implementation (no Box allocation)
- Faster creation and notification
- Handles notification-before-wait correctly
为 SPSC 模式优化的轻量级单等待者通知器
比 tokio::sync::Notify 更轻量:
- 无需等待列表分配(仅 AtomicWaker + 一个原子状态)
- 复用通用的 AtomicWaker 实现(无 Box 分配)
- 更快的创建和通知速度
- 正确处理通知先于等待的情况
Implementations§
Source§impl SingleWaiterNotify
impl SingleWaiterNotify
Auto Trait Implementations§
impl !Freeze for SingleWaiterNotify
impl !RefUnwindSafe for SingleWaiterNotify
impl Send for SingleWaiterNotify
impl Sync for SingleWaiterNotify
impl Unpin for SingleWaiterNotify
impl UnwindSafe for SingleWaiterNotify
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