diff --git a/src/cache/cache_db.rs b/src/cache/cache_db.rs index d4cf273..74f9c5b 100644 --- a/src/cache/cache_db.rs +++ b/src/cache/cache_db.rs @@ -4,10 +4,9 @@ use std::sync::Mutex; use crate::cache::cache_container::CacheContainer; use crate::cache::change_set::ChangeSet; -use crate::cache::SnapshotId; +use crate::cache::{PaginatedResponse, SnapshotId}; use crate::iterator::ScanDirection; use crate::schema::KeyDecoder; -use crate::PaginatedResponse; use crate::{ KeyCodec, Operation, ReadOnlyLock, Schema, SchemaBatch, SchemaKey, SchemaValue, SeekKeyEncoder, ValueCodec, diff --git a/src/cache/delta_reader.rs b/src/cache/delta_reader.rs index 93481c5..91aeea1 100644 --- a/src/cache/delta_reader.rs +++ b/src/cache/delta_reader.rs @@ -1,9 +1,8 @@ //! Module with `DeltaReader`, a handler of `DB` and uncommited snapshots. +use crate::cache::PaginatedResponse; use crate::iterator::{RawDbIter, ScanDirection}; use crate::schema::{KeyCodec, KeyDecoder, ValueCodec}; -use crate::{ - Operation, PaginatedResponse, Schema, SchemaBatch, SchemaKey, SchemaValue, SeekKeyEncoder, DB, -}; +use crate::{Operation, Schema, SchemaBatch, SchemaKey, SchemaValue, SeekKeyEncoder, DB}; use std::cmp::Ordering; use std::collections::btree_map; use std::iter::{Peekable, Rev}; diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 9fbca21..c92067e 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -1,5 +1,7 @@ //! All structs related to caching layer of Rockbound. +use crate::Schema; + pub mod cache_container; pub mod cache_db; pub mod change_set; @@ -7,3 +9,13 @@ pub mod delta_reader; /// Id of ChangeSet/snapshot/cache layer pub type SnapshotId = u64; + +/// Response for a paginated query which also includes the "next" key to pass. +#[derive(Debug)] +pub struct PaginatedResponse { + /// A vector of storage keys and their values + pub key_value: Vec<(S::Key, S::Value)>, + /// Key indicating the first key after the final pair from key_value. + /// Meant to be passed in subsequent queries + pub next: Option, +} diff --git a/src/lib.rs b/src/lib.rs index 4b284d8..cbe93da 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -446,16 +446,6 @@ impl From>> for ReadOnlyLock { } } -/// Response for a paginated query which also includes the "next" key to pass. -#[derive(Debug)] -pub struct PaginatedResponse { - /// A vector of storage keys and their values - pub key_value: Vec<(S::Key, S::Value)>, - /// Key indicating the first key after the final pair from key_value. - /// Meant to be passed in subsequent queries - pub next: Option, -} - #[cfg(test)] mod tests { use super::*;