pub struct SnapshotCollector {
schema: AppSchema,
limits: SnapshotLimits,
entity_index: usize,
cursor: Option<Value>,
records: Vec<Record>,
bytes: u64,
}Expand description
Shared keyset pagination and accounting. Adapters must keep every page in the same database read transaction; separate calls to query are insufficient.
Fields§
§schema: AppSchema§limits: SnapshotLimits§entity_index: usize§cursor: Option<Value>§records: Vec<Record>§bytes: u64Implementations§
Source§impl SnapshotCollector
impl SnapshotCollector
pub fn new( schema: &AppSchema, limits: SnapshotLimits, ) -> Result<Self, DatabaseError>
pub fn next_query(&self) -> Result<Option<Query>, DatabaseError>
pub fn accept( &mut self, rows: Vec<Map<String, Value>>, ) -> Result<(), DatabaseError>
pub fn finish(self) -> Result<Vec<Record>, DatabaseError>
Auto Trait Implementations§
impl Freeze for SnapshotCollector
impl RefUnwindSafe for SnapshotCollector
impl Send for SnapshotCollector
impl Sync for SnapshotCollector
impl Unpin for SnapshotCollector
impl UnsafeUnpin for SnapshotCollector
impl UnwindSafe for SnapshotCollector
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