Trait hammersbald::HammersbaldAPI [−][src]
public API to Hammersbald
Required methods
fn batch(&mut self) -> Result<(), Error>
[src]
end current batch and start a new batch
fn shutdown(&mut self)
[src]
stop background writer
fn put_keyed(&mut self, key: &[u8], data: &[u8]) -> Result<PRef, Error>
[src]
store data accessible with key returns a persistent reference to stored data
fn get_keyed(&self, key: &[u8]) -> Result<Option<(PRef, Vec<u8>)>, Error>
[src]
retrieve data with key returns Some(persistent reference, data) or None
fn put(&mut self, data: &[u8]) -> Result<PRef, Error>
[src]
store data returns a persistent reference
fn get(&self, pref: PRef) -> Result<(Vec<u8>, Vec<u8>), Error>
[src]
retrieve data using a persistent reference returns (key, data)
fn may_have_key(&self, key: &[u8]) -> Result<bool, Error>
[src]
a quick (in-memory) check if the db may have the key this might return false positive, but if it is false key is definitely not used.
fn forget(&mut self, key: &[u8]) -> Result<(), Error>
[src]
forget a key (if known) This is not a real delete as data will be still accessible through its PRef, but contains hash table growth
fn iter(&self) -> HammersbaldIterator<'_>ⓘ
[src]
iterator of data