pub struct MemoryGrantStore { /* private fields */ }Expand description
In-memory GrantStore for tests and single-node bootstrapping before the
persistent grant store lands. Cheap to clone — shares one backing map.
Implementations§
Source§impl MemoryGrantStore
impl MemoryGrantStore
pub fn new() -> Self
Sourcepub fn put(
&self,
principal: PrincipalId,
aud: impl Into<String>,
entries: Vec<ScopeOrBundle>,
)
pub fn put( &self, principal: PrincipalId, aud: impl Into<String>, entries: Vec<ScopeOrBundle>, )
Set (or overwrite) the grant entries the principal holds for aud.
Trait Implementations§
Source§impl Clone for MemoryGrantStore
impl Clone for MemoryGrantStore
Source§fn clone(&self) -> MemoryGrantStore
fn clone(&self) -> MemoryGrantStore
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 Default for MemoryGrantStore
impl Default for MemoryGrantStore
Source§fn default() -> MemoryGrantStore
fn default() -> MemoryGrantStore
Returns the “default value” for a type. Read more
Source§impl GrantStore for MemoryGrantStore
impl GrantStore for MemoryGrantStore
Source§fn list_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
principal: &'life1 PrincipalId,
aud: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScopeOrBundle>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
principal: &'life1 PrincipalId,
aud: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScopeOrBundle>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
All grant entries the principal holds for
aud. An empty list means
the principal is not entitled to mint a token for that audience — the
mint path MUST reject. Order is whatever the impl returns; mint-time
expansion dedupes (expand_scopes).Auto Trait Implementations§
impl Freeze for MemoryGrantStore
impl RefUnwindSafe for MemoryGrantStore
impl Send for MemoryGrantStore
impl Sync for MemoryGrantStore
impl Unpin for MemoryGrantStore
impl UnsafeUnpin for MemoryGrantStore
impl UnwindSafe for MemoryGrantStore
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