pub struct ApiKeyRecord {
pub id: i64,
pub prefix: String,
pub hash: String,
pub scopes: Vec<String>,
}Expand description
A stored API-key record: its DB id, display prefix, hex hash, and scopes.
Fields§
§id: i64§prefix: String§hash: String§scopes: Vec<String>Implementations§
Source§impl ApiKeyRecord
impl ApiKeyRecord
Sourcepub fn require_scope(&self, needed: &str) -> Result<()>
pub fn require_scope(&self, needed: &str) -> Result<()>
Ok(()) if this key carries needed (or the "*" wildcard); else 403.
Trait Implementations§
Source§impl Clone for ApiKeyRecord
impl Clone for ApiKeyRecord
Source§fn clone(&self) -> ApiKeyRecord
fn clone(&self) -> ApiKeyRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ApiKeyRecord
impl Debug for ApiKeyRecord
impl Eq for ApiKeyRecord
Source§impl PartialEq for ApiKeyRecord
impl PartialEq for ApiKeyRecord
Source§fn eq(&self, other: &ApiKeyRecord) -> bool
fn eq(&self, other: &ApiKeyRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ApiKeyRecord
Auto Trait Implementations§
impl Freeze for ApiKeyRecord
impl RefUnwindSafe for ApiKeyRecord
impl Send for ApiKeyRecord
impl Sync for ApiKeyRecord
impl Unpin for ApiKeyRecord
impl UnsafeUnpin for ApiKeyRecord
impl UnwindSafe for ApiKeyRecord
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