pub struct SnapshotPager { /* private fields */ }Expand description
A bounded, finite read over one PostgreSQL repeatable-read snapshot.
The pager owns the connection-bound transaction. It does not accept an arbitrary executor and never releases the transaction between pages. A pager is intentionally not a stream: callers choose explicit page bounds and must finish or roll back the read transaction.
The pager is deliberately not Send: the snapshot and its connection must
stay with the executor that created them.
ⓘ
use dovecote_sqlx_postgres::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’s finite export.
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 finish(self) -> Result<(), PageError>
pub async fn finish(self) -> Result<(), PageError>
Commits the read-only transaction and releases its pooled 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