Struct fuel_core_relayer::SharedState
source · pub struct SharedState<D> { /* private fields */ }
Expand description
The shared state of the relayer task.
Implementations§
sourcepub async fn await_synced(&self) -> Result<()>
pub async fn await_synced(&self) -> Result<()>
Wait for the [Task
] to be in sync with
the data availability layer.
Yields until the relayer reaches a point where it considered up to date. Note that there’s no guarantee the relayer will ever catch up to the da layer and may fall behind immediately after this future completes.
The only guarantee is that if this future completes then the relayer did reach consistency with the da layer for some period of time.
sourcepub async fn await_at_least_synced(&self, height: &DaBlockHeight) -> Result<()>
pub async fn await_at_least_synced(&self, height: &DaBlockHeight) -> Result<()>
Wait until at least the given height is synced.
sourcepub fn get_message(
&self,
id: &MessageId,
da_height: &DaBlockHeight
) -> Result<Option<CompressedMessage>>where
D: StorageInspect<Messages, Error = Error>,
pub fn get_message( &self, id: &MessageId, da_height: &DaBlockHeight ) -> Result<Option<CompressedMessage>>where D: StorageInspect<Messages, Error = Error>,
Get a message if it has been synced and is <= the given height.
sourcepub fn get_finalized_da_height(&self) -> Result<DaBlockHeight>where
D: RelayerDb + 'static,
pub fn get_finalized_da_height(&self) -> Result<DaBlockHeight>where D: RelayerDb + 'static,
Get finalized da height that represents last block from da layer that got finalized. Panics if height is not set as of initialization of the relayer.
Trait Implementations§
source§fn clone(&self) -> SharedState<D>
fn clone(&self) -> SharedState<D>
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§
Blanket Implementations§
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more