pub struct PgOutboxAuditSink { /* private fields */ }Expand description
PostgreSQL 事务审计 sink;全部审计写固定进入底层 Outbox 绑定的 datasource。
Implementations§
Source§impl PgOutboxAuditSink
impl PgOutboxAuditSink
Sourcepub fn new() -> Self
pub fn new() -> Self
业务作用:创建绑定默认 datasource 的审计适配器,不建立独立连接池。
参数说明: 无。
返回:审计事件固定写入默认 datasource Outbox 的轻量句柄。
Sourcepub fn with_datasource(
datasource: impl AsRef<str>,
) -> Result<Self, OutboxStoreError>
pub fn with_datasource( datasource: impl AsRef<str>, ) -> Result<Self, OutboxStoreError>
业务作用:创建绑定命名 PostgreSQL datasource 的审计适配器。
参数说明:
datasource:启动期已登记的稳定 datasource 名称。
返回:名称合法时返回固定绑定句柄;非法名称在网络 I/O 前失败。
Sourcepub fn datasource_ref(&self) -> &DatasourceRef
pub fn datasource_ref(&self) -> &DatasourceRef
业务作用:读取审计事件最终写入的 PostgreSQL datasource 身份。
参数说明: 无。
返回:底层 Outbox 固定使用且不含连接信息的 qualifier。
Trait Implementations§
Source§impl Clone for PgOutboxAuditSink
impl Clone for PgOutboxAuditSink
Source§impl Debug for PgOutboxAuditSink
impl Debug for PgOutboxAuditSink
Source§impl TransactionalAuditSink for PgOutboxAuditSink
impl TransactionalAuditSink for PgOutboxAuditSink
Source§fn record_transactional<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditWriteError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_transactional<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditWriteError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
业务作用:在当前同源 PostgreSQL ambient transaction 内写入审计 Outbox 事实。
参数说明:
event:已经完成 actor、资源、结局与脱敏 context 归因的业务审计事件。
返回:Outbox append 与 after-commit 登记成功时完成;事务、路由或数据库失败返回脱敏错误。
Auto Trait Implementations§
impl Freeze for PgOutboxAuditSink
impl RefUnwindSafe for PgOutboxAuditSink
impl Send for PgOutboxAuditSink
impl Sync for PgOutboxAuditSink
impl Unpin for PgOutboxAuditSink
impl UnsafeUnpin for PgOutboxAuditSink
impl UnwindSafe for PgOutboxAuditSink
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