EthMappingsStore

Trait 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§