pub struct PolicyDecisionsRepo { /* private fields */ }Expand description
PostgreSQL repository for durable policy-decision history.
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;Implementations§
Source§impl PolicyDecisionsRepo
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;
impl PolicyDecisionsRepo
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;Sourcepub fn new(pool: Pool<Postgres>) -> PolicyDecisionsRepo
pub fn new(pool: Pool<Postgres>) -> PolicyDecisionsRepo
Creates a policy-decision repository backed by pool.
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;Sourcepub async fn insert_decision(
&self,
job_id: Uuid,
decision: &str,
reason_code: &str,
details_json: Value,
) -> Result<Uuid, Error>
pub async fn insert_decision( &self, job_id: Uuid, decision: &str, reason_code: &str, details_json: Value, ) -> Result<Uuid, Error>
Inserts one policy decision and returns its identifier.
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;Sourcepub async fn list_for_job(
&self,
job_id: Uuid,
) -> Result<Vec<PolicyDecisionRow>, Error>
pub async fn list_for_job( &self, job_id: Uuid, ) -> Result<Vec<PolicyDecisionRow>, Error>
Lists policy decisions for a job in chronological order.
§Examples
use azums::PolicyDecisionsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let decisions = PolicyDecisionsRepo::new(pool);
let _ = decisions;Trait Implementations§
Source§impl Clone for PolicyDecisionsRepo
impl Clone for PolicyDecisionsRepo
Source§fn clone(&self) -> PolicyDecisionsRepo
fn clone(&self) -> PolicyDecisionsRepo
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for PolicyDecisionsRepo
impl !UnwindSafe for PolicyDecisionsRepo
impl Freeze for PolicyDecisionsRepo
impl Send for PolicyDecisionsRepo
impl Sync for PolicyDecisionsRepo
impl Unpin for PolicyDecisionsRepo
impl UnsafeUnpin for PolicyDecisionsRepo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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