Trait sp_statement_store::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 submit(
&self,
statement: Statement,
source: StatementSource,
) -> SubmitResult;
fn remove(&self, hash: &Hash) -> Result<()>;
}
Expand description
Statement store API.
Required Methods§
sourcefn broadcasts(&self, match_all_topics: &[Topic]) -> Result<Vec<Vec<u8>>>
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.
sourcefn posted(
&self,
match_all_topics: &[Topic],
dest: [u8; 32],
) -> Result<Vec<Vec<u8>>>
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).
sourcefn posted_clear(
&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>>>
Return the decrypted data of all known statements whose decryption key is identified as
dest
. The key must be available to the client.
sourcefn submit(&self, statement: Statement, source: StatementSource) -> SubmitResult
fn submit(&self, statement: Statement, source: StatementSource) -> SubmitResult
Submit a statement.