pub enum ConfigKeys {
KeyUrl,
KeyClientId,
KeyClientKey,
KeyAppKey,
KeyOwnerPublicKey,
KeyPrivateKey,
KeyServerPublicKeyId,
KeyBindingToken,
KeyBindingKey,
KeyHostname,
}Variants§
KeyUrl
KeyClientId
KeyClientKey
KeyAppKey
KeyOwnerPublicKey
KeyPrivateKey
KeyServerPublicKeyId
KeyBindingToken
KeyBindingKey
KeyHostname
Implementations§
Source§impl ConfigKeys
impl ConfigKeys
Sourcepub fn value(&self) -> &str
pub fn value(&self) -> &str
Returns the string value associated with the enum variant.
§Examples
use keeper_secrets_manager_core::config_keys::ConfigKeys;
let key = ConfigKeys::KeyUrl;
assert_eq!(key.value(), "url");§Panics
This method does not panic under normal circumstances. However, if you modify the match statement without providing all cases, it could lead to a panic.
Sourcepub fn key_from_str(value: &str) -> Option<Self>
pub fn key_from_str(value: &str) -> Option<Self>
Returns an optional ConfigKeys enum variant corresponding to the provided string value.
§Parameters
value: The string representation of the key.
§Returns
An Option<ConfigKeys> that will be Some if the string corresponds to a valid key,
and None otherwise.
§Examples
use keeper_secrets_manager_core::config_keys::ConfigKeys;
assert_eq!(ConfigKeys::key_from_str("url"), Some(ConfigKeys::KeyUrl));
assert_eq!(ConfigKeys::key_from_str("clientId"), Some(ConfigKeys::KeyClientId));
assert_eq!(ConfigKeys::key_from_str("unknown"), None);Sourcepub fn get_enum(value: &str) -> Option<Self>
pub fn get_enum(value: &str) -> Option<Self>
Returns an optional ConfigKeys enum variant from a string value,
allowing for additional variants using both the key name and the enum variant name.
§Parameters
value: The string representation of the key.
§Returns
An Option<ConfigKeys> that will be Some if the string corresponds to a valid key,
and None otherwise.
§Examples
use keeper_secrets_manager_core::config_keys::ConfigKeys;
assert_eq!(ConfigKeys::get_enum("url"), Some(ConfigKeys::KeyUrl));
assert_eq!(ConfigKeys::get_enum("clientId"), Some(ConfigKeys::KeyClientId));
assert_eq!(ConfigKeys::get_enum("invalidKey"), None);Trait Implementations§
Source§impl Clone for ConfigKeys
impl Clone for ConfigKeys
Source§fn clone(&self) -> ConfigKeys
fn clone(&self) -> ConfigKeys
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigKeys
impl Debug for ConfigKeys
Source§impl<'de> Deserialize<'de> for ConfigKeys
impl<'de> Deserialize<'de> for ConfigKeys
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
Source§impl Display for ConfigKeys
impl Display for ConfigKeys
Source§impl FromStr for ConfigKeys
impl FromStr for ConfigKeys
Source§impl Hash for ConfigKeys
impl Hash for ConfigKeys
Source§impl PartialEq for ConfigKeys
impl PartialEq for ConfigKeys
Source§impl Serialize for ConfigKeys
impl Serialize for ConfigKeys
Source§impl TryFrom<&str> for ConfigKeys
impl TryFrom<&str> for ConfigKeys
impl Eq for ConfigKeys
impl StructuralPartialEq for ConfigKeys
Auto Trait Implementations§
impl Freeze for ConfigKeys
impl RefUnwindSafe for ConfigKeys
impl Send for ConfigKeys
impl Sync for ConfigKeys
impl Unpin for ConfigKeys
impl UnwindSafe for ConfigKeys
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> 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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.