pub struct StateNodeAdapterStdImpl { /* private fields */ }Implementations§
Source§impl StateNodeAdapterStdImpl
impl StateNodeAdapterStdImpl
pub fn new( listener: Arc<dyn StateNodeEventListener>, storage: CoreStorage, initial_sync_context: CollatorSyncContext, zerostate_id: ZerostateId, ) -> Self
Trait Implementations§
Source§impl StateNodeAdapter for StateNodeAdapterStdImpl
impl StateNodeAdapter for StateNodeAdapterStdImpl
Source§fn load_last_applied_mc_block_id(&self) -> Result<BlockId>
fn load_last_applied_mc_block_id(&self) -> Result<BlockId>
Return id of last master block that was applied to node local state
Source§fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
ref_by_mc_seqno: u32,
block_id: &'life1 BlockId,
hint: LoadStateHint,
) -> Pin<Box<dyn Future<Output = Result<ShardStateStuff>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
ref_by_mc_seqno: u32,
block_id: &'life1 BlockId,
hint: LoadStateHint,
) -> Pin<Box<dyn Future<Output = Result<ShardStateStuff>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return master or shard state on specified block from node local state
Source§fn begin_store_next_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prev_block_id: &'life1 BlockId,
block_id: &'life2 BlockId,
meta: NewBlockMeta,
merkle_update: &'life3 MerkleUpdate,
state: ShardStateStuff,
hint: StoreStateHint,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn InitiatedStoreState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn begin_store_next_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prev_block_id: &'life1 BlockId,
block_id: &'life2 BlockId,
meta: NewBlockMeta,
merkle_update: &'life3 MerkleUpdate,
state: ShardStateStuff,
hint: StoreStateHint,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn InitiatedStoreState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store shard state root in the storage.
Returns
true when state was updated in storage.Source§fn load_block<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_block<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return block by its id from node local state
Source§fn load_block_by_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 BlockHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_block_by_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 BlockHandle,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return block by its handle from node local state
Source§fn load_block_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockHandle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_block_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockHandle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return block handle by its id from node local state
Source§fn get_ref_by_mc_seqno<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockSeqno>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_ref_by_mc_seqno<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<BlockSeqno>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return
ref_by_mc_seqno from block handle by its id from node local stateSource§fn accept_block(&self, block: Arc<BlockStuffForSync>) -> Result<()>
fn accept_block(&self, block: Arc<BlockStuffForSync>) -> Result<()>
Accept block: Read more
Source§fn fill_shard_blocks_cache(
&self,
ref_by_mc_seqno: u32,
block: BlockStuff,
) -> Result<()>
fn fill_shard_blocks_cache( &self, ref_by_mc_seqno: u32, block: BlockStuff, ) -> Result<()>
Fill the shard blocks cache is used for building new states by applying Merkle updates
Source§fn wait_for_block<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Option<Result<BlockStuffAug>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_block<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Option<Result<BlockStuffAug>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Waits for the specified block to be received and returns it
Source§fn wait_for_block_next<'life0, 'life1, 'async_trait>(
&'life0 self,
prev_block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Option<Result<BlockStuffAug>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_block_next<'life0, 'life1, 'async_trait>(
&'life0 self,
prev_block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Option<Result<BlockStuffAug>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Waits for the specified block by
prev_id to be received and returns itSource§fn handle_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
mc_block_id: &'life1 BlockId,
state: &'life2 ShardStateStuff,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
mc_block_id: &'life1 BlockId,
state: &'life2 ShardStateStuff,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle state after block was applied
Source§fn load_diff<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<QueueDiffStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_diff<'life0, 'life1, 'async_trait>(
&'life0 self,
block_id: &'life1 BlockId,
) -> Pin<Box<dyn Future<Output = Result<Option<QueueDiffStuff>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load queue diff
Source§fn set_sync_context(&self, sync_context: CollatorSyncContext)
fn set_sync_context(&self, sync_context: CollatorSyncContext)
Handle sync context update
fn load_init_block_id(&self) -> Option<BlockId>
fn zerostate_id(&self) -> &ZerostateId
fn shard_split_depth(&self) -> u8
Auto Trait Implementations§
impl Freeze for StateNodeAdapterStdImpl
impl !RefUnwindSafe for StateNodeAdapterStdImpl
impl Send for StateNodeAdapterStdImpl
impl Sync for StateNodeAdapterStdImpl
impl Unpin for StateNodeAdapterStdImpl
impl UnsafeUnpin for StateNodeAdapterStdImpl
impl !UnwindSafe for StateNodeAdapterStdImpl
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
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>
Converts
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>
Converts
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