Skip to main content

StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend {
    // Required methods
    fn get(&self, path_or_hash: &str) -> RhoResult<Vec<u8>>;
    fn put(
        &self,
        path: &str,
        bytes: &[u8],
        expected_previous_digest: Option<&str>,
    ) -> RhoResult<String>;
    fn list(&self, prefix: &str) -> RhoResult<Vec<StorageEntry>>;
    fn head(&self, space_id: &str) -> RhoResult<StateDigest>;
    fn propose(&self, change_set: &SignedChangeSet) -> RhoResult<ProposalId>;
    fn fetch_proposal(&self, id: &ProposalId) -> RhoResult<SignedChangeSet>;
}

Required Methods§

Source

fn get(&self, path_or_hash: &str) -> RhoResult<Vec<u8>>

Source

fn put( &self, path: &str, bytes: &[u8], expected_previous_digest: Option<&str>, ) -> RhoResult<String>

Source

fn list(&self, prefix: &str) -> RhoResult<Vec<StorageEntry>>

Source

fn head(&self, space_id: &str) -> RhoResult<StateDigest>

Source

fn propose(&self, change_set: &SignedChangeSet) -> RhoResult<ProposalId>

Source

fn fetch_proposal(&self, id: &ProposalId) -> RhoResult<SignedChangeSet>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§