pub struct RootedWorkspace { /* private fields */ }Expand description
A real directory, viewed through workspace-relative paths.
Implementations§
Source§impl RootedWorkspace
impl RootedWorkspace
Sourcepub fn open(root: impl Into<PathBuf>) -> Result<Self>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Opens root, probing which link primitives this host currently permits.
Sourcepub fn with_support(root: impl Into<PathBuf>, support: LinkSupport) -> Self
pub fn with_support(root: impl Into<PathBuf>, support: LinkSupport) -> Self
Opens root with a fixed capability set, for tests that need to exercise
a fallback path on a host that would not otherwise take it.
Sourcepub fn native(&self, path: &RelPath) -> PathBuf
pub fn native(&self, path: &RelPath) -> PathBuf
Translates a workspace-relative path into a native one.
Sourcepub fn stale_junctions(&self, candidates: &[RelPath]) -> Vec<(RelPath, String)>
pub fn stale_junctions(&self, candidates: &[RelPath]) -> Vec<(RelPath, String)>
Links whose stored target no longer resolves inside this workspace.
Junctions record an absolute path, so moving or copying a workspace leaves
them pointing at the old location — silently, and with the old content
still readable. agentlink doctor uses this to catch that case.
Trait Implementations§
Source§impl Clone for RootedWorkspace
impl Clone for RootedWorkspace
Source§fn clone(&self) -> RootedWorkspace
fn clone(&self) -> RootedWorkspace
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 RootedWorkspace
impl Debug for RootedWorkspace
Source§impl Workspace for RootedWorkspace
impl Workspace for RootedWorkspace
Source§fn probe(&self, path: &RelPath) -> FsResult<Option<Entry>>
fn probe(&self, path: &RelPath) -> FsResult<Option<Entry>>
Inspects an entry without following a trailing link. Read more
Source§fn write(&self, path: &RelPath, contents: &str) -> FsResult<()>
fn write(&self, path: &RelPath, contents: &str) -> FsResult<()>
Writes a UTF-8 file, creating parent directories as needed.
Source§fn create_dir_all(&self, path: &RelPath) -> FsResult<()>
fn create_dir_all(&self, path: &RelPath) -> FsResult<()>
Creates a directory and all missing parents.
Source§fn link(
&self,
via: Via,
node: NodeKind,
canonical: &RelPath,
target: &RelPath,
) -> FsResult<()>
fn link( &self, via: Via, node: NodeKind, canonical: &RelPath, target: &RelPath, ) -> FsResult<()>
Creates a link at
target resolving to canonical, creating target’s
parent directories as needed. Read moreSource§fn remove_link(&self, path: &RelPath, node: NodeKind) -> FsResult<()>
fn remove_link(&self, path: &RelPath, node: NodeKind) -> FsResult<()>
Removes a link, never recursing into its contents. Read more
Source§fn remove_empty_dir(&self, path: &RelPath) -> FsResult<()>
fn remove_empty_dir(&self, path: &RelPath) -> FsResult<()>
Removes a directory, failing if it is not empty. Read more
Source§fn rename(&self, from: &RelPath, to: &RelPath) -> FsResult<()>
fn rename(&self, from: &RelPath, to: &RelPath) -> FsResult<()>
Moves an entry, creating the destination’s parents as needed.
Source§fn is_empty_dir(&self, path: &RelPath) -> FsResult<bool>
fn is_empty_dir(&self, path: &RelPath) -> FsResult<bool>
Whether
path is a directory containing no entries.Source§fn support(&self) -> LinkSupport
fn support(&self) -> LinkSupport
Which link primitives this host currently permits.
Auto Trait Implementations§
impl Freeze for RootedWorkspace
impl RefUnwindSafe for RootedWorkspace
impl Send for RootedWorkspace
impl Sync for RootedWorkspace
impl Unpin for RootedWorkspace
impl UnsafeUnpin for RootedWorkspace
impl UnwindSafe for RootedWorkspace
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