Struct cedar_policy_core::ast::Request
source · pub struct Request { /* private fields */ }
Expand description
Represents the request tuple <P, A, R, C> (see the Cedar design doc).
Implementations§
source§impl Request
impl Request
sourcepub fn new<S: RequestSchema>(
principal: (EntityUID, Option<Loc>),
action: (EntityUID, Option<Loc>),
resource: (EntityUID, Option<Loc>),
context: Context,
schema: Option<&S>,
extensions: Extensions<'_>
) -> Result<Self, S::Error>
pub fn new<S: RequestSchema>( principal: (EntityUID, Option<Loc>), action: (EntityUID, Option<Loc>), resource: (EntityUID, Option<Loc>), context: Context, schema: Option<&S>, extensions: Extensions<'_> ) -> Result<Self, S::Error>
Default constructor.
If schema
is provided, this constructor validates that this Request
complies with the given schema
.
sourcepub fn new_with_unknowns<S: RequestSchema>(
principal: EntityUIDEntry,
action: EntityUIDEntry,
resource: EntityUIDEntry,
context: Option<Context>,
schema: Option<&S>,
extensions: Extensions<'_>
) -> Result<Self, S::Error>
pub fn new_with_unknowns<S: RequestSchema>( principal: EntityUIDEntry, action: EntityUIDEntry, resource: EntityUIDEntry, context: Option<Context>, schema: Option<&S>, extensions: Extensions<'_> ) -> Result<Self, S::Error>
Create a new Request
with potentially unknown (for partial eval) variables.
If schema
is provided, this constructor validates that this Request
complies with the given schema
(at least to the extent that we can
validate with the given information)
sourcepub fn new_unchecked(
principal: EntityUIDEntry,
action: EntityUIDEntry,
resource: EntityUIDEntry,
context: Option<Context>
) -> Self
pub fn new_unchecked( principal: EntityUIDEntry, action: EntityUIDEntry, resource: EntityUIDEntry, context: Option<Context> ) -> Self
Create a new Request
with potentially unknown (for partial eval) variables/context
and without schema validation.
sourcepub fn principal(&self) -> &EntityUIDEntry
pub fn principal(&self) -> &EntityUIDEntry
Get the principal associated with the request
sourcepub fn action(&self) -> &EntityUIDEntry
pub fn action(&self) -> &EntityUIDEntry
Get the action associated with the request
sourcepub fn resource(&self) -> &EntityUIDEntry
pub fn resource(&self) -> &EntityUIDEntry
Get the resource associated with the request
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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