[−][src]Struct sonnerie::DatabaseReader
Read a database in key-timestamp sorted format.
Open a database with new
and then get
,
get_filter
or get_range
to select which keys to read.
Methods
impl DatabaseReader
[src]
pub fn new(dir: &Path) -> Result<DatabaseReader>
[src]
Open a database at the given path.
All of the committed transactions are opened.
Any transactions that appear after new
is called
are not opened (create a new DatabaseReader
).
pub fn without_main_db(dir: &Path) -> Result<DatabaseReader>
[src]
Open a database at the given path, but not the main
file.
This is only useful for doing a minor compaction.
pub fn transaction_paths(&self) -> Vec<PathBuf>
[src]
Get the filenames of each transaction.
This is useful for compacting, because after compaction is complete, you would delete all of the transaction files.
This function also returns the path for main
,
which is overwritten. Don't delete that.
ⓘImportant traits for DatabaseKeyReader<'d, 'r, RB>pub fn get<'rdr, 'k>(
&'rdr self,
key: &'k str
) -> DatabaseKeyReader<'rdr, 'k, RangeInclusive<&'k str>>
[src]
&'rdr self,
key: &'k str
) -> DatabaseKeyReader<'rdr, 'k, RangeInclusive<&'k str>>
Get a reader for only a single key
Returns an object that will read all of the records for only one key.
ⓘImportant traits for DatabaseKeyReader<'d, 'r, RB>pub fn get_range<'d, 'r, RB>(
&'d self,
range: RB
) -> DatabaseKeyReader<'d, 'r, RB> where
RB: RangeBounds<&'r str> + Clone,
[src]
&'d self,
range: RB
) -> DatabaseKeyReader<'d, 'r, RB> where
RB: RangeBounds<&'r str> + Clone,
Get a reader for a lexicographic range of keys
Use inclusive or exclusive range syntax to select a range.
Example: rdr.get_range("chimpan-ay" ..= "chimpan-zee")
Range queries are always efficient and readahead may occur.
ⓘImportant traits for DatabaseKeyReader<'d, 'r, RB>pub fn get_filter<'d, 'k>(
&'d self,
wildcard: &'k Wildcard
) -> DatabaseKeyReader<'d, 'k, RangeFrom<&'k str>>
[src]
&'d self,
wildcard: &'k Wildcard
) -> DatabaseKeyReader<'d, 'k, RangeFrom<&'k str>>
Get a reader that filters on SQL's "LIKE"-like syntax.
A wildcard filter that has a fixed prefix, such as
"chimp%"
is always efficient.
Auto Trait Implementations
impl RefUnwindSafe for DatabaseReader
impl Send for DatabaseReader
impl Sync for DatabaseReader
impl Unpin for DatabaseReader
impl UnwindSafe for DatabaseReader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,