pub struct ChainInstance {
pub config: IndexerConfig,
pub state: IndexerState,
pub head_block: u64,
pub events_processed: u64,
pub last_error: Option<String>,
pub started_at: Option<i64>,
}Expand description
Runtime state for a single chain managed by the coordinator.
Fields§
§config: IndexerConfigThe configuration driving this chain.
state: IndexerStateCurrent runtime state of this chain’s indexer.
head_block: u64Latest block number that has been fully processed.
events_processed: u64Total number of events emitted so far by this chain.
last_error: Option<String>The last error message if state == IndexerState::Error.
started_at: Option<i64>Unix timestamp (seconds) when the chain was started, if it has been.
Implementations§
Source§impl ChainInstance
impl ChainInstance
Sourcepub fn new(config: IndexerConfig) -> Self
pub fn new(config: IndexerConfig) -> Self
Construct a new idle instance from a config.
Sourcepub fn transition(&mut self, new_state: IndexerState, error: Option<String>)
pub fn transition(&mut self, new_state: IndexerState, error: Option<String>)
Transition to a new state, recording errors if appropriate.
Trait Implementations§
Source§impl Clone for ChainInstance
impl Clone for ChainInstance
Source§fn clone(&self) -> ChainInstance
fn clone(&self) -> ChainInstance
Returns a duplicate 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 moreSource§impl Debug for ChainInstance
impl Debug for ChainInstance
Source§impl<'de> Deserialize<'de> for ChainInstance
impl<'de> Deserialize<'de> for ChainInstance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChainInstance
impl RefUnwindSafe for ChainInstance
impl Send for ChainInstance
impl Sync for ChainInstance
impl Unpin for ChainInstance
impl UnsafeUnpin for ChainInstance
impl UnwindSafe for ChainInstance
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