pub struct Policy { /* private fields */ }Expand description
Compiled bucket policy ready to evaluate requests.
Implementations§
Source§impl Policy
impl Policy
pub fn from_json_str(s: &str) -> Result<Self, String>
pub fn from_path(path: &Path) -> Result<Self, String>
Sourcepub fn evaluate(
&self,
action: &str,
bucket: &str,
key: Option<&str>,
principal_id: Option<&str>,
) -> Decision
pub fn evaluate( &self, action: &str, bucket: &str, key: Option<&str>, principal_id: Option<&str>, ) -> Decision
Evaluate a request against the policy.
principal_id is typically the SigV4 access key id taken from the
authenticated request. Pass None for anonymous (will only match
statements with wildcard or absent Principal).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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