pub enum State {
Idle,
Running,
Terminated,
Error,
Offline,
}Expand description
Current state of the application.
This is a high-level state indicating what’s the status of the underlying
syncs. The application starts in State::Running mode, and then hits a
terminal state State::Terminated (if it gracefully exited) or
State::Error (in case any of the underlying syncs ran into an error).
This can be observed with SyncService::state.
Variants§
Idle
The service hasn’t ever been started yet, or has been stopped.
Running
The underlying syncs are properly running in the background.
Terminated
Any of the underlying syncs has terminated gracefully (i.e. be stopped).
Error
Any of the underlying syncs has ran into an error.
Offline
The service has entered offline mode. This state will only be entered if
the SyncService has been built with the
SyncServiceBuilder::with_offline_mode setting.
The SyncService will enter the offline mode if syncing with the
server fails, it will then periodically check if the server is
available using the /_matrix/client/versions endpoint.
Once the SyncService receives a 200 response from the
/_matrix/client/versions endpoint, it will go back into the
State::Running mode and attempt to sync again.
Calling SyncService::start() while in this state will abort the
/_matrix/client/versions checks and attempt to sync immediately.
Calling SyncService::stop() will abort the offline mode and the
SyncService will go into the State::Idle mode.
Trait Implementations§
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more