pub struct LogEntry {
pub entry_id: String,
pub version: String,
pub timestamp_unix: i64,
pub timestamp_iso: String,
pub event_type: EventType,
pub actor: Actor,
pub request: Option<RequestContext>,
pub compliance: Option<Compliance>,
pub integrity: Integrity,
pub decision: Decision,
pub rule_id: Option<String>,
}Expand description
Log entry structure
Fields§
§entry_id: StringUnique entry ID (format: le_{timestamp}_{uuid})
version: StringSchema version
timestamp_unix: i64Unix timestamp
timestamp_iso: StringISO 8601 timestamp
event_type: EventTypeEvent type
actor: ActorActor information
request: Option<RequestContext>Request context
compliance: Option<Compliance>Compliance metadata
integrity: IntegrityIntegrity metadata
decision: DecisionDecision made
rule_id: Option<String>Rule ID that triggered decision (if any)
Implementations§
Source§impl LogEntry
impl LogEntry
Sourcepub fn new(event_type: EventType, agent_id: String, agent_org: String) -> Self
pub fn new(event_type: EventType, agent_id: String, agent_org: String) -> Self
Create a new log entry
Sourcepub fn compute_hash(&self, previous_hash: &str) -> String
pub fn compute_hash(&self, previous_hash: &str) -> String
Compute full hash including previous entry
Sourcepub fn update_previous_hash(&mut self, previous_hash: &str)
pub fn update_previous_hash(&mut self, previous_hash: &str)
Update previous hash (called when appending to chain)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogEntry
impl<'de> Deserialize<'de> for LogEntry
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
Auto Trait Implementations§
impl Freeze for LogEntry
impl RefUnwindSafe for LogEntry
impl Send for LogEntry
impl Sync for LogEntry
impl Unpin for LogEntry
impl UnsafeUnpin for LogEntry
impl UnwindSafe for LogEntry
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