pub struct WriterLeaseStore { /* private fields */ }Implementations§
Source§impl WriterLeaseStore
impl WriterLeaseStore
pub fn new(heddle_dir: &Path) -> Self
pub fn reserve( &self, draft: WriterLeaseDraft, now: DateTime<Utc>, ) -> Result<WriterLeaseReserveOutcome>
Sourcepub fn reserve_with_checkout_lock(
&self,
draft: WriterLeaseDraft,
now: DateTime<Utc>,
) -> Result<WriterLeaseReserveOutcome>
pub fn reserve_with_checkout_lock( &self, draft: WriterLeaseDraft, now: DateTime<Utc>, ) -> Result<WriterLeaseReserveOutcome>
The caller already holds the checkout mutation lock for draft.path.
Sourcepub fn reserve_prepared(
&self,
draft: WriterLeaseDraft,
lease_id: String,
token: String,
now: DateTime<Utc>,
) -> Result<WriterLeaseReserveOutcome>
pub fn reserve_prepared( &self, draft: WriterLeaseDraft, lease_id: String, token: String, now: DateTime<Utc>, ) -> Result<WriterLeaseReserveOutcome>
A command journal persists these random credentials before reservation. Retrying the exact live reservation recovers its token; a different actor, path, token or an expired/released reservation can never revive it.
Sourcepub fn live_owner(
&self,
thread: &str,
path: Option<&Path>,
) -> Result<Option<WriterLease>>
pub fn live_owner( &self, thread: &str, path: Option<&Path>, ) -> Result<Option<WriterLease>>
Advisory preflight. reserve repeats this check under the write lock.
Sourcepub fn live_owner_with_checkout_lock(
&self,
thread: &str,
path: &Path,
_checkout_guard: &WriteLockGuard,
) -> Result<Option<WriterLease>>
pub fn live_owner_with_checkout_lock( &self, thread: &str, path: &Path, _checkout_guard: &WriteLockGuard, ) -> Result<Option<WriterLease>>
Advisory preflight when the caller holds this checkout’s mutation lock.
pub fn authenticate_and_renew( &self, lease_id: &str, token: &str, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
Sourcepub fn bind_hook_session(
&self,
lease_id: &str,
token: &str,
session: &str,
pid: u32,
birth: &str,
now: DateTime<Utc>,
) -> Result<WriterLeaseAuthOutcome>
pub fn bind_hook_session( &self, lease_id: &str, token: &str, session: &str, pid: u32, birth: &str, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
A hook proves both possession of the lane credential and its process ancestry. Subsequent hook calls may only renew the same live session.
pub fn release( &self, lease_id: &str, token: &str, status: WriterLeaseStatus, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
Sourcepub fn release_with_checkout_lock(
&self,
lease_id: &str,
token: &str,
status: WriterLeaseStatus,
now: DateTime<Utc>,
) -> Result<WriterLeaseAuthOutcome>
pub fn release_with_checkout_lock( &self, lease_id: &str, token: &str, status: WriterLeaseStatus, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
The caller holds the checkout mutation lock through credential cleanup.
pub fn list(&self) -> Result<Vec<WriterLease>>
Sourcepub fn list_without_reaping(&self) -> Result<Vec<WriterLease>>
pub fn list_without_reaping(&self) -> Result<Vec<WriterLease>>
List persisted leases without reaping expired active records.
Cleanup previews use this read-only view so residue detection cannot mutate lease storage as a side effect.
Sourcepub fn delete_for_tasks(&self, task_ids: &[String]) -> Result<()>
pub fn delete_for_tasks(&self, task_ids: &[String]) -> Result<()>
Remove reservations belonging to task assignments rolled back before launch.