Struct b2_client::account::Capabilities
source · [−]pub struct Capabilities { /* private fields */ }Expand description
The set of capabilities and associated information granted by an authorization token.
Implementations
sourceimpl Capabilities
impl Capabilities
sourcepub fn capabilities(&self) -> &[Capability]
pub fn capabilities(&self) -> &[Capability]
The list of capabilities granted.
sourcepub fn bucket_id(&self) -> Option<&String>
pub fn bucket_id(&self) -> Option<&String>
If the capabilities are limited to a single bucket, this is the bucket’s ID.
sourcepub fn bucket_name(&self) -> Option<&String>
pub fn bucket_name(&self) -> Option<&String>
If the bucket is valid and hasn’t been deleted, the name of the bucket
corresponding to bucket_id. If the bucket referred to by bucket_id
no longer exists, this will be None.
sourcepub fn name_prefix(&self) -> Option<&String>
pub fn name_prefix(&self) -> Option<&String>
If set, access is limited to files whose names begin with this prefix.
sourcepub fn has_capability(&self, cap: Capability) -> bool
pub fn has_capability(&self, cap: Capability) -> bool
Check if the provided capability is granted to the object containing this Capabilities object.
Trait Implementations
sourceimpl Clone for Capabilities
impl Clone for Capabilities
sourcefn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Capabilities
impl Debug for Capabilities
sourceimpl<'de> Deserialize<'de> for Capabilities
impl<'de> Deserialize<'de> for Capabilities
sourcefn 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 RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnwindSafe for Capabilities
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more