pub struct Key { /* private fields */ }Expand description
An application key and associated information.
Implementations§
Source§impl Key
impl Key
Sourcepub fn key_id(&self) -> &str
pub fn key_id(&self) -> &str
The application key ID. This, combined with the secret returned when the key was created, allows you to create an Authorization token to make API calls.
Sourcepub fn capabilities(&self) -> &[Capability]
pub fn capabilities(&self) -> &[Capability]
The list of capabilities granted by this key.
Sourcepub fn account_id(&self) -> &str
pub fn account_id(&self) -> &str
The account this key is for.
Sourcepub fn bucket_id(&self) -> Option<&String>
pub fn bucket_id(&self) -> Option<&String>
If present, this key’s capabilities are restricted to the returned bucket.
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 expiration(&self) -> Option<DateTime<Utc>>
pub fn expiration(&self) -> Option<DateTime<Utc>>
If present, the expiration date and time of this key.
Sourcepub fn has_capability(&self, cap: Capability) -> bool
pub fn has_capability(&self, cap: Capability) -> bool
Check if the provided capability is granted by this key.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Key
impl<'de> Deserialize<'de> for Key
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 Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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