Struct zookeeper::Permission
[−]
[src]
pub struct Permission(_);
Describes the ability of a user to perform a certain action.
Permissions can be mixed together like integers with |
and &
.
Methods
impl Permission
[src]
pub const NONE: Permission
NONE: Permission = Permission(0)
No permissions are set (server could have been configured without ACL support).
pub const READ: Permission
READ: Permission = Permission(1)
You can access the data of a node and can list its children.
pub const WRITE: Permission
WRITE: Permission = Permission(2)
You can set the data of a node.
pub const CREATE: Permission
CREATE: Permission = Permission(4)
You can create a child node.
pub const DELETE: Permission
DELETE: Permission = Permission(8)
You can delete a child node (but not necessarily this one).
pub const ADMIN: Permission
ADMIN: Permission = Permission(16)
You can alter permissions on this node.
pub const ALL: Permission
ALL: Permission = Permission(31)
You can do anything.
pub fn can(self, permissions: Permission) -> bool
[src]
Check that all permissions
are set.
use zookeeper::Permission; (Permission::READ | Permission::WRITE).can(Permission::WRITE); // -> true Permission::ADMIN.can(Permission::CREATE); // -> false
Trait Implementations
impl Clone for Permission
[src]
fn clone(&self) -> Permission
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Permission
[src]
impl Debug for Permission
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for Permission
[src]
fn eq(&self, __arg_0: &Permission) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Permission) -> bool
[src]
This method tests for !=
.
impl BitAnd for Permission
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, rhs: Self) -> Self
[src]
Performs the &
operation.
impl BitOr for Permission
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self
[src]
Performs the |
operation.