pub struct FileGrantStore { /* private fields */ }Expand description
File-based grant store.
Grants are persisted to a JSON file. The file is created automatically when the first grant is stored.
Implementations§
Trait Implementations§
Source§impl GrantStore for FileGrantStore
impl GrantStore for FileGrantStore
Source§fn save<'life0, 'async_trait>(
&'life0 self,
grant: Grant,
) -> Pin<Box<dyn Future<Output = Result<(), GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
grant: Grant,
) -> Pin<Box<dyn Future<Output = Result<(), GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save a grant to storage.
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
tool: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Grant>, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
tool: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Grant>, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load all grants for a specific tool.
Source§fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Grant>, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Grant>, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all grants across all tools.
Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params_hash: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<bool, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params_hash: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<bool, GrantStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a specific grant. Read more
Auto Trait Implementations§
impl !Freeze for FileGrantStore
impl RefUnwindSafe for FileGrantStore
impl Send for FileGrantStore
impl Sync for FileGrantStore
impl Unpin for FileGrantStore
impl UnwindSafe for FileGrantStore
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