pub enum SyncStatus {
AwaitingPeers,
NoSync,
EpochSync {
epoch_ord: u64,
},
HeaderSync {
start_height: BlockHeight,
current_height: BlockHeight,
highest_height: BlockHeight,
},
StateSync(StateSyncStatus),
StateSyncDone,
BlockSync {
start_height: BlockHeight,
current_height: BlockHeight,
highest_height: BlockHeight,
},
}Expand description
Various status sync can be in, whether it’s fast sync or archival.
Variants§
AwaitingPeers
Initial state. Not enough peers to do anything yet.
NoSync
Not syncing / Done syncing.
EpochSync
Syncing using light-client headers to a recent epoch
HeaderSync
Downloading block headers for fast sync.
Fields
start_height: BlockHeightHead height at the beginning. Not the header head height! Used only for reporting the progress of the sync.
current_height: BlockHeightCurrent header head height.
highest_height: BlockHeightHighest height of our peers.
StateSync(StateSyncStatus)
State sync, with different states of state sync for different shards.
StateSyncDone
Sync state across all shards is done.
BlockSync
Download and process blocks until the head reaches the head of the network.
Fields
start_height: BlockHeightHeader head height at the beginning. Used only for reporting the progress of the sync.
current_height: BlockHeightCurrent head height.
highest_height: BlockHeightHighest height of our peers.
Implementations§
Source§impl SyncStatus
impl SyncStatus
Sourcepub fn as_variant_name(&self) -> &str
pub fn as_variant_name(&self) -> &str
Get a string representation of the status variant
Sourcepub fn is_syncing(&self) -> bool
pub fn is_syncing(&self) -> bool
True if currently engaged in syncing the chain.
pub fn repr(&self) -> u8
pub fn start_height(&self) -> Option<BlockHeight>
pub fn update(&mut self, new_value: Self)
Trait Implementations§
Source§impl AsRef<str> for SyncStatus
impl AsRef<str> for SyncStatus
Source§impl Clone for SyncStatus
impl Clone for SyncStatus
Source§fn clone(&self) -> SyncStatus
fn clone(&self) -> SyncStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SyncStatus
impl Debug for SyncStatus
Source§impl From<SyncStatus> for SyncStatusView
impl From<SyncStatus> for SyncStatusView
Source§fn from(status: SyncStatus) -> Self
fn from(status: SyncStatus) -> Self
Auto Trait Implementations§
impl Freeze for SyncStatus
impl RefUnwindSafe for SyncStatus
impl Send for SyncStatus
impl Sync for SyncStatus
impl Unpin for SyncStatus
impl UnwindSafe for SyncStatus
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<S> AsComponentExternName for S
impl<S> AsComponentExternName for S
Source§fn as_component_extern_name(&self) -> ComponentExternName<'_>
fn as_component_extern_name(&self) -> ComponentExternName<'_>
ComponentExternName.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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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