pub struct Anchor {
pub file: String,
pub side: String,
pub line: u32,
pub end_line: u32,
pub offset: i32,
pub span: u32,
pub hunk_digest: String,
pub line_text: String,
pub end_line_text: String,
}Fields§
§file: String§side: String“old” | “new”
line: u32First anchored line, in file coordinates. DERIVED — offset is what
survives a regeneration, and this is recomputed from it.
end_line: u32Last anchored line. Equal to line for a single-line anchor; 0 on a
record written before ranges existed, which reads as “just line”.
offset: i32Lines from the hunk’s start to line. Signed: a reader can
annotate a context line, and context sits on both sides of a hunk.
This, not line, is what the anchor is really made of. The digest
fixes the hunk’s CONTENT, so a hunk that moved in the file still holds
the same line at the same offset — while its absolute line number did
not survive the move. A record written before offsets existed has 0,
which lands it on the hunk’s first line: exactly where it used to.
span: u32Lines the anchor spans past offset. 0 is a single line.
hunk_digest: String§line_text: StringThe anchored line’s text — the fuzzy re-anchor key.
end_line_text: StringThe last anchored line’s text, for the same job at the range’s far end.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Anchor
impl<'de> Deserialize<'de> for Anchor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl Freeze for Anchor
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnsafeUnpin for Anchor
impl UnwindSafe for Anchor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.