pub struct EffectLog { /* private fields */ }Expand description
Represents an encapsulated, timestamped log of causal evaluation events.
This struct provides a high-level API for logging and ensures that all log entries are automatically timestamped. It hides the internal storage details to provide a clean and robust interface. An append-only audit log for causal operations.
EffectLog maintains a chronological record of all significant events, computations,
and interventions that occur during a causal process. This is crucial for:
- Explainability: Tracing back why a certain result was reached.
- Auditability: Providing a tamper-evident record of decisions suitable for compliance.
- Debugging: Understanding the flow of complex graphs.
Implementations§
Source§impl EffectLog
impl EffectLog
Sourcepub fn with_capacity(capacity: usize) -> EffectLog
pub fn with_capacity(capacity: usize) -> EffectLog
Creates a new, empty log with a specified capacity.
Sourcepub fn eq_with_timestamps(&self, other: &EffectLog) -> bool
pub fn eq_with_timestamps(&self, other: &EffectLog) -> bool
Strict equality that also requires entry timestamps to match.
The counterpart to the timestamp-agnostic PartialEq impl: returns true only when the
two logs have the same messages and the same timestamps, in the same order. Use this when
the temporal record is the subject of the comparison (e.g. auditing that two runs produced
identically-timed entries); use == for ordinary value equality.
Trait Implementations§
impl Eq for EffectLog
Source§impl From<&str> for EffectLog
Provides a clean way to create a log with a single initial entry from a string slice.
e.g., let log: CausalEffectLog = "Initial message".into();
impl From<&str> for EffectLog
Provides a clean way to create a log with a single initial entry from a string slice.
e.g., let log: CausalEffectLog = "Initial message".into();
Source§impl From<String> for EffectLog
Provides a clean way to create a log with a single initial entry.
e.g., let log: CausalEffectLog = "Initial message".to_string().into();
impl From<String> for EffectLog
Provides a clean way to create a log with a single initial entry.
e.g., let log: CausalEffectLog = "Initial message".to_string().into();
Source§impl LogAddEntry for EffectLog
impl LogAddEntry for EffectLog
impl LogEffect for EffectLog
Source§impl PartialEq for EffectLog
Value equality of an EffectLog is its message sequence, ignoring entry timestamps.
impl PartialEq for EffectLog
Value equality of an EffectLog is its message sequence, ignoring entry timestamps.
Each entry is timestamped with SystemTime::now() at add_entry
time (or 0 under no_std). Those timestamps are wall-clock metadata: two logically
identical logs built microseconds apart would otherwise never compare equal, which makes the
derived structural == non-deterministic and breaks value comparison of any
CausalEffectPropagationProcess carrying a non-empty log. Comparing by message content and
order keeps == a meaningful, reproducible equivalence. When the timestamps themselves are
the subject of comparison, use eq_with_timestamps.