pub struct PartialRequest { /* private fields */ }Available on crate feature
tpe only.Expand description
Represents the request tuple <P, A, R, C> (see the Cedar design doc).
Implementations§
Source§impl PartialRequest
impl PartialRequest
Sourcepub fn new(
principal: PartialEntityUID,
action: EntityUID,
resource: PartialEntityUID,
context: Option<Arc<BTreeMap<SmolStr, Value>>>,
schema: &ValidatorSchema,
) -> Result<Self, RequestValidationError>
pub fn new( principal: PartialEntityUID, action: EntityUID, resource: PartialEntityUID, context: Option<Arc<BTreeMap<SmolStr, Value>>>, schema: &ValidatorSchema, ) -> Result<Self, RequestValidationError>
Create a well-formed PartialRequest (i.e., it conforms to the schema)
Sourcepub fn check_consistency(
&self,
request: &Request,
) -> Result<(), RequestConsistencyError>
pub fn check_consistency( &self, request: &Request, ) -> Result<(), RequestConsistencyError>
Check consistency between a PartialRequest and a Request
Sourcepub fn principal_type(&self) -> &EntityType
pub fn principal_type(&self) -> &EntityType
Get the EntityType of principal
Sourcepub fn resource_type(&self) -> &EntityType
pub fn resource_type(&self) -> &EntityType
Get the EntityType of resource
Sourcepub fn principal(&self) -> &PartialEntityUID
pub fn principal(&self) -> &PartialEntityUID
Get the principal
Sourcepub fn resource(&self) -> &PartialEntityUID
pub fn resource(&self) -> &PartialEntityUID
Get the resource
Trait Implementations§
Source§impl Clone for PartialRequest
impl Clone for PartialRequest
Source§fn clone(&self) -> PartialRequest
fn clone(&self) -> PartialRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PartialRequest
impl RefUnwindSafe for PartialRequest
impl Send for PartialRequest
impl Sync for PartialRequest
impl Unpin for PartialRequest
impl UnsafeUnpin for PartialRequest
impl UnwindSafe for PartialRequest
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,
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