pub struct AuditEventBuilder {
pub action: Option<AuditAction>,
pub user_id: Option<String>,
pub actor_id: Option<String>,
pub tenant_id: Option<String>,
pub ip: Option<String>,
pub user_agent: Option<String>,
pub success: bool,
pub reason: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Minimal builder for the per-request fields that the route handler can grab from the RouterContext.
Fields§
§action: Option<AuditAction>§user_id: Option<String>§actor_id: Option<String>§tenant_id: Option<String>§ip: Option<String>§user_agent: Option<String>§success: bool§reason: Option<String>§metadata: HashMap<String, String>Implementations§
Source§impl AuditEventBuilder
impl AuditEventBuilder
pub fn new(action: AuditAction) -> Self
pub fn user(self, user_id: impl Into<String>) -> Self
pub fn actor(self, actor_id: impl Into<String>) -> Self
pub fn tenant(self, tenant_id: impl Into<String>) -> Self
pub fn ip(self, ip: impl Into<String>) -> Self
pub fn user_agent(self, ua: impl Into<String>) -> Self
pub fn failed(self, reason: impl Into<String>) -> Self
pub fn meta(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn build(self) -> AuditEvent
Trait Implementations§
Source§impl Clone for AuditEventBuilder
impl Clone for AuditEventBuilder
Source§fn clone(&self) -> AuditEventBuilder
fn clone(&self) -> AuditEventBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditEventBuilder
impl Debug for AuditEventBuilder
Source§impl Default for AuditEventBuilder
impl Default for AuditEventBuilder
Source§fn default() -> AuditEventBuilder
fn default() -> AuditEventBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuditEventBuilder
impl RefUnwindSafe for AuditEventBuilder
impl Send for AuditEventBuilder
impl Sync for AuditEventBuilder
impl Unpin for AuditEventBuilder
impl UnsafeUnpin for AuditEventBuilder
impl UnwindSafe for AuditEventBuilder
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