Struct etcd_client::Permission
source · pub struct Permission { /* private fields */ }
Expand description
Role access permission.
Implementations§
source§impl Permission
impl Permission
sourcepub fn new(perm_type: PermissionType, key: impl Into<Vec<u8>>) -> Self
pub fn new(perm_type: PermissionType, key: impl Into<Vec<u8>>) -> Self
Creates a permission with operation type and key
sourcepub fn read_write(key: impl Into<Vec<u8>>) -> Self
pub fn read_write(key: impl Into<Vec<u8>>) -> Self
Creates a read write permission with key
sourcepub fn with_range_end(self, range_end: impl Into<Vec<u8>>) -> Self
pub fn with_range_end(self, range_end: impl Into<Vec<u8>>) -> Self
Sets range end for the permission
sourcepub fn with_from_key(self) -> Self
pub fn with_from_key(self) -> Self
Sets the permission with all keys >= key.
sourcepub fn with_prefix(self) -> Self
pub fn with_prefix(self) -> Self
Sets the permission with all keys prefixed with key.
sourcepub fn with_all_keys(self) -> Self
pub fn with_all_keys(self) -> Self
Sets the permission with all keys.
sourcepub unsafe fn key_str_unchecked(&self) -> &str
pub unsafe fn key_str_unchecked(&self) -> &str
sourcepub fn range_end_str(&self) -> Result<&str, Error>
pub fn range_end_str(&self) -> Result<&str, Error>
The range end in string.
sourcepub unsafe fn range_end_str_unchecked(&self) -> &str
pub unsafe fn range_end_str_unchecked(&self) -> &str
sourcepub const fn is_from_key(&self) -> bool
pub const fn is_from_key(&self) -> bool
Indicates whether permission is with keys >= key.
Trait Implementations§
source§impl Clone for Permission
impl Clone for Permission
source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Permission
impl Debug for Permission
source§impl PartialEq<Permission> for Permission
impl PartialEq<Permission> for Permission
Auto Trait Implementations§
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request