referrerpolicy=no-referrer-when-downgrade
sc_rpc_api::statement

Trait StatementApiServer

Source
pub trait StatementApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn dump(&self, ext: &Extensions) -> RpcResult<Vec<Bytes>>;
    fn broadcasts(
        &self,
        match_all_topics: Vec<[u8; 32]>,
    ) -> RpcResult<Vec<Bytes>>;
    fn posted(
        &self,
        match_all_topics: Vec<[u8; 32]>,
        dest: [u8; 32],
    ) -> RpcResult<Vec<Bytes>>;
    fn posted_clear(
        &self,
        match_all_topics: Vec<[u8; 32]>,
        dest: [u8; 32],
    ) -> RpcResult<Vec<Bytes>>;
    fn broadcasts_stmt(
        &self,
        match_all_topics: Vec<[u8; 32]>,
    ) -> RpcResult<Vec<Bytes>>;
    fn posted_stmt(
        &self,
        match_all_topics: Vec<[u8; 32]>,
        dest: [u8; 32],
    ) -> RpcResult<Vec<Bytes>>;
    fn posted_clear_stmt(
        &self,
        match_all_topics: Vec<[u8; 32]>,
        dest: [u8; 32],
    ) -> RpcResult<Vec<Bytes>>;
    fn submit(&self, encoded: Bytes) -> RpcResult<()>;
    fn remove(&self, statement_hash: [u8; 32]) -> RpcResult<()>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the StatementApi RPC API.

Required Methods§

Source

fn dump(&self, ext: &Extensions) -> RpcResult<Vec<Bytes>>

Return all statements, SCALE-encoded.

Source

fn broadcasts(&self, match_all_topics: Vec<[u8; 32]>) -> RpcResult<Vec<Bytes>>

Return the data of all known statements which include all topics and have no DecryptionKey field.

To get the statement, and not just the data, use statement_broadcastsStatement.

Source

fn posted( &self, match_all_topics: Vec<[u8; 32]>, dest: [u8; 32], ) -> RpcResult<Vec<Bytes>>

Return the data of all known statements whose decryption key is identified as dest (this will generally be the public key or a hash thereof for symmetric ciphers, or a hash of the private key for symmetric ciphers).

To get the statement, and not just the data, use statement_postedStatement.

Source

fn posted_clear( &self, match_all_topics: Vec<[u8; 32]>, dest: [u8; 32], ) -> RpcResult<Vec<Bytes>>

Return the decrypted data of all known statements whose decryption key is identified as dest. The key must be available to the client.

To get the statement, and not just the data, use statement_postedClearStatement.

Source

fn broadcasts_stmt( &self, match_all_topics: Vec<[u8; 32]>, ) -> RpcResult<Vec<Bytes>>

Return all known statements which include all topics and have no DecryptionKey field.

This returns the SCALE-encoded statements not just the data as in rpc statement_broadcasts.

Source

fn posted_stmt( &self, match_all_topics: Vec<[u8; 32]>, dest: [u8; 32], ) -> RpcResult<Vec<Bytes>>

Return all known statements whose decryption key is identified as dest (this will generally be the public key or a hash thereof for symmetric ciphers, or a hash of the private key for symmetric ciphers).

This returns the SCALE-encoded statements not just the data as in rpc statement_posted.

Source

fn posted_clear_stmt( &self, match_all_topics: Vec<[u8; 32]>, dest: [u8; 32], ) -> RpcResult<Vec<Bytes>>

Return the statement and the decrypted data of all known statements whose decryption key is identified as dest. The key must be available to the client.

This returns for each statement: the SCALE-encoded statement concatenated to the decrypted data. Not just the data as in rpc statement_postedClear.

Source

fn submit(&self, encoded: Bytes) -> RpcResult<()>

Submit a pre-encoded statement.

Source

fn remove(&self, statement_hash: [u8; 32]) -> RpcResult<()>

Remove a statement from the store.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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.

Implementors§