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§
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>>>
Sourcefn light_client(&self) -> Option<Arc<NodeLightClient>>
fn light_client(&self) -> Option<Arc<NodeLightClient>>
A light client the node already runs, for the query service to fetch through.
Sourcefn with_task_list(self, tasks: TaskList) -> Selfwhere
Self: Sized,
fn with_task_list(self, tasks: TaskList) -> Selfwhere
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".