[][src]Struct beediff::diff::text::TextParser

pub struct TextParser { /* fields omitted */ }

Using the LCS algorithm to compare text files (like linux diff). #Examples

How to compare two files with locations fpath_a and fpath_b:

let mut text_parser = diff::text::parser(fpath_a, fpath_b).unwrap();
text_parser.run(beediff::Sensivity::CaseSensitive);
text_parser.print_same();
text_parser.print_others();

Implementations

impl TextParser[src]

pub fn run(&mut self, sensitivity: Sensivity)[src]

Starts LCS parsing for two files contents.
Returns tuple of two vectors. The first vector contains information (Tokens) about the same lines.
The second one contains information about the remaining lines, not the same lines (Added, Changed, Deleted).

pub fn same(&self) -> Option<Vec<Token>>[src]

Returns copy of vector with 'Tokens' described the same lines.

pub fn others(&self) -> Option<Vec<Token>>[src]

Returns copy of vector with 'Tokens' described not the same lines.

pub fn print_same(&self)[src]

Prints information about the same lines.

pub fn print_others(&self)[src]

Prints information about the same lines.

pub fn print_unix_diff(&self)[src]

Auto Trait Implementations

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.