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

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

Re-export the API for backward compatibility. Server trait implementation for the StatementApi RPC API.

Required Methods§

source

fn dump(&self) -> Result<Vec<Bytes, Global>, Error>

Return all statements, SCALE-encoded.

source

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

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

source

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

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).

source

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

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

source

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

Submit a pre-encoded statement.

source

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

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.

Implementors§