Struct git2::DiffLine [] [src]

pub struct DiffLine<'a> {
    // some fields omitted
}

Structure describing a line (or data span) of a diff.

Methods

impl<'a> DiffLine<'a>
[src]

fn old_lineno(&self) -> Option<u32>

Line number in old file or None for added line

fn new_lineno(&self) -> Option<u32>

Line number in new file or None for deleted line

fn num_lines(&self) -> u32

Number of newline characters in content

fn content_offset(&self) -> i64

Offset in the original file to the content

fn content(&self) -> &[u8]

Content of this line as bytes.

fn origin(&self) -> char

Sigil showing the origin of this DiffLine.

  • - Line context
  • + - Line addition
  • - - Line deletion
  • = - Context (End of file)
  • > - Add (End of file)
  • < - Remove (End of file)
  • F - File header
  • H - Hunk header
  • B - Line binary