[][src]Struct git2::DiffLine

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

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

Implementations

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

pub fn old_lineno(&self) -> Option<u32>[src]

Line number in old file or None for added line

pub fn new_lineno(&self) -> Option<u32>[src]

Line number in new file or None for deleted line

pub fn num_lines(&self) -> u32[src]

Number of newline characters in content

pub fn content_offset(&self) -> i64[src]

Offset in the original file to the content

pub fn content(&self) -> &'a [u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Content of this line as bytes.

pub fn origin(&self) -> char[src]

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

Trait Implementations

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

Auto Trait Implementations

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

impl<'a> !Send for DiffLine<'a>[src]

impl<'a> !Sync for DiffLine<'a>[src]

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

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.