referrerpolicy=no-referrer-when-downgrade
sp_statement_store

Trait StatementStore

Source
pub trait StatementStore: Send + Sync {
    // Required methods
    fn statements(&self) -> Result<Vec<(Hash, Statement)>>;
    fn statement(&self, hash: &Hash) -> Result<Option<Statement>>;
    fn broadcasts(&self, match_all_topics: &[Topic]) -> Result<Vec<Vec<u8>>>;
    fn posted(
        &self,
        match_all_topics: &[Topic],
        dest: [u8; 32],
    ) -> Result<Vec<Vec<u8>>>;
    fn posted_clear(
        &self,
        match_all_topics: &[Topic],
        dest: [u8; 32],
    ) -> Result<Vec<Vec<u8>>>;
    fn broadcasts_stmt(
        &self,
        match_all_topics: &[Topic],
    ) -> Result<Vec<Vec<u8>>>;
    fn posted_stmt(
        &self,
        match_all_topics: &[Topic],
        dest: [u8; 32],
    ) -> Result<Vec<Vec<u8>>>;
    fn posted_clear_stmt(
        &self,
        match_all_topics: &[Topic],
        dest: [u8; 32],
    ) -> Result<Vec<Vec<u8>>>;
    fn submit(
        &self,
        statement: Statement,
        source: StatementSource,
    ) -> SubmitResult;
    fn remove(&self, hash: &Hash) -> Result<()>;
}
Expand description

Statement store API.

Required Methods§

Source

fn statements(&self) -> Result<Vec<(Hash, Statement)>>

Return all statements.

Source

fn statement(&self, hash: &Hash) -> Result<Option<Statement>>

Get statement by hash.

Source

fn broadcasts(&self, match_all_topics: &[Topic]) -> Result<Vec<Vec<u8>>>

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

Source

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

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: &[Topic], dest: [u8; 32], ) -> Result<Vec<Vec<u8>>>

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 broadcasts_stmt(&self, match_all_topics: &[Topic]) -> Result<Vec<Vec<u8>>>

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

Source

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

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

Source

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

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.

The result is for each statement: the SCALE-encoded statement concatenated to the decrypted data.

Source

fn submit(&self, statement: Statement, source: StatementSource) -> SubmitResult

Submit a statement.

Source

fn remove(&self, hash: &Hash) -> Result<()>

Remove a statement from the store.

Implementors§