pub enum BackendConfig {
Redis {
url: String,
},
Kubernetes {
namespace: String,
},
}Expand description
Configuration for a distributed backend (Redis or Kubernetes CRDs).
Variants§
Redis
Redis backend — persistent, horizontally scalable
Kubernetes
Kubernetes CRD backend — native K8s integration
Implementations§
Source§impl BackendConfig
impl BackendConfig
Sourcepub fn from_env() -> Result<Self, String>
pub fn from_env() -> Result<Self, String>
Create backend config from MX_METADATA_BACKEND. Used by both the P2P state
manager and the registry manager so they share a single env-var contract.
Valid values: redis, kubernetes | k8s | crd.
Errors if MX_METADATA_BACKEND is unset/invalid, or if the connection env for
the selected backend is missing (no silent fallback to localhost:6379 /
default namespace, since those mask misconfig in production).
Sourcepub fn from_type_str(
env_name: &str,
backend_type: &str,
redis_url: &str,
k8s_namespace: &str,
) -> Result<Self, String>
pub fn from_type_str( env_name: &str, backend_type: &str, redis_url: &str, k8s_namespace: &str, ) -> Result<Self, String>
Parse a backend type string into a config. Testable without env vars — callers supply the connection strings directly.
env_name appears in the error message so the caller knows which variable was bad.
Sourcepub fn redis_url_from_env() -> Result<String, String>
pub fn redis_url_from_env() -> Result<String, String>
Return the Redis connection URL from env. Accepts either REDIS_URL directly, or
MX_REDIS_HOST + MX_REDIS_PORT (with REDIS_HOST / REDIS_PORT fallbacks for
compatibility with charts that predate the MX_ prefix). Errors when neither the
URL nor both host-and-port pieces are provided.
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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.