Trait diff_match_patch_rs::traits::DType

source ·
pub trait DType:
    Copy
    + Ord
    + Eq
    + Hash {
    // Required methods
    fn bisect_split(
        dmp: &DiffMatchPatch,
        old: &[Self],
        new: &[Self],
        x: usize,
        y: usize,
        deadline: Option<Instant>,
    ) -> Result<Vec<Diff<Self>>, Error>;
    fn from_char(c: char) -> Self;
    fn as_char(&self) -> Option<char>;
    fn from_str(str: &str) -> Vec<Self>;
    fn to_string(data: &[Self]) -> Result<String, Error>;
    fn is_linebreak_end(input: &[Self]) -> bool;
    fn is_linebreak_start(input: &[Self]) -> bool;
    fn percent_encode(input: &[Self]) -> Vec<Self>;
    fn percent_decode(input: &[Self]) -> Vec<Self>;

    // Provided method
    fn humanize(_diffs: &mut Vec<Diff<Self>>) -> Result<(), Error> { ... }
}

Required Methods§

source

fn bisect_split( dmp: &DiffMatchPatch, old: &[Self], new: &[Self], x: usize, y: usize, deadline: Option<Instant>, ) -> Result<Vec<Diff<Self>>, Error>

source

fn from_char(c: char) -> Self

source

fn as_char(&self) -> Option<char>

source

fn from_str(str: &str) -> Vec<Self>

source

fn to_string(data: &[Self]) -> Result<String, Error>

source

fn is_linebreak_end(input: &[Self]) -> bool

source

fn is_linebreak_start(input: &[Self]) -> bool

source

fn percent_encode(input: &[Self]) -> Vec<Self>

source

fn percent_decode(input: &[Self]) -> Vec<Self>

Provided Methods§

source

fn humanize(_diffs: &mut Vec<Diff<Self>>) -> Result<(), Error>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DType for char

source§

fn bisect_split( dmp: &DiffMatchPatch, old: &[char], new: &[char], x: usize, y: usize, deadline: Option<Instant>, ) -> Result<Vec<Diff<char>>, Error>

source§

fn from_char(c: char) -> Self

source§

fn as_char(&self) -> Option<char>

source§

fn from_str(str: &str) -> Vec<Self>

source§

fn to_string(data: &[Self]) -> Result<String, Error>

source§

fn is_linebreak_end(input: &[Self]) -> bool

source§

fn is_linebreak_start(input: &[Self]) -> bool

source§

fn percent_encode(input: &[Self]) -> Vec<Self>

source§

fn percent_decode(input: &[Self]) -> Vec<Self>

source§

impl DType for u8

source§

fn bisect_split( dmp: &DiffMatchPatch, old: &[u8], new: &[u8], x: usize, y: usize, deadline: Option<Instant>, ) -> Result<Vec<Diff<u8>>, Error>

source§

fn from_char(c: char) -> Self

source§

fn as_char(&self) -> Option<char>

source§

fn from_str(str: &str) -> Vec<Self>

source§

fn to_string(data: &[Self]) -> Result<String, Error>

source§

fn is_linebreak_end(input: &[Self]) -> bool

source§

fn is_linebreak_start(input: &[Self]) -> bool

source§

fn percent_encode(input: &[Self]) -> Vec<Self>

source§

fn percent_decode(input: &[Self]) -> Vec<Self>

source§

fn humanize(diffs: &mut Vec<Diff<Self>>) -> Result<(), Error>

source§

impl DType for usize

source§

fn bisect_split( dmp: &DiffMatchPatch, old: &[usize], new: &[usize], x: usize, y: usize, deadline: Option<Instant>, ) -> Result<Vec<Diff<usize>>, Error>

source§

fn from_char(c: char) -> Self

source§

fn as_char(&self) -> Option<char>

source§

fn from_str(_: &str) -> Vec<Self>

source§

fn to_string(_: &[Self]) -> Result<String, Error>

source§

fn is_linebreak_end(_: &[Self]) -> bool

source§

fn is_linebreak_start(_: &[Self]) -> bool

source§

fn percent_encode(_: &[Self]) -> Vec<Self>

source§

fn percent_decode(_: &[Self]) -> Vec<Self>

Implementors§