pub struct Policy {
pub version: String,
pub statement: Vec<Statement>,
}
Expand description
权限策略
Fields§
§version: String
策略语法版本
statement: Vec<Statement>
策略声明列表
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn add_statement(self, statement: Statement) -> Self
pub fn add_statement(self, statement: Statement) -> Self
添加策略声明
Sourcepub fn allow_put_object(bucket: &str, prefix: Option<&str>) -> Self
pub fn allow_put_object(bucket: &str, prefix: Option<&str>) -> Self
创建允许上传对象的策略
Sourcepub fn allow_get_object(bucket: &str, prefix: Option<&str>) -> Self
pub fn allow_get_object(bucket: &str, prefix: Option<&str>) -> Self
创建允许下载对象的策略
Sourcepub fn allow_delete_object(bucket: &str, prefix: Option<&str>) -> Self
pub fn allow_delete_object(bucket: &str, prefix: Option<&str>) -> Self
创建允许删除对象的策略
Sourcepub fn allow_read_write(bucket: &str, prefix: Option<&str>) -> Self
pub fn allow_read_write(bucket: &str, prefix: Option<&str>) -> Self
创建允许上传和下载对象的策略
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Policy
impl<'de> Deserialize<'de> for Policy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin 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