pub struct TpeResponse<'a>(/* private fields */);tpe only.Expand description
A partial version of crate::Response.
Implementations§
Source§impl TpeResponse<'_>
impl TpeResponse<'_>
Perform reauthorization
Sourcepub fn residual_policies(&self) -> impl Iterator<Item = Policy> + '_
pub fn residual_policies(&self) -> impl Iterator<Item = Policy> + '_
Return residuals as Policys.
Each returned Policy inherits its PolicyId and
annotations from the corresponding input policy. Its scope is
unconstrained and its condition is a single when clause containing
the residual expression.
Use TpeResponse::nontrivial_residual_policies to skip trivially
true or false residuals.
The returned policies can be converted to PST for structured inspection of the residual expression tree:
let response = policy_set.tpe(&request, &entities, &schema)?;
for policy in response.residual_policies() {
let pst_policy = policy.to_pst()?;
for clause in pst_policy.body().clauses() {
// inspect the residual expression via pst::Clause / pst::Expr
}
}Sourcepub fn nontrivial_residual_policies(&self) -> impl Iterator<Item = Policy> + '_
pub fn nontrivial_residual_policies(&self) -> impl Iterator<Item = Policy> + '_
Returns an iterator of non-trivial (meaning more than just true
or false) residuals as Policys.
Each returned Policy inherits its PolicyId and
annotations from the corresponding input policy. Its scope is
unconstrained and its condition is a single when clause containing
the residual expression.
Call Policy::to_pst() on each result to get a crate::pst::Policy
for structured inspection. Residual expressions may contain
crate::pst::Expr::ResidualError nodes indicating subexpressions that
would error at runtime; use crate::pst::Expr::has_error() to check.
Trait Implementations§
Source§impl<'a> Clone for TpeResponse<'a>
impl<'a> Clone for TpeResponse<'a>
Source§fn clone(&self) -> TpeResponse<'a>
fn clone(&self) -> TpeResponse<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for TpeResponse<'a>
impl<'a> Debug for TpeResponse<'a>
Auto Trait Implementations§
impl<'a> Freeze for TpeResponse<'a>
impl<'a> RefUnwindSafe for TpeResponse<'a>
impl<'a> Send for TpeResponse<'a>
impl<'a> Sync for TpeResponse<'a>
impl<'a> Unpin for TpeResponse<'a>
impl<'a> UnsafeUnpin for TpeResponse<'a>
impl<'a> UnwindSafe for TpeResponse<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more