Trait DType

Source
pub trait DType:
    Copy
    + Ord
    + Eq
    + Hash {
Show 14 methods // Required methods 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 methods fn bisect_split( dmp: &DiffMatchPatch, old: &[Self], new: &[Self], x: usize, y: usize, deadline: Option<Instant>, ) -> Result<Vec<Diff<Self>>, Error> { ... } fn is_whitespace(self) -> bool { ... } fn is_newline(self) -> bool { ... } fn is_carriage(self) -> bool { ... } fn is_alphanum(self) -> bool { ... } fn humanize(_diffs: &mut Vec<Diff<Self>>) -> Result<(), Error> { ... }
}

Required Methods§

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

Source

fn is_whitespace(self) -> bool

Source

fn is_newline(self) -> bool

Source

fn is_carriage(self) -> bool

Source

fn is_alphanum(self) -> bool

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl DType for char

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_whitespace(self) -> bool

Source§

fn is_newline(self) -> bool

Source§

fn is_carriage(self) -> bool

Source§

fn is_alphanum(self) -> bool

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 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_whitespace(self) -> bool

Source§

fn is_newline(self) -> bool

Source§

fn is_carriage(self) -> bool

Source§

fn is_alphanum(self) -> bool

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§