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§
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 broadcasts_stmt(&self, match_all_topics: &[Topic]) -> Result<Vec<Vec<u8>>>
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.
Sourcefn posted_stmt(
&self,
match_all_topics: &[Topic],
dest: [u8; 32],
) -> Result<Vec<Vec<u8>>>
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).
Sourcefn posted_clear_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>>>
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.
Sourcefn submit(&self, statement: Statement, source: StatementSource) -> SubmitResult
fn submit(&self, statement: Statement, source: StatementSource) -> SubmitResult
Submit a statement.