add method to iterate opened database columns
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
849cfdcdfa
commit
f261d44edb
2 changed files with 12 additions and 2 deletions
|
@ -2,7 +2,12 @@ use std::{ops::Index, sync::Arc};
|
|||
|
||||
use conduit::{Result, Server};
|
||||
|
||||
use crate::{cork::Cork, maps, maps::Maps, Engine, Map};
|
||||
use crate::{
|
||||
cork::Cork,
|
||||
maps,
|
||||
maps::{Maps, MapsKey, MapsVal},
|
||||
Engine, Map,
|
||||
};
|
||||
|
||||
pub struct Database {
|
||||
pub db: Arc<Engine>,
|
||||
|
@ -30,6 +35,9 @@ impl Database {
|
|||
#[inline]
|
||||
#[must_use]
|
||||
pub fn cork_and_sync(&self) -> Cork { Cork::new(&self.db, true, true) }
|
||||
|
||||
#[inline]
|
||||
pub fn iter_maps(&self) -> impl Iterator<Item = (&MapsKey, &MapsVal)> + '_ { self.map.iter() }
|
||||
}
|
||||
|
||||
impl Index<&str> for Database {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue