pub enum ContextValue {
String(String),
Boolean(bool),
Number(f64),
DateTime(DateTime<Utc>),
StringList(Vec<String>),
BooleanList(Vec<bool>),
}
Expand description
Represents different types of context values
Variants§
String(String)
String value (e.g., user ID, IP address)
Boolean(bool)
Boolean value (e.g., MFA present)
Number(f64)
Numeric value (e.g., MFA age in seconds, epoch time)
DateTime(DateTime<Utc>)
DateTime
value (e.g., request time)
StringList(Vec<String>)
List of strings (e.g., list of ARNs)
BooleanList(Vec<bool>)
List of booleans
Implementations§
Source§impl ContextValue
impl ContextValue
Sourcepub fn as_string(&self) -> Option<&String>
pub fn as_string(&self) -> Option<&String>
Converts the context value to a string representation
Sourcepub fn as_boolean(&self) -> Option<bool>
pub fn as_boolean(&self) -> Option<bool>
Converts the context value to a boolean
Sourcepub fn as_datetime(&self) -> Option<&DateTime<Utc>>
pub fn as_datetime(&self) -> Option<&DateTime<Utc>>
Converts the context value to a DateTime
Sourcepub fn as_string_list(&self) -> Option<&Vec<String>>
pub fn as_string_list(&self) -> Option<&Vec<String>>
Converts the context value to a list of strings
Trait Implementations§
Source§impl Clone for ContextValue
impl Clone for ContextValue
Source§fn clone(&self) -> ContextValue
fn clone(&self) -> ContextValue
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 ContextValue
impl Debug for ContextValue
Source§impl<'de> Deserialize<'de> for ContextValue
impl<'de> Deserialize<'de> for ContextValue
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 PartialEq for ContextValue
impl PartialEq for ContextValue
Source§impl Serialize for ContextValue
impl Serialize for ContextValue
impl StructuralPartialEq for ContextValue
Auto Trait Implementations§
impl Freeze for ContextValue
impl RefUnwindSafe for ContextValue
impl Send for ContextValue
impl Sync for ContextValue
impl Unpin for ContextValue
impl UnwindSafe for ContextValue
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