pub struct BlameEntry {
pub start_in_blamed_file: u32,
pub start_in_source_file: u32,
pub len: NonZeroU32,
pub commit_id: ObjectId,
}
Expand description
A mapping of a section of the Blamed File to the section in a Source File that introduced it.
Both ranges are of the same size, but may use different starting points. Naturally,
they have the same content, which is the reason they are in what is returned by file()
.
Fields§
§start_in_blamed_file: u32
The index of the token in the Blamed File (typically lines) where this entry begins.
start_in_source_file: u32
The index of the token in the Source File (typically lines) where this entry begins.
This is possibly offset compared to start_in_blamed_file
.
len: NonZeroU32
The amount of lines the hunk is spanning.
commit_id: ObjectId
The commit that introduced the section into the Source File.
Implementations§
Source§impl BlameEntry
impl BlameEntry
Source§impl BlameEntry
impl BlameEntry
Sourcepub fn range_in_blamed_file(&self) -> Range<usize>
pub fn range_in_blamed_file(&self) -> Range<usize>
Return the range of tokens this entry spans in the Blamed File.
Sourcepub fn range_in_source_file(&self) -> Range<usize>
pub fn range_in_source_file(&self) -> Range<usize>
Return the range of tokens this entry spans in the Source File.
Trait Implementations§
Source§impl Clone for BlameEntry
impl Clone for BlameEntry
Source§fn clone(&self) -> BlameEntry
fn clone(&self) -> BlameEntry
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BlameEntry
impl Debug for BlameEntry
Source§impl PartialEq for BlameEntry
impl PartialEq for BlameEntry
impl StructuralPartialEq for BlameEntry
Auto Trait Implementations§
impl Freeze for BlameEntry
impl RefUnwindSafe for BlameEntry
impl Send for BlameEntry
impl Sync for BlameEntry
impl Unpin for BlameEntry
impl UnwindSafe for BlameEntry
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