pub enum CryptObject {
Identifier(String),
String(String),
Body(CryptConfig),
Null,
}Expand description
An ambiguously wrapped object in a crypt config.
crypt objects come in four variants: identifiers, string literals, bodies (nested configs), and nulls.
CryptObject implements TryInto for &String and &CryptConfig for quick conversions. More complex conversion methods are additionally implemented.
Variants§
Implementations§
Source§impl CryptObject
impl CryptObject
Sourcepub fn unwrap_identifier(&self) -> &String
pub fn unwrap_identifier(&self) -> &String
Sourcepub fn expect_identifier(&self, msg: &str) -> &String
pub fn expect_identifier(&self, msg: &str) -> &String
Sourcepub fn unwrap_identifier_or<'a>(&'a self, other: &'a String) -> &'a String
pub fn unwrap_identifier_or<'a>(&'a self, other: &'a String) -> &'a String
Unwraps an identifier crypt object into its string value, alternatively if the object isn’t an identifier it will return the alternate string value.
Sourcepub fn unwrap_string(&self) -> &String
pub fn unwrap_string(&self) -> &String
Sourcepub fn expect_string(&self, msg: &str) -> &String
pub fn expect_string(&self, msg: &str) -> &String
Sourcepub fn unwrap_string_or<'a>(&'a self, other: &'a String) -> &'a String
pub fn unwrap_string_or<'a>(&'a self, other: &'a String) -> &'a String
Unwraps a string literal crypt object into its string value, alternatively if the object isn’t a string literal it will return the alternate string value.
Sourcepub fn unwrap_nested_config(&self) -> &CryptConfig
pub fn unwrap_nested_config(&self) -> &CryptConfig
Sourcepub fn expect_nested_config(&self, msg: &str) -> &CryptConfig
pub fn expect_nested_config(&self, msg: &str) -> &CryptConfig
Trait Implementations§
Source§impl Debug for CryptObject
impl Debug for CryptObject
impl Eq for CryptObject
Source§impl PartialEq for CryptObject
impl PartialEq for CryptObject
Source§fn eq(&self, other: &CryptObject) -> bool
fn eq(&self, other: &CryptObject) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CryptObject
Source§impl<'a> TryInto<&'a CryptConfig> for &'a CryptObject
impl<'a> TryInto<&'a CryptConfig> for &'a CryptObject
Source§type Error = CryptConversionError
type Error = CryptConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for CryptObject
impl RefUnwindSafe for CryptObject
impl Send for CryptObject
impl Sync for CryptObject
impl Unpin for CryptObject
impl UnsafeUnpin for CryptObject
impl UnwindSafe for CryptObject
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