pub struct AuditEntry {
pub category: AuditCategory,
pub operation_id: String,
pub operation_name: String,
pub app_id: Option<String>,
pub node_id: Option<String>,
pub started_at_ms: u64,
pub completed_at_ms: u64,
pub latency_ms: u64,
pub outcome: AuditOutcome,
pub message: Option<String>,
pub trace: Option<TraceContext>,
}Expand description
Transport-neutral append-only operational audit entry.
Fields§
§category: AuditCategoryGeneric operation category.
operation_id: StringStable operation identity.
operation_name: StringStable operation name.
app_id: Option<String>Optional application scope.
node_id: Option<String>Optional node scope.
started_at_ms: u64Start timestamp in Unix milliseconds.
completed_at_ms: u64Completion timestamp in Unix milliseconds.
latency_ms: u64Saturating elapsed time in milliseconds.
outcome: AuditOutcomeRecorded operation outcome.
message: Option<String>Optional redacted detail.
trace: Option<TraceContext>Optional distributed trace context.
Implementations§
Source§impl AuditEntry
impl AuditEntry
Sourcepub fn new(
category: AuditCategory,
operation_id: impl Into<String>,
operation_name: impl Into<String>,
started_at_ms: u64,
completed_at_ms: u64,
outcome: AuditOutcome,
) -> Self
pub fn new( category: AuditCategory, operation_id: impl Into<String>, operation_name: impl Into<String>, started_at_ms: u64, completed_at_ms: u64, outcome: AuditOutcome, ) -> Self
Creates an unscoped operational audit entry.
Sourcepub fn with_runtime_scope(self, app_id: &AppId, node_id: &NodeId) -> Self
pub fn with_runtime_scope(self, app_id: &AppId, node_id: &NodeId) -> Self
Adds application and node scope.
Sourcepub fn with_message(self, message: Option<String>) -> Self
pub fn with_message(self, message: Option<String>) -> Self
Adds a redacted optional message.
Sourcepub fn with_trace(self, trace: Option<TraceContext>) -> Self
pub fn with_trace(self, trace: Option<TraceContext>) -> Self
Adds distributed trace context.
Trait Implementations§
Source§impl Clone for AuditEntry
impl Clone for AuditEntry
Source§fn clone(&self) -> AuditEntry
fn clone(&self) -> AuditEntry
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 moreSource§impl Debug for AuditEntry
impl Debug for AuditEntry
Source§impl<'de> Deserialize<'de> for AuditEntry
impl<'de> Deserialize<'de> for AuditEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AuditEntry
Source§impl PartialEq for AuditEntry
impl PartialEq for AuditEntry
Source§impl Serialize for AuditEntry
impl Serialize for AuditEntry
impl StructuralPartialEq for AuditEntry
Auto Trait Implementations§
impl Freeze for AuditEntry
impl RefUnwindSafe for AuditEntry
impl Send for AuditEntry
impl Sync for AuditEntry
impl Unpin for AuditEntry
impl UnsafeUnpin for AuditEntry
impl UnwindSafe for AuditEntry
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