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 one atomic pointer + one atomic state)
- Direct waker management (no intermediate state machine)
- Faster creation and notification
- Handles notification-before-wait correctly
为 SPSC 模式优化的轻量级单等待者通知器
比 tokio::sync::Notify 更轻量:
- 无需等待列表分配(仅一个原子指针 + 一个原子状态)
- 直接管理 waker(无复杂状态机)
- 更快的创建和通知速度
- 正确处理通知先于等待的情况
Implementations§
Source§impl SingleWaiterNotify
impl SingleWaiterNotify
Trait Implementations§
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