pub struct PostgresPolicyStore { /* private fields */ }Expand description
PostgreSQL implementation of PolicyStore
Implementations§
Trait Implementations§
Source§impl PolicyStore for PostgresPolicyStore
impl PolicyStore for PostgresPolicyStore
Source§fn create_policy<'life0, 'async_trait>(
&'life0 self,
content: String,
) -> Pin<Box<dyn Future<Output = Result<String, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_policy<'life0, 'async_trait>(
&'life0 self,
content: String,
) -> Pin<Box<dyn Future<Output = Result<String, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new policy and return its ID
Source§fn get_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a policy by ID
Source§fn list_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all policies as (id, content) tuples
Source§fn update_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
content: String,
) -> Pin<Box<dyn Future<Output = Result<(), PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
content: String,
) -> Pin<Box<dyn Future<Output = Result<(), PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing policy
Source§fn delete_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a policy by ID
Source§fn load_all_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PolicySet, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_all_policies<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PolicySet, PolicyStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all policies as a PolicySet
Auto Trait Implementations§
impl Freeze for PostgresPolicyStore
impl !RefUnwindSafe for PostgresPolicyStore
impl Send for PostgresPolicyStore
impl Sync for PostgresPolicyStore
impl Unpin for PostgresPolicyStore
impl !UnwindSafe for PostgresPolicyStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more