pub struct MutationLeaseManager { /* private fields */ }Expand description
In-memory lease authority for one daemon session namespace.
Implementations§
Source§impl MutationLeaseManager
impl MutationLeaseManager
Sourcepub fn acquire(
&mut self,
session_id: &str,
owner_id: &str,
now_ms: u64,
ttl_ms: u64,
) -> Result<MutationLease, LeaseError>
pub fn acquire( &mut self, session_id: &str, owner_id: &str, now_ms: u64, ttl_ms: u64, ) -> Result<MutationLease, LeaseError>
Acquire the only mutation lease for a session.
Sourcepub fn renew(
&mut self,
session_id: &str,
owner_id: &str,
token: &str,
now_ms: u64,
ttl_ms: u64,
) -> Result<MutationLease, LeaseError>
pub fn renew( &mut self, session_id: &str, owner_id: &str, token: &str, now_ms: u64, ttl_ms: u64, ) -> Result<MutationLease, LeaseError>
Renew a lease without allowing a different owner to take it over.
Sourcepub fn release(
&mut self,
session_id: &str,
owner_id: &str,
token: &str,
) -> Result<(), LeaseError>
pub fn release( &mut self, session_id: &str, owner_id: &str, token: &str, ) -> Result<(), LeaseError>
Release a lease only when the owner and token match.
Sourcepub fn validate(
&self,
session_id: &str,
owner_id: &str,
token: &str,
now_ms: u64,
) -> Result<(), LeaseError>
pub fn validate( &self, session_id: &str, owner_id: &str, token: &str, now_ms: u64, ) -> Result<(), LeaseError>
Verify that a mutation request is still owned by the given client.
Sourcepub fn release_owner(&mut self, owner_id: &str)
pub fn release_owner(&mut self, owner_id: &str)
Release every lease held by a disconnected client owner.
Trait Implementations§
Source§impl Debug for MutationLeaseManager
impl Debug for MutationLeaseManager
Source§impl Default for MutationLeaseManager
impl Default for MutationLeaseManager
Source§fn default() -> MutationLeaseManager
fn default() -> MutationLeaseManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MutationLeaseManager
impl RefUnwindSafe for MutationLeaseManager
impl Send for MutationLeaseManager
impl Sync for MutationLeaseManager
impl Unpin for MutationLeaseManager
impl UnsafeUnpin for MutationLeaseManager
impl UnwindSafe for MutationLeaseManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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