pub struct Workspace { /* private fields */ }Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn disk(root: impl AsRef<Path>) -> Result<Self, VfsError>
pub fn disk(root: impl AsRef<Path>) -> Result<Self, VfsError>
The tree under root on disk, root made absolute.
pub fn new(root: impl Into<PathBuf>, vfs: Arc<dyn Vfs>) -> Self
Sourcepub fn staged(&self) -> Workspace
pub fn staged(&self) -> Workspace
This workspace as a plan would leave it: the same root over an overlay of its file system. Writes land in the overlay; the real files are untouched until a plan is applied here.
pub fn root(&self) -> &Path
pub fn vfs(&self) -> &dyn Vfs
pub fn files(&self) -> Result<Vec<PathBuf>, VfsError>
Sourcepub fn load(&self, path: &Path) -> Result<SourceFile, VfsError>
pub fn load(&self, path: &Path) -> Result<SourceFile, VfsError>
Load a file given either an absolute path or one relative to the root.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Workspace
impl !UnwindSafe for Workspace
impl Freeze for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more