pub struct Lever { /* private fields */ }Implementations§
Source§impl Lever
impl Lever
Sourcepub fn raise(&self) -> Result<(), GateDropped>
pub fn raise(&self) -> Result<(), GateDropped>
Raise the gate.
This wakes all tasks waiting on Gate::raised
(and later calls to it will resolve immediately until the gate is lowered).
§Errors
If the gate was dropped, an Err is returned.
Sourcepub fn lower(&self) -> Result<(), GateDropped>
pub fn lower(&self) -> Result<(), GateDropped>
Lower the gate.
This wakes all tasks waiting on Gate::lowered
(and later calls to it will resolve immediately until the gate is raised).
§Errors
If the gate was dropped, an Err is returned.
Sourcepub fn is_raised(&self) -> Result<bool, BeforeGateDropped>
pub fn is_raised(&self) -> Result<bool, BeforeGateDropped>
Returns Ok(true) if the gate is raised and Ok(false) if it’s lowered,
§Errors
If the gate was dropped and was raised before dropping, an Err(BeforeGateDropped(Raised)) is returned.
Likewise, if the gate was dropped and was lowered before dropping, an Err(BeforeGateDropped(Lowered)) is returned.
Sourcepub fn is_lowered(&self) -> Result<bool, BeforeGateDropped>
pub fn is_lowered(&self) -> Result<bool, BeforeGateDropped>
Returns Ok(true) if the gate is lowered and Ok(false) if it’s raised.
§Errors
If the gate was dropped and was lowered before dropping, an Err(BeforeGateDropped(Lowered)) is returned.
Likewise, if the gate was dropped and was raised before dropping, an Err(BeforeGateDropped(Raised)) .
Sourcepub fn gate_was_dropped(&self) -> bool
pub fn gate_was_dropped(&self) -> bool
Returns true if the gate associated with this lever has been dropped
and false if it hasn’t.