pub struct EnvironmentsConfig {
pub dev: EnvironmentConfig,
pub staging: Option<EnvironmentConfig>,
pub prod: EnvironmentConfig,
}Expand description
Per-environment configuration (dev, staging, prod), with the active environment selected via
the MECHA10_ENV environment variable or --env flag.
Fields§
§dev: EnvironmentConfigDevelopment environment (local control plane)
staging: Option<EnvironmentConfig>Staging environment (optional)
prod: EnvironmentConfigProduction environment (cloud control plane)
Implementations§
Source§impl EnvironmentsConfig
impl EnvironmentsConfig
Sourcepub fn get(&self, env: &str) -> Option<&EnvironmentConfig>
pub fn get(&self, env: &str) -> Option<&EnvironmentConfig>
Get the environment config for the given environment name
Sourcepub fn current(&self) -> &EnvironmentConfig
pub fn current(&self) -> &EnvironmentConfig
Get the current environment config based on MECHA10_ENV
Sourcepub fn current_env_name(&self) -> String
pub fn current_env_name(&self) -> String
Resolve the name of the currently active environment (“dev”/“staging”/“prod”/etc), per
the precedence documented on this struct: the MECHA10_ENV environment variable,
falling back to “dev” when unset.
Sourcepub fn control_plane_url(&self) -> String
pub fn control_plane_url(&self) -> String
Get the control plane URL for the current environment
Sourcepub fn dashboard_url(&self) -> String
pub fn dashboard_url(&self) -> String
Get the dashboard URL for the current environment: {control_plane}/dashboard
Sourcepub fn relay_url(&self) -> String
pub fn relay_url(&self) -> String
Get the WebRTC relay URL for the current environment (camera signaling only; the
websocket-bridge node uses ${CONTROL_PLANE_URL}/ws-relay for general messaging).
Sourcepub fn disk_logging_enabled(&self) -> bool
pub fn disk_logging_enabled(&self) -> bool
Whether disk-based logging is enabled for the current environment, defaulting to
true when it has no logging section (see EnvironmentConfig::disk_logging_enabled).
Trait Implementations§
Source§impl Clone for EnvironmentsConfig
impl Clone for EnvironmentsConfig
Source§fn clone(&self) -> EnvironmentsConfig
fn clone(&self) -> EnvironmentsConfig
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 EnvironmentsConfig
impl Debug for EnvironmentsConfig
Source§impl Default for EnvironmentsConfig
impl Default for EnvironmentsConfig
Source§fn default() -> EnvironmentsConfig
fn default() -> EnvironmentsConfig
Source§impl<'de> Deserialize<'de> for EnvironmentsConfig
impl<'de> Deserialize<'de> for EnvironmentsConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnvironmentsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnvironmentsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for EnvironmentsConfig
impl JsonSchema for EnvironmentsConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for EnvironmentsConfig
impl Serialize for EnvironmentsConfig
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 EnvironmentsConfig
impl RefUnwindSafe for EnvironmentsConfig
impl Send for EnvironmentsConfig
impl Sync for EnvironmentsConfig
impl Unpin for EnvironmentsConfig
impl UnsafeUnpin for EnvironmentsConfig
impl UnwindSafe for EnvironmentsConfig
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> 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