Struct git_worktree::fs::Stack
source · [−]pub struct Stack { /* private fields */ }
Implementations
sourceimpl Stack
impl Stack
sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a new instance with root
being the base for all future paths we handle, assuming it to be valid which includes
symbolic links to be included in it as well.
sourcepub fn make_relative_path_current(
&mut self,
relative: impl AsRef<Path>,
delegate: &mut impl Delegate
) -> Result<()>
pub fn make_relative_path_current(
&mut self,
relative: impl AsRef<Path>,
delegate: &mut impl Delegate
) -> Result<()>
Set the current stack to point to the relative
path and call push_comp()
each time a new path component is popped
along with the stacks state for inspection to perform an operation that produces some data.
The full path to relative
will be returned along with the data returned by push_comp.
Note that this only works correctly for the delegate’s push_directory()
and pop_directory()
methods if
relative
paths are terminal, so point to their designated file or directory.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more