pub struct LiveOwnershipRow {Show 13 fields
pub id: i64,
pub run_id: Option<i64>,
pub operation_kind: LiveOperationKind,
pub database_key: String,
pub resource_key: String,
pub owner_pid: i64,
pub acquired_at: DateTime<Utc>,
pub heartbeat_at: DateTime<Utc>,
pub released_at: Option<DateTime<Utc>>,
pub state: LiveOwnershipState,
pub restore_intent_json: Option<String>,
pub orphan_eligible: bool,
pub orphan_evidence_json: Option<String>,
}Fields§
§id: i64§run_id: Option<i64>§operation_kind: LiveOperationKind§database_key: String§resource_key: String§owner_pid: i64§acquired_at: DateTime<Utc>§heartbeat_at: DateTime<Utc>§released_at: Option<DateTime<Utc>>§state: LiveOwnershipState§restore_intent_json: Option<String>§orphan_eligible: bool§orphan_evidence_json: Option<String>Implementations§
Source§impl LiveOwnershipRow
impl LiveOwnershipRow
Sourcepub async fn create_and_claim(
pool: &SqlitePool,
new: NewLiveOwnership,
claim_key: &str,
) -> DbResult<Option<Self>>
pub async fn create_and_claim( pool: &SqlitePool, new: NewLiveOwnership, claim_key: &str, ) -> DbResult<Option<Self>>
Inserts an owner and conditionally claims its canonical database/resource key in one
transaction. Recovery claim transfer is handled atomically by
TuneRecoveryAttemptRow::start_with_claim.
pub async fn heartbeat( pool: &SqlitePool, owner_id: i64, now: DateTime<Utc>, ) -> DbResult<()>
pub async fn release( pool: &SqlitePool, owner_id: i64, now: DateTime<Utc>, ) -> DbResult<()>
pub async fn get(pool: &SqlitePool, id: i64) -> DbResult<Option<Self>>
pub async fn has_claim( pool: &SqlitePool, owner_id: i64, expected_claim_key: &str, ) -> DbResult<bool>
pub async fn list_for_run(pool: &SqlitePool, run_id: i64) -> DbResult<Vec<Self>>
pub async fn stale_active_owners( pool: &SqlitePool, stale_before: DateTime<Utc>, ) -> DbResult<Vec<Self>>
pub async fn set_restore_intent( pool: &SqlitePool, owner_id: i64, intent_json: &str, ) -> DbResult<()>
pub async fn mark_orphaned( pool: &SqlitePool, update: OrphanOwnerUpdate<'_>, ) -> DbResult<bool>
Sourcepub async fn mark_orphaned_unrecoverable(
pool: &SqlitePool,
update: UnrecoverableOwnerUpdate<'_>,
) -> DbResult<bool>
pub async fn mark_orphaned_unrecoverable( pool: &SqlitePool, update: UnrecoverableOwnerUpdate<'_>, ) -> DbResult<bool>
Retires a stale owner only after its caller has exported the exact affected rows. Any still-running row attached to the orphaned operation is failed closed rather than made automatically recoverable.
Trait Implementations§
Source§impl Clone for LiveOwnershipRow
impl Clone for LiveOwnershipRow
Source§fn clone(&self) -> LiveOwnershipRow
fn clone(&self) -> LiveOwnershipRow
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 moreSource§impl Debug for LiveOwnershipRow
impl Debug for LiveOwnershipRow
Source§impl PartialEq for LiveOwnershipRow
impl PartialEq for LiveOwnershipRow
Source§impl Serialize for LiveOwnershipRow
impl Serialize for LiveOwnershipRow
impl StructuralPartialEq for LiveOwnershipRow
Auto Trait Implementations§
impl Freeze for LiveOwnershipRow
impl RefUnwindSafe for LiveOwnershipRow
impl Send for LiveOwnershipRow
impl Sync for LiveOwnershipRow
impl Unpin for LiveOwnershipRow
impl UnsafeUnpin for LiveOwnershipRow
impl UnwindSafe for LiveOwnershipRow
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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