pub struct EnvKey(/* private fields */);Expand description
A validated environment variable key.
Implementations§
Source§impl EnvKey
impl EnvKey
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, EnvKeyError>
pub fn new(value: impl AsRef<str>) -> Result<Self, EnvKeyError>
Creates an environment variable key.
§Errors
Returns EnvKeyError::Empty when the trimmed input is empty and
EnvKeyError::ContainsEquals when the key contains =.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the key and returns the owned string.
Trait Implementations§
Source§impl Ord for EnvKey
impl Ord for EnvKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for EnvKey
impl PartialOrd for EnvKey
impl Eq for EnvKey
impl StructuralPartialEq for EnvKey
Auto Trait Implementations§
impl Freeze for EnvKey
impl RefUnwindSafe for EnvKey
impl Send for EnvKey
impl Sync for EnvKey
impl Unpin for EnvKey
impl UnsafeUnpin for EnvKey
impl UnwindSafe for EnvKey
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