pub trait Signals: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn current(&self, namespace: &str) -> Option<u64>;
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 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 refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 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;
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 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;
}Expand description
Required Methods§
fn name(&self) -> &'static str
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".