pub struct Acl(/* private fields */);Expand description
An ACL. Insertion-ordered, because the order of _rperm and _wperm is observable in
golden-file comparison even though it carries no meaning.
Implementations§
Source§impl Acl
impl Acl
pub fn new() -> Self
pub fn set(&mut self, principal: Principal, perms: Permissions)
pub fn get(&self, principal: &Principal) -> Option<Permissions>
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = (&Principal, &Permissions)>
Sourcepub fn to_perms(&self) -> (Vec<String>, Vec<String>)
pub fn to_perms(&self) -> (Vec<String>, Vec<String>)
Lower to the storage form. An entry with neither permission appears in neither array, which is what makes the JSON round trip lossy.
Sourcepub fn from_perms(
rperm: Option<&[String]>,
wperm: Option<&[String]>,
) -> Option<Acl>
pub fn from_perms( rperm: Option<&[String]>, wperm: Option<&[String]>, ) -> Option<Acl>
Rebuild from the storage form, reproducing untransformObjectACL exactly.
Returns None when both columns are absent, which is the case that must produce no ACL
key in the response rather than an empty one. Some(empty Acl) is the distinct case where
a column is present but empty, which upstream renders as "ACL": {}.
Trait Implementations§
impl Eq for Acl
impl StructuralPartialEq for Acl
Auto Trait Implementations§
impl Freeze for Acl
impl RefUnwindSafe for Acl
impl Send for Acl
impl Sync for Acl
impl Unpin for Acl
impl UnsafeUnpin for Acl
impl UnwindSafe for Acl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.