pub trait Api:
Send
+ Sync
+ 'static {
type BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static;
// Required methods
fn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<ValidatorStatus>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_block<'life0, 'async_trait>(
&'life0 self,
request: Request<ProposedBlock>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignBlockResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Generated trait containing gRPC methods that should be implemented for use with ApiServer.
Required Associated Types§
Sourcetype BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static
type BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static
Server streaming response type for the BlockSubscription method.
Required Methods§
Sourcefn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<ValidatorStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<ValidatorStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the status info of the validator.
Sourcefn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits a transaction to the validator.
Sourcefn sign_block<'life0, 'async_trait>(
&'life0 self,
request: Request<ProposedBlock>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignBlockResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_block<'life0, 'async_trait>(
&'life0 self,
request: Request<ProposedBlock>,
) -> Pin<Box<dyn Future<Output = Result<Response<SignBlockResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validates and signs a proposed block, returning the signature and the signed block commitment.
Sourcefn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streams signed blocks starting from the given block number (inclusive).
Replays backed-up blocks first, then streams live blocks as they are signed. Unlike the RPC block subscription, the blocks streamed here carry no proofs; they must be commissioned separately as part of recovery.
Sourcefn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the public key that clients use to encrypt the private inputs of the transactions they submit, attested by this validator’s own signing key.
The encryption key is shared across the whole validator set, so the returned public key is identical regardless of which validator serves the request. The attestation carried in the response is specific to this validator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".