pub struct StoreConfig {
pub name: String,
pub storage: StorageType,
pub max_history: Option<u32>,
pub max_age: Option<Duration>,
pub max_bytes: Option<i64>,
pub num_replicas: Option<usize>,
pub discard: DiscardPolicy,
}Expand description
Configuration for creating a store.
Fields§
§name: StringStore name/bucket identifier.
storage: StorageTypeStorage type (memory or persistent).
max_history: Option<u32>Maximum history/versions to keep (NATS-specific, ignored by other stores).
max_age: Option<Duration>Maximum age for entries in the bucket (bucket-level TTL).
Entries older than this are automatically removed.
NATS: maps to max_age on bucket config.
max_bytes: Option<i64>Maximum bytes for the bucket (required by Synadia Cloud).
NATS: maps to max_bytes on bucket config.
num_replicas: Option<usize>Number of stream replicas for the bucket (NATS cluster mode). Defaults to 1 (single replica). Set to 3 for production HA clusters.
discard: DiscardPolicyBehavior at max_bytes (NATS-specific, ignored by other stores). Defaults
to DiscardPolicy::New (reject) so config buckets never silently drop a
live value; set DiscardPolicy::Old for size-bounded log buckets (routing
origins) that must never freeze writers. Only applied at bucket creation —
an existing bucket’s policy is left untouched.
Trait Implementations§
Source§impl Clone for StoreConfig
impl Clone for StoreConfig
Source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more