pub struct BlameEntry {
pub start_in_blamed_file: u32,
pub start_in_source_file: u32,
pub len: NonZeroU32,
pub commit_id: ObjectId,
pub source_file_name: Option<BString>,
}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: u32The index of the token in the Blamed File (typically lines) where this entry begins.
start_in_source_file: u32The 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: NonZeroU32The amount of lines the hunk is spanning.
commit_id: ObjectIdThe commit that introduced the section into the Source File.
source_file_name: Option<BString>The Source File’s name, in case it differs from Blamed File’s name. This happens when the file was renamed.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more