Skip to main content

NodeExt

Trait NodeExt 

Source
pub trait NodeExt: Node {
    // Provided methods
    fn query_service(
        &self,
        head: HeaderHash,
        id: ServiceId,
    ) -> impl Future<Output = Result<(Service, CodeInfo<CrateInfo>), Error>> + Send { ... }
    fn wait_for_sync(&self) -> impl Future<Output = Result<(), Error>> + Send { ... }
    fn lookup_anchor_block(
        &self,
    ) -> impl Future<Output = Result<BlockDesc, NodeError>> + Send { ... }
    fn create_refine_context(
        &self,
    ) -> impl Future<Output = Result<(RefineContext, Slot), NodeError>> + Send { ... }
}

Provided Methods§

Source

fn query_service( &self, head: HeaderHash, id: ServiceId, ) -> impl Future<Output = Result<(Service, CodeInfo<CrateInfo>), Error>> + Send

Source

fn wait_for_sync(&self) -> impl Future<Output = Result<(), Error>> + Send

Source

fn lookup_anchor_block( &self, ) -> impl Future<Output = Result<BlockDesc, NodeError>> + Send

Returns lookup anchor block description.

This is the parent of the finalized block.

Source

fn create_refine_context( &self, ) -> impl Future<Output = Result<(RefineContext, Slot), NodeError>> + Send

Create refine context from the current chain’s best block.

  • Best block’s parent is used as an anchor.
  • Finalized block is used as a lookup anchor.

Returns the resulting refine context and anchor slot.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Node + ?Sized> NodeExt for T