pub struct PostgresJournal { /* private fields */ }Implementations§
Source§impl PostgresJournal
impl PostgresJournal
Sourcepub async fn connect(url: &str) -> Result<Self, JournalError>
pub async fn connect(url: &str) -> Result<Self, JournalError>
Connect and create the schema if needed.
Sourcepub async fn from_pool(pool: PgPool) -> Result<Self, JournalError>
pub async fn from_pool(pool: PgPool) -> Result<Self, JournalError>
Use an existing pool and create the schema if needed.
pub fn pool(&self) -> &PgPool
Sourcepub async fn runs_awaiting_approval(&self) -> Result<Vec<String>, JournalError>
pub async fn runs_awaiting_approval(&self) -> Result<Vec<String>, JournalError>
Run ids that are suspended waiting for a human decision.
Trait Implementations§
Source§impl Clone for PostgresJournal
impl Clone for PostgresJournal
Source§impl Journal for PostgresJournal
impl Journal for PostgresJournal
Source§fn acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Result<(), LeaseHolder>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Result<(), LeaseHolder>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Leases use the database clock, so worker clock skew does not matter.
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Extend a lease this owner holds.
false means it was lost.fn release_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresJournal
impl !UnwindSafe for PostgresJournal
impl Freeze for PostgresJournal
impl Send for PostgresJournal
impl Sync for PostgresJournal
impl Unpin for PostgresJournal
impl UnsafeUnpin for PostgresJournal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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