pub trait GrandpaApiServer<Notification, Hash, Number>:
Sized
+ Send
+ Sync
+ 'static {
// Required methods
fn round_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReportedRoundStates, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prove_finality<'life0, 'async_trait>(
&'life0 self,
block: Number,
) -> Pin<Box<dyn Future<Output = Result<Option<EncodedFinalityProof>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_justifications(
&self,
subscription_sink: PendingSubscriptionSink,
);
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where Notification: Send + Sync + 'static + Serialize,
Hash: Send + Sync + 'static,
Number: Send + Sync + 'static + DeserializeOwned { ... }
}
Expand description
Server trait implementation for the GrandpaApi
RPC API.
Required Methods§
Sourcefn round_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReportedRoundStates, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn round_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReportedRoundStates, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the state of the current best round state as well as the ongoing background rounds.
Sourcefn prove_finality<'life0, 'async_trait>(
&'life0 self,
block: Number,
) -> Pin<Box<dyn Future<Output = Result<Option<EncodedFinalityProof>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prove_finality<'life0, 'async_trait>(
&'life0 self,
block: Number,
) -> Pin<Box<dyn Future<Output = Result<Option<EncodedFinalityProof>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prove finality for the given block number by returning the Justification for the last block in the set and all the intermediary headers to link them together.
Sourcefn subscribe_justifications(&self, subscription_sink: PendingSubscriptionSink)
fn subscribe_justifications(&self, subscription_sink: PendingSubscriptionSink)
Returns the block most recently finalized by Grandpa, alongside side its justification.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.