pub struct StaticServiceLeadershipGuard { /* private fields */ }Expand description
In-memory service lease guard for embedded hosts and tests.
Implementations§
Source§impl StaticServiceLeadershipGuard
impl StaticServiceLeadershipGuard
Sourcepub fn new(leases: impl IntoIterator<Item = ServiceLeaderLease>) -> Self
pub fn new(leases: impl IntoIterator<Item = ServiceLeaderLease>) -> Self
Creates a guard from zero or more independently scoped leases.
Sourcepub fn set_service_lease(
&self,
service_id: ServiceId,
lease: Option<ServiceLeaderLease>,
) -> ControlPlaneResult<()>
pub fn set_service_lease( &self, service_id: ServiceId, lease: Option<ServiceLeaderLease>, ) -> ControlPlaneResult<()>
Adds, renews, or removes the lease for one service.
Trait Implementations§
Source§impl Clone for StaticServiceLeadershipGuard
impl Clone for StaticServiceLeadershipGuard
Source§fn clone(&self) -> StaticServiceLeadershipGuard
fn clone(&self) -> StaticServiceLeadershipGuard
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 StaticServiceLeadershipGuard
impl Debug for StaticServiceLeadershipGuard
Source§impl Default for StaticServiceLeadershipGuard
impl Default for StaticServiceLeadershipGuard
Source§fn default() -> StaticServiceLeadershipGuard
fn default() -> StaticServiceLeadershipGuard
Returns the “default value” for a type. Read more
Source§impl ServiceLeadershipGuard for StaticServiceLeadershipGuard
impl ServiceLeadershipGuard for StaticServiceLeadershipGuard
Source§fn current_service_lease(
&self,
service_id: &ServiceId,
) -> Option<ServiceLeaderLease>
fn current_service_lease( &self, service_id: &ServiceId, ) -> Option<ServiceLeaderLease>
Returns the current lease for
service_id, when one is known.Auto Trait Implementations§
impl Freeze for StaticServiceLeadershipGuard
impl RefUnwindSafe for StaticServiceLeadershipGuard
impl Send for StaticServiceLeadershipGuard
impl Sync for StaticServiceLeadershipGuard
impl Unpin for StaticServiceLeadershipGuard
impl UnsafeUnpin for StaticServiceLeadershipGuard
impl UnwindSafe for StaticServiceLeadershipGuard
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