pub struct SessionsRoot { /* private fields */ }Expand description
Root directory of Claude Code’s live session registry. Defaults
to ~/.claude/sessions; override with SessionsRoot::at for
tests or non-default installs.
Implementations§
Source§impl SessionsRoot
impl SessionsRoot
Sourcepub fn home() -> Result<Self>
pub fn home() -> Result<Self>
Resolve the default ~/.claude/sessions. Errors if $HOME
(or the platform-specific user home) cannot be determined.
Sourcepub fn at(path: impl Into<PathBuf>) -> Self
pub fn at(path: impl Into<PathBuf>) -> Self
Use a specific path as the sessions root. Useful for tests (point at a tempdir) and for non-default installs.
Sourcepub fn list(&self) -> Result<Vec<LiveSession>>
pub fn list(&self) -> Result<Vec<LiveSession>>
List every registry entry, newest first (by startedAt,
ties broken by pid). A missing root returns an empty vec;
malformed files are skipped with a tracing warning. Entries
may be stale – see the module docs.
Trait Implementations§
Source§impl Clone for SessionsRoot
impl Clone for SessionsRoot
Source§fn clone(&self) -> SessionsRoot
fn clone(&self) -> SessionsRoot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionsRoot
impl RefUnwindSafe for SessionsRoot
impl Send for SessionsRoot
impl Sync for SessionsRoot
impl Unpin for SessionsRoot
impl UnsafeUnpin for SessionsRoot
impl UnwindSafe for SessionsRoot
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