pub struct PathResolver { /* private fields */ }Expand description
Builder-style resolver over the ~/.copilot/ filesystem.
Implementations§
Source§impl PathResolver
impl PathResolver
pub fn new() -> Self
pub fn with_home<P: Into<PathBuf>>(self, home: P) -> Self
Sourcepub fn with_copilot_dir<P: Into<PathBuf>>(self, copilot_dir: P) -> Self
pub fn with_copilot_dir<P: Into<PathBuf>>(self, copilot_dir: P) -> Self
Override the copilot directory directly (defaults to ~/.copilot,
or $COPILOT_HOME when set).
pub fn home_dir(&self) -> Result<&Path>
pub fn copilot_dir(&self) -> Result<PathBuf>
pub fn session_state_dir(&self) -> Result<PathBuf>
pub fn legacy_session_state_dir(&self) -> Result<PathBuf>
pub fn session_store_db(&self) -> Result<PathBuf>
pub fn exists(&self) -> bool
Sourcepub fn events_file(&self, session_id: &str) -> Result<PathBuf>
pub fn events_file(&self, session_id: &str) -> Result<PathBuf>
events.jsonl path for a resolved session id.
Sourcepub fn workspace_file(&self, session_id: &str) -> Result<PathBuf>
pub fn workspace_file(&self, session_id: &str) -> Result<PathBuf>
workspace.yaml path for a resolved session id.
Sourcepub fn list_session_dirs(&self) -> Result<Vec<PathBuf>>
pub fn list_session_dirs(&self) -> Result<Vec<PathBuf>>
Enumerate every session directory (current + legacy) that contains an
events.jsonl, newest first by events.jsonl mtime.
Sourcepub fn find_session_dir(&self, session_id: &str) -> Result<PathBuf>
pub fn find_session_dir(&self, session_id: &str) -> Result<PathBuf>
Resolve a session identifier to its session-state/<id>/ directory.
Accepts an exact session-id directory name or a unique prefix of one.
(Name-based resolution would require reading session-store.db; see
docs/agents/formats/copilot-cli/resume-and-sessions.md.)
Trait Implementations§
Source§impl Clone for PathResolver
impl Clone for PathResolver
Source§fn clone(&self) -> PathResolver
fn clone(&self) -> PathResolver
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 moreSource§impl Debug for PathResolver
impl Debug for PathResolver
Auto Trait Implementations§
impl Freeze for PathResolver
impl RefUnwindSafe for PathResolver
impl Send for PathResolver
impl Sync for PathResolver
impl Unpin for PathResolver
impl UnsafeUnpin for PathResolver
impl UnwindSafe for PathResolver
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