pub struct EnvKey(/* private fields */);Expand description
The name of an environment variable: non-empty, with no = and no NUL, so
the operating system accepts it as one.
Deserializes from a TOML string and rejects any other name at load time.
§Examples
use mcpls_core::config::EnvKey;
assert_eq!(EnvKey::new("RUST_LOG").unwrap(), "RUST_LOG");
assert!(EnvKey::new("").is_err());
assert!(EnvKey::new("A=B").is_err());Implementations§
Source§impl EnvKey
impl EnvKey
Sourcepub const fn from_static(text: &'static str) -> Self
pub const fn from_static(text: &'static str) -> Self
Builds the value from a literal, checked at compile time when
evaluated in a const context.
§Panics
Panics if the literal is not a valid value of this type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EnvKey
impl<'de> Deserialize<'de> for EnvKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EnvKey
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for EnvKey
impl PartialOrd 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.