pub struct TxLog {
pub session_id: String,
pub project_path: String,
pub started_at: String,
pub ended_at: Option<String>,
/* private fields */
}Expand description
Transaction log container
Fields§
§session_id: StringSession metadata
project_path: StringAbsolute (or workspace-relative) project root path the session operates on.
started_at: StringSession start time, ISO 8601 string.
ended_at: Option<String>Session end time, ISO 8601 string; None while the session is
still active.
Implementations§
Source§impl TxLog
impl TxLog
Sourcepub fn with_project(project_path: impl Into<String>) -> Self
pub fn with_project(project_path: impl Into<String>) -> Self
Create with project path
Sourcepub fn iter_replayable(&self) -> impl Iterator<Item = &TxEntry>
pub fn iter_replayable(&self) -> impl Iterator<Item = &TxEntry>
Iterate over replayable entries only
Sourcepub fn iter_mutations(&self) -> impl Iterator<Item = &TxEntry>
pub fn iter_mutations(&self) -> impl Iterator<Item = &TxEntry>
Iterate over mutation entries only
Sourcepub fn mutations_affecting(&self, symbol: &SymbolPath) -> Vec<&TxEntry>
pub fn mutations_affecting(&self, symbol: &SymbolPath) -> Vec<&TxEntry>
Get mutations affecting a specific symbol
Returns all mutation entries where affected_symbols contains
the given symbol or one of its ancestors.
Sourcepub fn mutations_affecting_subtree(&self, symbol: &SymbolPath) -> Vec<&TxEntry>
pub fn mutations_affecting_subtree(&self, symbol: &SymbolPath) -> Vec<&TxEntry>
Get mutations affecting a symbol and all its descendants
Returns all mutation entries where affected_symbols contains
any symbol in the subtree rooted at the given symbol.
Sourcepub fn entries_since_checkpoint(&self, checkpoint_name: &str) -> Vec<&TxEntry>
pub fn entries_since_checkpoint(&self, checkpoint_name: &str) -> Vec<&TxEntry>
Get entries since a checkpoint
Sourcepub fn end_session(&mut self)
pub fn end_session(&mut self)
Mark session as ended
Sourcepub fn dump_json_compact(&self, path: &Path) -> Result<()>
pub fn dump_json_compact(&self, path: &Path) -> Result<()>
Dump to compact JSON (single line)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TxLog
impl<'de> Deserialize<'de> for TxLog
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 TxLog
impl RefUnwindSafe for TxLog
impl Send for TxLog
impl Sync for TxLog
impl Unpin for TxLog
impl UnsafeUnpin for TxLog
impl UnwindSafe for TxLog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more