Skip to main content

ApiContext

Trait ApiContext 

Source
pub trait ApiContext:
    Send
    + Sync
    + 'static {
    // Required methods
    fn consensus(&self) -> Arc<dyn ConsensusSource> ⓘ;
    fn membership(&self) -> Arc<dyn MembershipPersistence> ⓘ;
    fn state_certs(&self) -> Arc<dyn StateCertPersistence> ⓘ;
    fn node_state(&self) -> NodeState;
    fn network_config(&self) -> NetworkConfig<SeqTypes>;
    fn validator_config(&self) -> Option<&ValidatorConfig<SeqTypes>>;
    fn state_signatures(&self) -> Option<Arc<RwLock<StateSignatureMemStorage>>>;
    fn light_client(&self) -> Option<Arc<NodeLightClient>>;
    fn request_vid_shares(
        &self,
        block_number: u64,
        vid_common: VidCommonQueryData<SeqTypes>,
        timeout: Duration,
    ) -> BoxFuture<'static, Result<Vec<VidShare>>>;
    fn with_task_list(self, tasks: TaskList) -> Self
       where Self: Sized;
}

Required Methods§

Source

fn consensus(&self) -> Arc<dyn ConsensusSource> ⓘ

Source

fn membership(&self) -> Arc<dyn MembershipPersistence> ⓘ

Source

fn state_certs(&self) -> Arc<dyn StateCertPersistence> ⓘ

Source

fn node_state(&self) -> NodeState

Source

fn network_config(&self) -> NetworkConfig<SeqTypes>

Source

fn validator_config(&self) -> Option<&ValidatorConfig<SeqTypes>>

Source

fn state_signatures(&self) -> Option<Arc<RwLock<StateSignatureMemStorage>>>

Source

fn light_client(&self) -> Option<Arc<NodeLightClient>>

A light client the node already runs, for the query service to fetch through.

Source

fn request_vid_shares( &self, block_number: u64, vid_common: VidCommonQueryData<SeqTypes>, timeout: Duration, ) -> BoxFuture<'static, Result<Vec<VidShare>>>

Source

fn with_task_list(self, tasks: TaskList) -> Self
where Self: Sized,

Options::serve hands a clone of the context to the API before calling this, so the tasks attached here must be shared with that clone: TaskList is that shared handle, and dropping any clone of it aborts every task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§