pub struct SnapshotPager { /* private fields */ }Expand description
A finite pager retaining one SQLite read transaction. The explicit marker makes accidental movement across unrelated executors a compile-time error.
ⓘ
use dovecote_sqlx_sqlite::SnapshotPager;
fn requires_send<T: Send>() {}
fn main() {
requires_send::<SnapshotPager>();
}Implementations§
Source§impl SnapshotPager
impl SnapshotPager
Sourcepub const fn cursor(&self) -> Option<RowId>
pub const fn cursor(&self) -> Option<RowId>
Returns the last row ID returned by a non-empty page.
Sourcepub const fn upper_bound(&self) -> Option<RowId>
pub const fn upper_bound(&self) -> Option<RowId>
Returns the maximum row ID visible to this pager.
Sourcepub const fn is_exhausted(&self) -> bool
pub const fn is_exhausted(&self) -> bool
Returns whether the pager has returned its final page.
Sourcepub async fn next_page(
&mut self,
limit: Limit,
) -> Result<Vec<PagedEvent>, PageError>
pub async fn next_page( &mut self, limit: Limit, ) -> Result<Vec<PagedEvent>, PageError>
Reads the next bounded page from the retained snapshot.
Sourcepub async fn finish(self) -> Result<(), PageError>
pub async fn finish(self) -> Result<(), PageError>
Commits the read-only snapshot transaction and releases its connection.
Auto Trait Implementations§
impl !RefUnwindSafe for SnapshotPager
impl !Send for SnapshotPager
impl !Sync for SnapshotPager
impl !UnwindSafe for SnapshotPager
impl Freeze for SnapshotPager
impl Unpin for SnapshotPager
impl UnsafeUnpin for SnapshotPager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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