#[non_exhaustive]pub enum Environment {
Development,
Test,
Staging,
Production,
}Expand description
Validated runtime environment shared by every Rullst subsystem.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Development
Local development with developer tooling enabled.
Test
Automated test execution.
Staging
Production-like pre-release deployment.
Production
Public production deployment with all secure defaults enabled.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn resolve(
rullst_env: Option<&str>,
app_env: Option<&str>,
configured_env: Option<&str>,
) -> Result<Self, ConfigError>
pub fn resolve( rullst_env: Option<&str>, app_env: Option<&str>, configured_env: Option<&str>, ) -> Result<Self, ConfigError>
Resolves environment sources using the documented precedence:
RULLST_ENV, legacy APP_ENV, then [app].env from Rullst.toml.
Sourcepub fn detect(configured_env: Option<&str>) -> Result<Self, ConfigError>
pub fn detect(configured_env: Option<&str>) -> Result<Self, ConfigError>
Resolves the environment from process variables and an optional config value.
Sourcepub const fn allows_development_tools(self) -> bool
pub const fn allows_development_tools(self) -> bool
Whether local-only developer tooling may be exposed.
Sourcepub const fn requires_secure_defaults(self) -> bool
pub const fn requires_secure_defaults(self) -> bool
Whether production security layers and secure cookies are mandatory.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
impl Copy for Environment
Source§impl Debug for Environment
impl Debug for Environment
Source§impl Default for Environment
impl Default for Environment
Source§impl Display for Environment
impl Display for Environment
impl Eq for Environment
Source§impl FromStr for Environment
impl FromStr for Environment
Source§impl Hash for Environment
impl Hash for Environment
Source§impl PartialEq for Environment
impl PartialEq for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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
Mutably borrows from an owned value. Read more
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP