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_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.
pub fn authenticate_and_renew( &self, lease_id: &str, token: &str, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
pub fn release( &self, lease_id: &str, token: &str, status: WriterLeaseStatus, now: DateTime<Utc>, ) -> Result<WriterLeaseAuthOutcome>
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.
pub fn abandon_thread(&self, thread: &str, now: DateTime<Utc>) -> Result<()>
pub fn load(&self, lease_id: &str) -> Result<Option<WriterLease>>
Auto Trait Implementations§
impl Freeze for WriterLeaseStore
impl RefUnwindSafe for WriterLeaseStore
impl Send for WriterLeaseStore
impl Sync for WriterLeaseStore
impl Unpin for WriterLeaseStore
impl UnsafeUnpin for WriterLeaseStore
impl UnwindSafe for WriterLeaseStore
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