pub struct StateWatcher(/* private fields */);
Expand description
The wrapper around the watch::Receiver<State>
. It repeats the Receiver
functionality +
a new one.
Implementations§
Source§impl StateWatcher
impl StateWatcher
Source§impl StateWatcher
impl StateWatcher
Sourcepub async fn while_started(&mut self) -> Result<State>
pub async fn while_started(&mut self) -> Result<State>
Infinity loop while the state is State::Started
. Returns the next received state.
Sourcepub async fn wait_stopping_or_stopped(&mut self) -> Result<()>
pub async fn wait_stopping_or_stopped(&mut self) -> Result<()>
Future that resolves once the state is State::Stopped
.
Trait Implementations§
Source§impl Clone for StateWatcher
impl Clone for StateWatcher
Source§fn clone(&self) -> StateWatcher
fn clone(&self) -> StateWatcher
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for StateWatcher
impl !RefUnwindSafe for StateWatcher
impl Send for StateWatcher
impl Sync for StateWatcher
impl Unpin for StateWatcher
impl !UnwindSafe for StateWatcher
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