pub struct SourceCursorReader { /* private fields */ }Expand description
A live PostgreSQL connection pool for reading source cursors.
Implementations§
Source§impl SourceCursorReader
impl SourceCursorReader
Sourcepub fn connect(db_url: &str) -> Result<Self>
pub fn connect(db_url: &str) -> Result<Self>
Connect to db_url (PostgreSQL only) for cursor reads.
§Errors
Returns an error if db_url is not a postgres:// URL or the pool cannot be
created. (Connection failures surface lazily on the first query.)
Sourcepub async fn load_cursors(&self) -> Result<Vec<CursorRow>>
pub async fn load_cursors(&self) -> Result<Vec<CursorRow>>
Load every source cursor row.
The age is computed in SQL against the database clock. cursor_value (JSONB)
decodes directly to a serde_json::Value (the with-serde_json-1 codec).
Missing table ⇒ an empty result is not silently returned — the error
surfaces so the operator learns the source subsystem was never initialized.
§Errors
Returns an error if the connection or the query fails.
Auto Trait Implementations§
impl !RefUnwindSafe for SourceCursorReader
impl !UnwindSafe for SourceCursorReader
impl Freeze for SourceCursorReader
impl Send for SourceCursorReader
impl Sync for SourceCursorReader
impl Unpin for SourceCursorReader
impl UnsafeUnpin for SourceCursorReader
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