pub struct AttemptsRepo { /* private fields */ }Implementations§
Source§impl AttemptsRepo
impl AttemptsRepo
pub fn new(pool: Pool<Postgres>) -> AttemptsRepo
Sourcepub async fn start_attempt(
&self,
job_id: Uuid,
worker_id: &str,
) -> Result<JobAttempt, Error>
pub async fn start_attempt( &self, job_id: Uuid, worker_id: &str, ) -> Result<JobAttempt, Error>
Insert attempt row as “running”, auto-increment attempt_no per job.
Sourcepub async fn start_attempt_for_dataset(
&self,
dataset_id: &str,
job_id: Uuid,
worker_id: &str,
) -> Result<JobAttempt, Error>
pub async fn start_attempt_for_dataset( &self, dataset_id: &str, job_id: Uuid, worker_id: &str, ) -> Result<JobAttempt, Error>
Insert attempt row as “running” when caller already knows dataset_id.
Sourcepub async fn start_attempts_batch(
&self,
dataset_ids: &[String],
job_ids: &[Uuid],
worker_id: &str,
) -> Result<Vec<(Uuid, Uuid, i32)>, Error>
pub async fn start_attempts_batch( &self, dataset_ids: &[String], job_ids: &[Uuid], worker_id: &str, ) -> Result<Vec<(Uuid, Uuid, i32)>, Error>
Insert many “running” attempts in one round-trip. Returns tuples of (job_id, attempt_id, attempt_no).
pub async fn finish_succeeded( &self, attempt_id: Uuid, latency_ms: i32, ) -> Result<(), Error>
Sourcepub async fn finish_succeeded_batch(
&self,
updates: &[(Uuid, i32)],
) -> Result<(), Error>
pub async fn finish_succeeded_batch( &self, updates: &[(Uuid, i32)], ) -> Result<(), Error>
Fast-path for successful batch execution: updates many attempts in one statement.
pub async fn finish_failed( &self, attempt_id: Uuid, latency_ms: i32, error_code: &str, error_message: &str, ) -> Result<(), Error>
pub async fn list_attempts_for_job( &self, job_id: Uuid, ) -> Result<Vec<JobAttempt>, Error>
Trait Implementations§
Source§impl Clone for AttemptsRepo
impl Clone for AttemptsRepo
Source§fn clone(&self) -> AttemptsRepo
fn clone(&self) -> AttemptsRepo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AttemptsRepo
impl !UnwindSafe for AttemptsRepo
impl Freeze for AttemptsRepo
impl Send for AttemptsRepo
impl Sync for AttemptsRepo
impl Unpin for AttemptsRepo
impl UnsafeUnpin for AttemptsRepo
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> 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