Struct oxide_auth::primitives::grant::Extensions
source · pub struct Extensions { /* private fields */ }
Expand description
Links one or several GrantExtension
instances to their respective data.
This also serves as a clean interface for both frontend and backend to reliably and conveniently manipulate or query the stored data sets.
Implementations§
source§impl Extensions
impl Extensions
sourcepub fn new() -> Extensions
pub fn new() -> Extensions
Create a new extension store.
sourcepub fn set(&mut self, extension: &dyn GrantExtension, content: Value)
pub fn set(&mut self, extension: &dyn GrantExtension, content: Value)
Set the stored content for a GrantExtension
instance.
sourcepub fn set_raw(&mut self, identifier: String, content: Value)
pub fn set_raw(&mut self, identifier: String, content: Value)
Set content for an extension without a corresponding instance.
sourcepub fn remove(&mut self, extension: &dyn GrantExtension) -> Option<Value>
pub fn remove(&mut self, extension: &dyn GrantExtension) -> Option<Value>
Retrieve the stored data of an instance.
This removes the data from the store to avoid possible mixups and to allow a copyless retrieval of bigger data strings.
sourcepub fn public(&self) -> PublicExtensions<'_> ⓘ
pub fn public(&self) -> PublicExtensions<'_> ⓘ
Iterate of the public extensions whose presence and content is not secret.
sourcepub fn private(&self) -> PrivateExtensions<'_> ⓘ
pub fn private(&self) -> PrivateExtensions<'_> ⓘ
Iterate of the private extensions whose presence and content must not be revealed.
Trait Implementations§
source§impl Clone for Extensions
impl Clone for Extensions
source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
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 Extensions
impl Debug for Extensions
source§impl Default for Extensions
impl Default for Extensions
source§fn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
source§impl PartialEq<Extensions> for Extensions
impl PartialEq<Extensions> for Extensions
source§fn eq(&self, other: &Extensions) -> bool
fn eq(&self, other: &Extensions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Extensions
impl StructuralEq for Extensions
impl StructuralPartialEq for Extensions
Auto Trait Implementations§
impl RefUnwindSafe for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl UnwindSafe for Extensions
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