pub struct Layout {
pub main: Utf8PathBuf,
pub parent: Utf8PathBuf,
pub project: String,
}Expand description
The repository’s layout: the main worktree’s path, its parent, and its basename as the project name the sibling paths compose with.
Fields§
§main: Utf8PathBufThe main worktree’s path.
parent: Utf8PathBufThe directory the sibling worktrees land in.
project: StringThe main worktree’s basename, the project half of a sibling name.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn of(worktrees: &[Worktree]) -> Result<Self, String>
pub fn of(worktrees: &[Worktree]) -> Result<Self, String>
The layout of a parsed inventory: the first record is the main
worktree — git documents the ordering — and parse_worktrees
already refused an inventory whose first record is not one.
§Errors
The detail of a main worktree the sibling convention cannot compose with: no parent directory, or no basename.
Trait Implementations§
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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