Skip to main content

RootedWorkspace

Struct RootedWorkspace 

Source
pub struct RootedWorkspace { /* private fields */ }
Expand description

A real directory, viewed through workspace-relative paths.

Implementations§

Source§

impl RootedWorkspace

Source

pub fn open(root: impl Into<PathBuf>) -> Result<Self>

Opens root, probing which link primitives this host currently permits.

Source

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.

Source

pub fn root(&self) -> &Path

The absolute root of this workspace.

Source

pub fn native(&self, path: &RelPath) -> PathBuf

Translates a workspace-relative path into a native one.

Source

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for RootedWorkspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Workspace for RootedWorkspace

Source§

fn probe(&self, path: &RelPath) -> FsResult<Option<Entry>>

Inspects an entry without following a trailing link. Read more
Source§

fn read(&self, path: &RelPath) -> FsResult<String>

Reads a UTF-8 file, following links.
Source§

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<()>

Creates a directory and all missing parents.
Creates a link at target resolving to canonical, creating target’s parent directories as needed. Read more
Removes a link, never recursing into its contents. Read more
Source§

fn remove_file(&self, path: &RelPath) -> FsResult<()>

Removes a regular file.
Source§

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<()>

Moves an entry, creating the destination’s parents as needed.
Source§

fn is_empty_dir(&self, path: &RelPath) -> FsResult<bool>

Whether path is a directory containing no entries.
Source§

fn support(&self) -> LinkSupport

Which link primitives this host currently permits.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.