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<(), LeverDroppedWhileLowered>
pub async fn raised(&mut self) -> Result<(), LeverDroppedWhileLowered>
Wait until the gate is raised
(by a call to Lever::raise
)
§Errors
If the lever is dropped while the gate is lowered, an Err
is returned.
Sourcepub async fn lowered(&mut self) -> Result<(), LeverDroppedWhileRaised>
pub async fn lowered(&mut self) -> Result<(), LeverDroppedWhileRaised>
Wait until the gate is lowered
(by a call to Lever::lower
)
§Errors
If the lever is dropped while the gate is raised, an Err
is returned.
Sourcepub fn lever_was_dropped(&self) -> bool
pub fn lever_was_dropped(&self) -> bool
Returns true
if the lever associated with this gate has been dropped
and false
if it hasn’t.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gate
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