pub struct ProcessLeaseAuthority { /* private fields */ }Expand description
Shared authority for proving that an exact process incarnation has been durably revoked.
Implementations§
Source§impl ProcessLeaseAuthority
impl ProcessLeaseAuthority
Sourcepub fn new(
store: Arc<dyn ObjectStore>,
ttl: Duration,
) -> Result<Self, ProcessLeaseError>
pub fn new( store: Arc<dyn ObjectStore>, ttl: Duration, ) -> Result<Self, ProcessLeaseError>
Bind all stable-node lease namespaces on one shared object store and TTL.
§Errors
Rejects a zero, sub-millisecond, fractional-millisecond, or oversized TTL.
Sourcepub fn store_for(&self, node: NodeId) -> Arc<ProcessLeaseStore> ⓘ
pub fn store_for(&self, node: NodeId) -> Arc<ProcessLeaseStore> ⓘ
Open one stable-node namespace over the shared authority.
Sourcepub fn fencing_deadline(
&self,
io_budget: Duration,
) -> Result<Instant, ProcessLeaseError>
pub fn fencing_deadline( &self, io_budget: Duration, ) -> Result<Instant, ProcessLeaseError>
Build a monotonic deadline that covers the mandatory full-TTL observation plus bounded authority I/O. Callers need not duplicate the process-lease TTL as another runtime knob.
§Errors
Rejects a zero I/O budget or monotonic-clock overflow.
Sourcepub async fn fence_incarnation(
&self,
participant: CheckpointParticipant,
deadline: Instant,
) -> Result<ProcessLeaseFence, ProcessLeaseError>
pub async fn fence_incarnation( &self, participant: CheckpointParticipant, deadline: Instant, ) -> Result<ProcessLeaseFence, ProcessLeaseError>
Durably supersede an unchanged process incarnation after observing it for one full TTL.
A retry after the create-only takeover won reconstructs the exact fence from the two retained history records. It never waits a second TTL for that already-durable result.
§Errors
Fails closed on renewal, deadline expiry, missing history, or any authority I/O failure.
Sourcepub async fn verify_current_participant(
&self,
participant: CheckpointParticipant,
deadline: Instant,
) -> Result<bool, ProcessLeaseError>
pub async fn verify_current_participant( &self, participant: CheckpointParticipant, deadline: Instant, ) -> Result<bool, ProcessLeaseError>
Verify that an exact boot incarnation is the current durable owner of its stable node.
§Errors
Fails closed on deadline expiry, missing takeover evidence, malformed state, or I/O.
Sourcepub async fn verify_current_participant_term(
&self,
participant: CheckpointParticipant,
process_term: u64,
deadline: Instant,
) -> Result<bool, ProcessLeaseError>
pub async fn verify_current_participant_term( &self, participant: CheckpointParticipant, process_term: u64, deadline: Instant, ) -> Result<bool, ProcessLeaseError>
Verify an exact boot and process term against the current durable stable-node authority.
§Errors
Fails closed on deadline expiry, missing takeover evidence, malformed state, or I/O.
Sourcepub async fn verify_fence(
&self,
fence: &ProcessLeaseFence,
deadline: Instant,
) -> Result<bool, ProcessLeaseError>
pub async fn verify_fence( &self, fence: &ProcessLeaseFence, deadline: Instant, ) -> Result<bool, ProcessLeaseError>
Verify that both exact fence records remain present and the fenced owner is not current.
§Errors
Fails closed on deadline expiry, missing history, malformed records, or authority I/O.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessLeaseAuthority
impl !UnwindSafe for ProcessLeaseAuthority
impl Freeze for ProcessLeaseAuthority
impl Send for ProcessLeaseAuthority
impl Sync for ProcessLeaseAuthority
impl Unpin for ProcessLeaseAuthority
impl UnsafeUnpin for ProcessLeaseAuthority
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].