pub struct PermissionValidator { /* private fields */ }Expand description
Permission validator
Implementations§
Source§impl PermissionValidator
impl PermissionValidator
Sourcepub fn add_rule(&mut self, rule: ValidationRule) -> Result<()>
pub fn add_rule(&mut self, rule: ValidationRule) -> Result<()>
Register an additional rule.
permission_pattern selects which permissions the rule applies to: it
is matched as a case-insensitive substring against the permission’s
rendered form, and an empty pattern applies the rule to every
permission. Until 0.3.2 rules was an empty vector that nothing could
populate and validate_permission never consulted, so a deployment’s
own policy had no way in.
Sourcepub fn rules(&self) -> &[ValidationRule]
pub fn rules(&self) -> &[ValidationRule]
Registered rules, in the order they will be applied.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PermissionValidator
impl RefUnwindSafe for PermissionValidator
impl Send for PermissionValidator
impl Sync for PermissionValidator
impl Unpin for PermissionValidator
impl UnsafeUnpin for PermissionValidator
impl UnwindSafe for PermissionValidator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.