Trait forest_filecoin::db::EthMappingsStore

source ·
pub trait EthMappingsStore {
    // Required methods
    fn read_bin(&self, key: &EthHash) -> Result<Option<Vec<u8>>>;
    fn write_bin(&self, key: &EthHash, value: &[u8]) -> Result<()>;
    fn exists(&self, key: &EthHash) -> Result<bool>;
    fn get_message_cids(&self) -> Result<Vec<(Cid, u64)>>;
    fn delete(&self, keys: Vec<EthHash>) -> Result<()>;
}
Expand description

Interface used to store and retrieve Ethereum mappings from the database. To store IPLD blocks, use the BlockStore trait.

Required Methods§

source

fn read_bin(&self, key: &EthHash) -> Result<Option<Vec<u8>>>

Reads binary field from the EthMappings store. This should be used for non-serializable data. For serializable data, use EthMappingsStoreExt::read_obj.

source

fn write_bin(&self, key: &EthHash, value: &[u8]) -> Result<()>

Writes binary field to the EthMappings store. This should be used for non-serializable data. For serializable data, use EthMappingsStoreExt::write_obj.

source

fn exists(&self, key: &EthHash) -> Result<bool>

Returns Ok(true) if key exists in store.

source

fn get_message_cids(&self) -> Result<Vec<(Cid, u64)>>

Returns all message CIDs with their timestamp.

source

fn delete(&self, keys: Vec<EthHash>) -> Result<()>

Deletes keys if keys exist in store.

Implementations on Foreign Types§

source§

impl<T: EthMappingsStore> EthMappingsStore for Arc<T>

source§

fn read_bin(&self, key: &EthHash) -> Result<Option<Vec<u8>>>

source§

fn write_bin(&self, key: &EthHash, value: &[u8]) -> Result<()>

source§

fn exists(&self, key: &EthHash) -> Result<bool>

source§

fn get_message_cids(&self) -> Result<Vec<(Cid, u64)>>

source§

fn delete(&self, keys: Vec<EthHash>) -> Result<()>

Implementors§