pub struct Document {
pub(crate) statements: Vec<Statement>,
pub(crate) set: PolicySet,
warnings: Vec<String>,
}Expand description
A loaded document: its statements keyed by @id, and the policy set
the authorizer runs, which is those statements plus the baseline permit.
Fields§
§statements: Vec<Statement>§set: PolicySet§warnings: Vec<String>Implementations§
Source§impl Document
impl Document
Source§impl Document
impl Document
Sourcepub fn decide(
&self,
request: &Request<'_>,
shapes: &Shapes,
) -> Result<Decision, RequestError>
pub fn decide( &self, request: &Request<'_>, shapes: &Shapes, ) -> Result<Decision, RequestError>
Judge request. The first statement in document order that fails
wins over any that fired, so a typo is reported before anything it
might have hidden.
§Errors
The request itself could not be built. Nothing was evaluated, and the caller refuses.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more