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 duplicate 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 for Extensions
impl PartialEq for Extensions
impl Eq for Extensions
impl StructuralPartialEq for Extensions
Auto Trait Implementations§
impl Freeze for Extensions
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