pub trait Connection: Send + Sync {
// Required methods
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_healthy(&self) -> bool;
fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_with_config<'life0, 'async_trait>(
&'life0 self,
config: StoreConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn capabilities(&self) -> ConnectionCapabilities;
}Expand description
Store connection lifecycle and store factory.
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the store.
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Graceful shutdown.
Sourcefn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
Health check - fast, non-blocking.
Sourcefn store<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get or create a named store with default configuration.
Sourcefn store_with_config<'life0, 'async_trait>(
&'life0 self,
config: StoreConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_with_config<'life0, 'async_trait>(
&'life0 self,
config: StoreConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn KvStore>, KvError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get or create a named store with custom configuration.
Use this when you need to specify bucket-level settings like TTL or history.
Config applies only at creation. If the bucket already exists, the
existing one is returned as-is and config (max_bytes, num_replicas,
max_history, max_age, …) is ignored — there is no reconciliation. To change
settings on a live bucket (e.g. raising num_replicas for HA), alter the
underlying stream out-of-band; calling this with new values is a no-op.
Sourcefn capabilities(&self) -> ConnectionCapabilities
fn capabilities(&self) -> ConnectionCapabilities
Store capabilities for runtime feature detection.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".