Struct git2::DiffLine[][src]

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

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_value(&self) -> DiffLineType[src]

origin of this DiffLine.

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]

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> RefUnwindSafe for DiffLine<'a>

impl<'a> !Send for DiffLine<'a>

impl<'a> !Sync for DiffLine<'a>

impl<'a> Unpin for DiffLine<'a>

impl<'a> UnwindSafe for DiffLine<'a>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.