pub struct FileLeaseRepository { /* private fields */ }Expand description
Filesystem-backed lease repository for OS-lock-capable shared filesystems.
Implementations§
Source§impl FileLeaseRepository
impl FileLeaseRepository
Sourcepub fn open(
root: impl Into<PathBuf>,
policy: LeasePolicy,
) -> ProviderResult<Self>
pub fn open( root: impl Into<PathBuf>, policy: LeasePolicy, ) -> ProviderResult<Self>
Opens a repository under a shared filesystem root.
Sourcepub fn policy(&self) -> LeasePolicy
pub fn policy(&self) -> LeasePolicy
Returns the configured lease policy.
Trait Implementations§
Source§impl Clone for FileLeaseRepository
impl Clone for FileLeaseRepository
Source§fn clone(&self) -> FileLeaseRepository
fn clone(&self) -> FileLeaseRepository
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 FileLeaseRepository
impl Debug for FileLeaseRepository
Source§impl LeaseRepository for FileLeaseRepository
impl LeaseRepository for FileLeaseRepository
Source§fn acquire(
&self,
resource: &str,
owner: LeaseOwner,
now_ms: u64,
) -> ProviderResult<SharedResourceLease>
fn acquire( &self, resource: &str, owner: LeaseOwner, now_ms: u64, ) -> ProviderResult<SharedResourceLease>
Acquires a lease or recovers an expired one.
Source§fn heartbeat(
&self,
heartbeat: LeaseHeartbeat,
) -> ProviderResult<SharedResourceLease>
fn heartbeat( &self, heartbeat: LeaseHeartbeat, ) -> ProviderResult<SharedResourceLease>
Renews a lease held by the same owner and fencing epoch.
Source§fn release(&self, token: &LeaseToken) -> ProviderResult<()>
fn release(&self, token: &LeaseToken) -> ProviderResult<()>
Releases a current lease.
Source§fn current(&self, resource: &str) -> ProviderResult<Option<SharedResourceLease>>
fn current(&self, resource: &str) -> ProviderResult<Option<SharedResourceLease>>
Returns the current durable lease state, expired or not.
Source§fn check_fence(
&self,
token: &LeaseToken,
now_ms: u64,
) -> ProviderResult<LeaseDecision>
fn check_fence( &self, token: &LeaseToken, now_ms: u64, ) -> ProviderResult<LeaseDecision>
Checks whether a writer still owns the current fencing token.
Auto Trait Implementations§
impl Freeze for FileLeaseRepository
impl RefUnwindSafe for FileLeaseRepository
impl Send for FileLeaseRepository
impl Sync for FileLeaseRepository
impl Unpin for FileLeaseRepository
impl UnsafeUnpin for FileLeaseRepository
impl UnwindSafe for FileLeaseRepository
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