pub struct Snapshot {
pub metadata: SnapshotMetadata,
pub decisions: Vec<DecisionSnapshot>,
pub snapshot_type: SnapshotType,
}Expand description
Root snapshot containing multiple decisions (e.g., a session)
Fields§
§metadata: SnapshotMetadata§decisions: Vec<DecisionSnapshot>§snapshot_type: SnapshotTypeImplementations§
Source§impl Snapshot
impl Snapshot
pub fn new(snapshot_type: SnapshotType) -> Self
pub fn add_decision(&mut self, decision: DecisionSnapshot)
pub fn with_created_by(self, created_by: impl Into<String>) -> Self
Sourcepub fn to_canonical_json(&self) -> Result<String, Error>
pub fn to_canonical_json(&self) -> Result<String, Error>
Serialize to canonical JSON for consistent checksums
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
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 StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnwindSafe for Snapshot
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