#[non_exhaustive]pub enum KeyNaming<'a> {
Dotted(&'a str),
Env(&'a str),
}Expand description
How problem messages name a setting, so they match how the operator wrote it.
Dotted("mcp.oauth")names the issuermcp.oauth.issuer— a key in a YAML (or other serde) config nested under that path.Env("MYAPP_OAUTH_")names itMYAPP_OAUTH_ISSUER— the field name uppercased and appended to the prefix.
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.
Dotted(&'a str)
A dotted path prefix; a field is named <prefix>.<field>.
Env(&'a str)
An environment-variable prefix; a field is named <PREFIX><FIELD>.
Implementations§
Source§impl KeyNaming<'_>
impl KeyNaming<'_>
Sourcepub fn key(&self, field: &str) -> String
pub fn key(&self, field: &str) -> String
The name of setting field (a lower-case OAuthConfig field name).
Sourcepub fn section(&self) -> String
pub fn section(&self) -> String
The name of the whole block: the dotted prefix itself, or PREFIX* for
environment variables. An empty dotted prefix (the OAuth fields at the
root of the config) has no path to name, so the block is called
OAuth config rather than rendering as an empty string.
Sourcepub fn to_buf(&self) -> KeyNamingBuf
pub fn to_buf(&self) -> KeyNamingBuf
The owned form, for storing past the borrow.
Trait Implementations§
impl<'a> Copy for KeyNaming<'a>
impl<'a> Eq for KeyNaming<'a>
impl<'a> StructuralPartialEq for KeyNaming<'a>
Auto Trait Implementations§
impl<'a> Freeze for KeyNaming<'a>
impl<'a> RefUnwindSafe for KeyNaming<'a>
impl<'a> Send for KeyNaming<'a>
impl<'a> Sync for KeyNaming<'a>
impl<'a> Unpin for KeyNaming<'a>
impl<'a> UnsafeUnpin for KeyNaming<'a>
impl<'a> UnwindSafe for KeyNaming<'a>
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