pub struct WriteScope { /* private fields */ }Expand description
The directories a run may write into.
Implementations§
Source§impl WriteScope
impl WriteScope
Sourcepub fn new(
root: &Path,
cwd: &Path,
shared_dirs: Vec<PathBuf>,
) -> Result<Self, String>
pub fn new( root: &Path, cwd: &Path, shared_dirs: Vec<PathBuf>, ) -> Result<Self, String>
Build the scope for a project root.
The Git work tree that contains the root counts only when cwd is
inside it too. That is the monorepo case the allowance exists for. It
keeps a Git repository at $HOME (a dotfiles setup) from allowing
every home path to a run started outside that tree.
§Errors
Returns a message when the root cannot be resolved, so a caller fails closed.
Trait Implementations§
Source§impl Clone for WriteScope
impl Clone for WriteScope
Auto Trait Implementations§
impl Freeze for WriteScope
impl RefUnwindSafe for WriteScope
impl Send for WriteScope
impl Sync for WriteScope
impl Unpin for WriteScope
impl UnsafeUnpin for WriteScope
impl UnwindSafe for WriteScope
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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