pub struct ScopeSet(/* private fields */);Expand description
A bounded set of unique scopes with deterministic canonical ordering.
The JSON wire form is an array sorted by exact ASCII byte order. Duplicate input is rejected rather than silently deduplicated. These properties make authorization decisions, audit records, and canonical hashes reproducible.
Implementations§
Source§impl ScopeSet
impl ScopeSet
Sourcepub fn try_new<I>(scopes: I) -> Result<Self, ScopeSetError>where
I: IntoIterator<Item = Scope>,
pub fn try_new<I>(scopes: I) -> Result<Self, ScopeSetError>where
I: IntoIterator<Item = Scope>,
Constructs a set from already validated scopes.
§Errors
Returns ScopeSetError on the first duplicate or when more than
ScopeSet::MAX_LEN distinct entries are observed. Iteration stops at
that point, so an unbounded iterator cannot cause unbounded work.
Sourcepub fn contains(&self, scope: &Scope) -> bool
pub fn contains(&self, scope: &Scope) -> bool
Returns true when the exact, case-sensitive scope is present.
Sourcepub fn is_subset(&self, other: &Self) -> bool
pub fn is_subset(&self, other: &Self) -> bool
Returns true when every scope in this set is present in other.
Sourcepub fn intersection(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
Returns the scopes granted by both sets.
Intersection can only narrow authority and cannot exceed either input’s validated size bound.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ScopeSet
impl<'de> Deserialize<'de> for ScopeSet
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>,
impl Eq for ScopeSet
Source§impl<'a> IntoIterator for &'a ScopeSet
impl<'a> IntoIterator for &'a ScopeSet
Source§impl JsonSchema for ScopeSet
impl JsonSchema for ScopeSet
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more