Enum env_parser::EnvType
source · pub enum EnvType {
Bool(bool),
I32(i32),
I64(i64),
I128(i128),
U8(u8),
U32(u32),
U128(u128),
F32(f32),
F64(f64),
USize(usize),
StaticStr(String),
Custom(Box<dyn CustomMap>),
}
Expand description
The different values an env file can hold
Variants§
Bool(bool)
I32(i32)
I64(i64)
I128(i128)
U8(u8)
U32(u32)
U128(u128)
F32(f32)
F64(f64)
USize(usize)
StaticStr(String)
Custom(Box<dyn CustomMap>)
Implementations§
source§impl EnvType
impl EnvType
sourcepub fn value(&self) -> String
pub fn value(&self) -> String
Adds the type if needed behind the raw value This is needed if the user wants the value 1 to be an f32. If you only type:
ⓘ
const MY_VARIABLE: f32 = 1;
The following compile error occurs: mismatched types [E0308] expected f32
, found i32
That’s why the type is needed behind the value:
const MY_VARIABLE: f32 = 1f32;
Auto Trait Implementations§
impl !RefUnwindSafe for EnvType
impl !Send for EnvType
impl !Sync for EnvType
impl Unpin for EnvType
impl !UnwindSafe for EnvType
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