pub fn find<P>(&self, p: P) -> Option<&AttributeValue>
    where
        P: Fn(&AttributeValue) -> bool,
    {
        match self {
            AttributeValue::String(_)
            | AttributeValue::Number(_)
            | AttributeValue::Bool(_)
            | AttributeValue::Object(_) => {
                if p(self) {
                    Some(self)
                } else {
                    None
                }
            }
            AttributeValue::Array(values) => values.iter().find(|v| p(v)),
            AttributeValue::Null => None,
        }
    }
/// Find the AttributeValue based off the provided predicate `p`.
Find the AttributeValue based off the provided predicate `p`.
Find the AttributeValue based off the provided predicate ` p ` .
pub fn find<P>(&self, p: P) -> Option<&AttributeValue>
    where
        P: Fn(&AttributeValue) -> bool,
    {
        match self {
            AttributeValue::String(_)
            | AttributeValue::Number(_)
            | AttributeValue::Bool(_)
            | AttributeValue::Object(_) => {
                if p(self) {
                    Some(self)
                } else {
                    None
                }
            }
            AttributeValue::Array(values) => values.iter().find(|v| p(v)),
            AttributeValue::Null => None,
        }
    }
pub fn find < P > ( & self , p : P ) -> Option < & AttributeValue > where P : Fn ( & AttributeValue ) -> bool , { match self { AttributeValue :: String ( _ ) | AttributeValue :: Number ( _ ) | AttributeValue :: Bool ( _ ) | AttributeValue :: Object ( _ ) => { if p ( self ) { Some ( self ) } else { None } } AttributeValue :: Array ( values ) => values . iter ( ) . find ( | v | p ( v ) ) , AttributeValue :: Null => None , } }
Find the AttributeValue based off the provided predicate `p`.
Find the AttributeValue based off the provided predicate ` p ` .
&self
p
P
&self
p
P