pub struct AtomicGate(/* private fields */);Expand description
A shared atomic gate. Construct via AtomicGate::pair to get the gate
(handed to the pipe) plus an AtomicGateController (kept by the caller to
arm/disarm after the gate has been moved into the pipe).
Implementations§
Source§impl AtomicGate
impl AtomicGate
Sourcepub fn pair(initial_armed: bool) -> (Self, AtomicGateController)
pub fn pair(initial_armed: bool) -> (Self, AtomicGateController)
A gate and its controller, sharing one atomic. The gate moves into the
Demand wrapper; the controller stays with the caller to signal demand.
Trait Implementations§
Source§impl DemandGate for AtomicGate
impl DemandGate for AtomicGate
Source§fn on_close(&self)
fn on_close(&self)
Called when the gate transitions armed→disarmed. Default no-op; a gate
that fronts a
crate::pipe::BoundedQueue overrides this to drain the queue
and avoid losing items buffered during the coming dormancy.Auto Trait Implementations§
impl Freeze for AtomicGate
impl RefUnwindSafe for AtomicGate
impl Send for AtomicGate
impl Sync for AtomicGate
impl Unpin for AtomicGate
impl UnsafeUnpin for AtomicGate
impl UnwindSafe for AtomicGate
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