pub enum Env {
Dev,
Test,
Prod,
}Expand description
App environment
Variants§
Implementations§
Source§impl Env
impl Env
Sourcepub fn init() -> Self
pub fn init() -> Self
Initializes environment variables from the .env file and reads SPRING_ENV to determine the active environment for the application.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read SPRING_ENV to determine the environment of the active application.
If there is no SPRING_ENV variable, it defaults to Dev
Sourcepub fn from_string<S: Into<String>>(str: S) -> Self
pub fn from_string<S: Into<String>>(str: S) -> Self
Parse the string to get the corresponding environment
Trait Implementations§
impl Copy for Env
Auto Trait Implementations§
impl Freeze for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnwindSafe for Env
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)