pub struct MemoryPolicyStore { /* private fields */ }Expand description
A DashMap-backed PolicyStore for tests and local development.
The store is authoritative — it holds the policies directly rather than
caching a remote source — so invalidate is a
no-op (there is no upstream to reload from). Cloning shares the same
underlying map.
Implementations§
Trait Implementations§
Source§impl Clone for MemoryPolicyStore
impl Clone for MemoryPolicyStore
Source§fn clone(&self) -> MemoryPolicyStore
fn clone(&self) -> MemoryPolicyStore
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 MemoryPolicyStore
impl Default for MemoryPolicyStore
Source§fn default() -> MemoryPolicyStore
fn default() -> MemoryPolicyStore
Returns the “default value” for a type. Read more
Source§impl PolicyStore for MemoryPolicyStore
impl PolicyStore for MemoryPolicyStore
Source§fn get_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Result<PolicyDocument>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Result<PolicyDocument>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the effective policy for
agent_id. Read moreSource§fn invalidate<'life0, 'life1, 'async_trait>(
&'life0 self,
_agent_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invalidate<'life0, 'life1, 'async_trait>(
&'life0 self,
_agent_id: &'life1 AgentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Drop any cached policy for
agent_id so the next read reloads it. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MemoryPolicyStore
impl !UnwindSafe for MemoryPolicyStore
impl Freeze for MemoryPolicyStore
impl Send for MemoryPolicyStore
impl Sync for MemoryPolicyStore
impl Unpin for MemoryPolicyStore
impl UnsafeUnpin for MemoryPolicyStore
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