pub struct SessionParser { /* private fields */ }Implementations§
Source§impl SessionParser
impl SessionParser
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Parse a single JSONL session file Parse a single JSONL session file
§Errors
Returns an error if the file cannot be read or contains malformed JSON
Sourcepub fn from_default_location() -> Result<Vec<Self>>
pub fn from_default_location() -> Result<Vec<Self>>
Find all session files in the default Claude directory
§Errors
Returns an error if the Claude directory doesn’t exist or cannot be read
Sourcepub fn from_directory<P: AsRef<Path>>(dir: P) -> Result<Vec<Self>>
pub fn from_directory<P: AsRef<Path>>(dir: P) -> Result<Vec<Self>>
Parse all session files in a directory
§Errors
Returns an error if the directory cannot be read or contains invalid session files
Sourcepub fn extract_agent_invocations(&self) -> Vec<AgentInvocation>
pub fn extract_agent_invocations(&self) -> Vec<AgentInvocation>
Extract agent invocations from Task tool uses
Sourcepub fn extract_file_operations(&self) -> Vec<FileOperation>
pub fn extract_file_operations(&self) -> Vec<FileOperation>
Extract file operations from tool uses
Sourcepub fn extract_tool_invocations(
&self,
matcher: &dyn PatternMatcher,
) -> Vec<ToolInvocation>
pub fn extract_tool_invocations( &self, matcher: &dyn PatternMatcher, ) -> Vec<ToolInvocation>
Sourcepub fn find_active_agent(&self, message_id: &str) -> Option<String>
pub fn find_active_agent(&self, message_id: &str) -> Option<String>
Find the active agent context for a given message
Sourcepub fn get_session_info(
&self,
) -> (String, String, Option<Timestamp>, Option<Timestamp>)
pub fn get_session_info( &self, ) -> (String, String, Option<Timestamp>, Option<Timestamp>)
Get session metadata
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get entry count for statistics Used in integration tests
Sourcepub fn entries(&self) -> &[SessionEntry]
pub fn entries(&self) -> &[SessionEntry]
Get all entries
Sourcepub fn entries_in_window(
&self,
start: Timestamp,
end: Timestamp,
) -> Vec<&SessionEntry>
pub fn entries_in_window( &self, start: Timestamp, end: Timestamp, ) -> Vec<&SessionEntry>
Find entries within a time window Used in integration tests
Sourcepub fn get_agent_types(&self) -> Vec<String>
pub fn get_agent_types(&self) -> Vec<String>
Find all unique agent types used in this session Used in integration tests
Sourcepub fn build_timeline(&self) -> Vec<TimelineEvent>
pub fn build_timeline(&self) -> Vec<TimelineEvent>
Build a timeline of events for visualization Used in integration tests
Auto Trait Implementations§
impl Freeze for SessionParser
impl RefUnwindSafe for SessionParser
impl Send for SessionParser
impl Sync for SessionParser
impl Unpin for SessionParser
impl UnsafeUnpin for SessionParser
impl UnwindSafe for SessionParser
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
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> 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>
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>
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