Struct graphannis_core::util::disk_collections::DiskMap
source · pub struct DiskMap<K, V>where
K: 'static + KeySerializer + Serialize + DeserializeOwned + Clone + Send + Sync + Ord,
for<'de> V: 'static + Serialize + Deserialize<'de> + Clone + Send + Sync,{ /* private fields */ }
Implementations§
source§impl<K, V> DiskMap<K, V>where
K: 'static + Clone + KeySerializer + Serialize + DeserializeOwned + Send + Sync + Ord,
for<'de> V: 'static + Clone + Serialize + Deserialize<'de> + Send + Sync,
impl<K, V> DiskMap<K, V>where
K: 'static + Clone + KeySerializer + Serialize + DeserializeOwned + Send + Sync + Ord,
for<'de> V: 'static + Clone + Serialize + Deserialize<'de> + Send + Sync,
pub fn new( persisted_file: Option<&Path>, eviction_strategy: EvictionStrategy, block_cache_capacity: usize, c1_config: BtreeConfig ) -> Result<DiskMap<K, V>>
pub fn new_temporary( eviction_strategy: EvictionStrategy, block_cache_capacity: usize, c1_config: BtreeConfig ) -> DiskMap<K, V>
pub fn insert(&mut self, key: K, value: V) -> Result<()>
pub fn get(&self, key: &K) -> Result<Option<Cow<'_, V>>>
pub fn contains_key(&self, key: &K) -> Result<bool>
pub fn remove(&mut self, key: &K) -> Result<Option<V>>
pub fn iter(&self) -> Result<Box<dyn Iterator<Item = Result<(K, V)>> + '_>>
sourcepub fn range<'a, R>(
&'a self,
range: R
) -> Box<dyn Iterator<Item = Result<(K, V)>> + 'a>where
R: RangeBounds<K> + Clone,
pub fn range<'a, R>(
&'a self,
range: R
) -> Box<dyn Iterator<Item = Result<(K, V)>> + 'a>where
R: RangeBounds<K> + Clone,
Returns an iterator over a range of entries.
pub fn is_empty(&self) -> Result<bool>
pub fn clear(&mut self)
pub fn write_to(&self, location: &Path) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for DiskMap<K, V>
impl<K, V> !RefUnwindSafe for DiskMap<K, V>
impl<K, V> Send for DiskMap<K, V>
impl<K, V> Sync for DiskMap<K, V>
impl<K, V> Unpin for DiskMap<K, V>
impl<K, V> !UnwindSafe for DiskMap<K, V>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more