Struct fuel_core_services::StateWatcher
source · 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