pub struct PiSession {
pub header: SessionHeader,
pub entries: Vec<Entry>,
pub file_path: PathBuf,
pub parent: Option<Box<PiSession>>,
}Expand description
In-memory representation of a Pi session file (plus optional parent).
Fields§
§header: SessionHeader§entries: Vec<Entry>§file_path: PathBuf§parent: Option<Box<PiSession>>Implementations§
Source§impl PiSession
impl PiSession
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
This session’s id (from the header).
Sourcepub fn message_entries(
&self,
) -> impl Iterator<Item = (&EntryBase, &AgentMessage)>
pub fn message_entries( &self, ) -> impl Iterator<Item = (&EntryBase, &AgentMessage)>
Iterate over Entry::Message entries, yielding (&base, &message).
Sourcepub fn all_messages(&self) -> Vec<&AgentMessage>
pub fn all_messages(&self) -> Vec<&AgentMessage>
Collect every Entry::Message message in file order.
Sourcepub fn main_thread(&self) -> Vec<&Entry>
pub fn main_thread(&self) -> Vec<&Entry>
Return entries on the “main thread” — the path from root to the newest leaf (an entry with no children), walking parent links.
Returns entries in chronological order (root-first). If there are no non-session entries, returns an empty vec.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PiSession
impl RefUnwindSafe for PiSession
impl Send for PiSession
impl Sync for PiSession
impl Unpin for PiSession
impl UnsafeUnpin for PiSession
impl UnwindSafe for PiSession
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