Enum jwt_simple::claims::Audiences
source · pub enum Audiences {
AsSet(HashSet<String>),
AsString(String),
}
Expand description
Depending on applications, the audiences
property may be either a set or a
string. We support both.
Variants§
Implementations§
source§impl Audiences
impl Audiences
sourcepub fn contains(&self, allowed_audiences: &HashSet<String>) -> bool
pub fn contains(&self, allowed_audiences: &HashSet<String>) -> bool
Return true
if the audiences include any of the allowed_audiences
entries
sourcepub fn into_string(self) -> Result<String, Error>
pub fn into_string(self) -> Result<String, Error>
Get the audiences as a string. If it was originally serialized as a set, it can be only converted to a string if it contains at most one element.