Struct lock_keeper::types::audit_event::AuditEvent
source · pub struct AuditEvent {
pub audit_event_id: i64,
pub account_id: AccountId,
pub request_id: Uuid,
pub key_id: Option<KeyId>,
pub timestamp: OffsetDateTime,
pub client_action: ClientAction,
pub status: EventStatus,
}
Expand description
A single entry that specifies the actor, action, outcome, and any related key for a logged audit event. We expect database implementors to create AuditEvent instances for us. So we make all fields public.
Fields§
§audit_event_id: i64
§account_id: AccountId
§request_id: Uuid
§key_id: Option<KeyId>
§timestamp: OffsetDateTime
We use [OffsetDateTime] as this is compatible with SQLx. Easily convertible to a postgres’ TIMESTAMPTZ type.
client_action: ClientAction
§status: EventStatus
Implementations§
source§impl AuditEvent
impl AuditEvent
pub fn request_id(&self) -> &Uuid
pub fn action(&self) -> ClientAction
pub fn key_id(&self) -> Option<&KeyId>
pub fn date(&self) -> OffsetDateTime
pub fn status(&self) -> EventStatus
Trait Implementations§
source§impl Debug for AuditEvent
impl Debug for AuditEvent
source§impl<'de> Deserialize<'de> for AuditEvent
impl<'de> Deserialize<'de> for AuditEvent
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
source§impl Display for AuditEvent
impl Display for AuditEvent
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnwindSafe for AuditEvent
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> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
fn from_message(value: Message) -> Result<Self, LockKeeperError>
fn to_message(self) -> Result<Message, LockKeeperError>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request