pub struct MemoryLeaseStore { /* private fields */ }Expand description
In-process lease table for lab and unit tests.
Implementations§
Source§impl MemoryLeaseStore
impl MemoryLeaseStore
Sourcepub fn new() -> MemoryLeaseStore
pub fn new() -> MemoryLeaseStore
Create an empty in-memory lease table.
Trait Implementations§
Source§impl Default for MemoryLeaseStore
impl Default for MemoryLeaseStore
Source§fn default() -> MemoryLeaseStore
fn default() -> MemoryLeaseStore
Returns the “default value” for a type. Read more
Source§impl LeaseStore for MemoryLeaseStore
impl LeaseStore for MemoryLeaseStore
Source§fn claim<'life0, 'async_trait>(
&'life0 self,
lease: ConsumerLease,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryLeaseStore: 'async_trait,
fn claim<'life0, 'async_trait>(
&'life0 self,
lease: ConsumerLease,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryLeaseStore: 'async_trait,
Claim a shard lease for an instance (fails if held by another live member).
Source§fn renew<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
fn renew<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
Renew all leases held by an instance in the group.
Source§fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
fn release<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
Release all leases held by an instance in the group.
Source§fn list_for_instance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
fn list_for_instance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_id: &'life1 str,
instance_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, PhotonError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryLeaseStore: 'async_trait,
List live shard ids leased by an instance.
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryLeaseStore
impl !UnwindSafe for MemoryLeaseStore
impl Freeze for MemoryLeaseStore
impl Send for MemoryLeaseStore
impl Sync for MemoryLeaseStore
impl Unpin for MemoryLeaseStore
impl UnsafeUnpin for MemoryLeaseStore
Blanket Implementations§
impl<T> AsyncConnector for T
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