pub struct SelfOwnsAll;Expand description
Standalone ownership: this process owns every stream unconditionally.
Trait Implementations§
Source§impl Ownership for SelfOwnsAll
impl Ownership for SelfOwnsAll
Source§fn try_acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Lease>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_acquire<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Lease>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Claim
stream_key if it is free, expired, or already held by THIS
process (idempotent — re-acquiring your own live lease returns it and
does not change its epoch). Returns None if another live replica owns
it.Source§fn renew<'life0, 'life1, 'async_trait>(
&'life0 self,
_lease: &'life1 Lease,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn renew<'life0, 'life1, 'async_trait>(
&'life0 self,
_lease: &'life1 Lease,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extend a held lease.
Err if the lease was lost (stolen/expired) — which
is how a replica learns it is no longer the owner.Source§fn release<'life0, 'life1, 'async_trait>(
&'life0 self,
_stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release<'life0, 'life1, 'async_trait>(
&'life0 self,
_stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Release a held stream so a peer may claim it immediately (graceful
hand-off), rather than waiting for TTL expiry.
Auto Trait Implementations§
impl Freeze for SelfOwnsAll
impl RefUnwindSafe for SelfOwnsAll
impl Send for SelfOwnsAll
impl Sync for SelfOwnsAll
impl Unpin for SelfOwnsAll
impl UnsafeUnpin for SelfOwnsAll
impl UnwindSafe for SelfOwnsAll
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<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>
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