pub enum BackendConfig {
Local {
path: PathBuf,
},
S3 {
bucket: String,
region: String,
endpoint: Option<String>,
},
Redis {
url: String,
ttl_secs: Option<u64>,
},
Pg {
url: String,
max_conns: u32,
},
Tiered {
l1: Box<BackendConfig>,
l2: Box<BackendConfig>,
l3: Box<BackendConfig>,
write_policy: WritePolicy,
},
}Expand description
Storage backend selection.
Dispatched by build_backend to the concrete
backend implementation. The #[serde(tag = "type", rename_all = "lowercase")] shape is the stable JSON wire format; a config file’s
"type": "local" / "type": "tiered" etc. is the operator’s vocabulary.
Variants§
Local
Local filesystem storage.
S3
S3-compatible object storage.
Redis
Redis L1 hot cache (requires the redis-client feature to construct).
Fields
Pg
Postgres L2 durable cache tier (requires the postgres feature to
construct).
Fields
Tiered
Tiered L1 → L2 → L3 resolver composing three nested backends.
The canonical super-cache shape: l1: Redis, l2: Pg, l3: S3. Any
nesting is legal (the arms recurse), so a deployment can pick {disk | tiered} — or any composition — purely by config.
Fields
l1: Box<BackendConfig>L1 hot tier (typically Redis).
l2: Box<BackendConfig>L2 durable tier (typically Pg).
l3: Box<BackendConfig>L3 object tier (typically S3).
write_policy: WritePolicyHow puts propagate across the tiers.
Trait Implementations§
Source§impl Clone for BackendConfig
impl Clone for BackendConfig
Source§fn clone(&self) -> BackendConfig
fn clone(&self) -> BackendConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendConfig
impl Debug for BackendConfig
Source§impl Default for BackendConfig
impl Default for BackendConfig
Source§fn default() -> BackendConfig
fn default() -> BackendConfig
Source§impl<'de> Deserialize<'de> for BackendConfig
impl<'de> Deserialize<'de> for BackendConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BackendConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BackendConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for BackendConfig
impl Serialize for BackendConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for BackendConfig
impl RefUnwindSafe for BackendConfig
impl Send for BackendConfig
impl Sync for BackendConfig
impl Unpin for BackendConfig
impl UnsafeUnpin for BackendConfig
impl UnwindSafe for BackendConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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