pub struct HunkSite {
pub path: PathBuf,
pub staged: bool,
pub ordinal: usize,
}Expand description
The same fact in view-independent terms, as the shared staging path can state it: which file, which side of the index, which hunk.
The anchor is deliberately not decided here. Turning this into a
row is a question about buffer shape — an entry row in magit-status,
a diff --git header in a diff buffer — and only the view knows
which it has. So the staging path names the work and each view names
the landmark.
Fields§
§path: PathBuf§staged: bool§ordinal: usizeImplementations§
Source§impl HunkSite
impl HunkSite
Sourcepub fn as_status_entry(self) -> HunkRestore
pub fn as_status_entry(self) -> HunkRestore
Read as a magit-status entry row.
Sourcepub fn as_diff_header(self) -> HunkRestore
pub fn as_diff_header(self) -> HunkRestore
Read as a diff --git header in a raw diff buffer, where the
staged/unstaged split is a property of the whole buffer rather
than of a section within it.
Trait Implementations§
impl Eq for HunkSite
impl StructuralPartialEq for HunkSite
Auto Trait Implementations§
impl Freeze for HunkSite
impl RefUnwindSafe for HunkSite
impl Send for HunkSite
impl Sync for HunkSite
impl Unpin for HunkSite
impl UnsafeUnpin for HunkSite
impl UnwindSafe for HunkSite
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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