Trait similar::DiffableStrRef[][src]

pub trait DiffableStrRef {
    type Output: DiffableStr + ?Sized;
    fn as_diffable_str(&self) -> &Self::Output;
}

Reference to a DiffableStr.

This type exists because while the library only really provides ways to work with &str and &[u8] there are types that deref into those string slices such as String and Vec<u8>.

This trait is used in the library whenever it’s nice to be able to pass strings of different types in.

Requires the text feature.

Associated Types

type Output: DiffableStr + ?Sized[src]

The type of the resolved DiffableStr.

Loading content...

Required methods

fn as_diffable_str(&self) -> &Self::Output[src]

Resolves the reference.

Loading content...

Implementations on Foreign Types

impl DiffableStrRef for String[src]

type Output = str

impl<'a, T: DiffableStr + ?Sized> DiffableStrRef for Cow<'a, T>[src]

type Output = T

impl DiffableStrRef for Vec<u8>[src]

Loading content...

Implementors

impl<T: DiffableStr + ?Sized> DiffableStrRef for T[src]

type Output = T

Loading content...