Struct async_gate::Gate
source · pub struct Gate { /* private fields */ }Expand description
A gate that can be checked if [is_raised] or [is_lowered] immediately,
or can be waited on to be [raised] or [lowered].
Implementations§
source§impl Gate
impl Gate
sourcepub fn is_raised(&self) -> bool
pub fn is_raised(&self) -> bool
Returns true if the gate (even if the lever has been dropped) is raised and false if it’s lowered.
sourcepub fn is_lowered(&self) -> bool
pub fn is_lowered(&self) -> bool
Returns true if the gate (even if the lever has been dropped) is lowered and false if it’s raised.
sourcepub async fn raised(&mut self) -> Result<(), LeverDropped>
pub async fn raised(&mut self) -> Result<(), LeverDropped>
Wait until the gate is raised
(by a call to Lever::raise)
sourcepub async fn lowered(&mut self) -> Result<(), LeverDropped>
pub async fn lowered(&mut self) -> Result<(), LeverDropped>
Wait until the gate is lowered
(by a call to Lever::lower)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl !UnwindSafe for Gate
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