pub struct LocalSignals { /* private fields */ }Expand description
Generations and locks held by this process alone.
Implementations§
Source§impl LocalSignals
impl LocalSignals
Trait Implementations§
Source§impl Default for LocalSignals
impl Default for LocalSignals
Source§impl Signals for LocalSignals
impl Signals for LocalSignals
fn name(&self) -> &'static str
Source§fn current(&self, namespace: &str) -> Option<u64>
fn current(&self, namespace: &str) -> Option<u64>
The generation this process last saw, or
None before the namespace
was ever read here.Source§fn ensure<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = CoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = CoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The generation, seeding the namespace when it is new.
Source§fn bump<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = CoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn bump<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
) -> Pin<Box<dyn Future<Output = CoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Moves the namespace to a new generation and returns it.
Source§fn refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reloads every generation from the shared store.
Source§fn known<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<Vec<(String, u64)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn known<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<Vec<(String, u64)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every namespace the shared store knows, with its generation.
Source§fn lock<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = CoreResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn lock<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = CoreResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Takes the named lock for
owner until ttl passes or it is released;
false while another owner holds it.Source§fn unlock<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn unlock<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = CoreResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Releases the lock when
owner holds it; true when it did.Auto Trait Implementations§
impl !Freeze for LocalSignals
impl RefUnwindSafe for LocalSignals
impl Send for LocalSignals
impl Sync for LocalSignals
impl Unpin for LocalSignals
impl UnsafeUnpin for LocalSignals
impl UnwindSafe for LocalSignals
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