pub struct Scopes { /* private fields */ }Expand description
An ordered set of resource scopes.
Scopes are used to create hierarchical identifiers for objects.
Implementations§
Source§impl Scopes
impl Scopes
Sourcepub fn get(&self, key: &str) -> Option<&Scope>
pub fn get(&self, key: &str) -> Option<&Scope>
Returns the scope with the given key, if it exists.
Sourcepub fn get_value(&self, key: &str) -> Option<&str>
pub fn get_value(&self, key: &str) -> Option<&str>
Returns the value of the scope with the given key, if it exists.
Sourcepub fn push<V>(&mut self, key: &str, value: V) -> Result<(), InvalidScopeError>where
V: Display,
pub fn push<V>(&mut self, key: &str, value: V) -> Result<(), InvalidScopeError>where
V: Display,
Pushes a new scope to the collection.
Sourcepub fn as_storage_path(&self) -> AsStoragePath<'_>
pub fn as_storage_path(&self) -> AsStoragePath<'_>
Returns a view that formats the scopes as path for storage.
This will serialize the scopes as {name}.{value}/..., which is intended to be used by
backends to reference the object in a storage system. This becomes part of the storage path
of an ObjectId.
Sourcepub fn as_api_path(&self) -> AsApiPath<'_>
pub fn as_api_path(&self) -> AsApiPath<'_>
Returns a view that formats the scopes as path for web API usage.
This will serialize the scopes as {name}={value};..., which is intended to be used by
clients to format URL paths.
Trait Implementations§
Source§impl FromIterator<Scope> for Scopes
impl FromIterator<Scope> for Scopes
Source§impl<'a> IntoIterator for &'a Scopes
impl<'a> IntoIterator for &'a Scopes
impl Eq for Scopes
impl StructuralPartialEq for Scopes
Auto Trait Implementations§
impl Freeze for Scopes
impl RefUnwindSafe for Scopes
impl Send for Scopes
impl Sync for Scopes
impl Unpin for Scopes
impl UnwindSafe for Scopes
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