[][src]Struct garando_errors::CodeSuggestion

pub struct CodeSuggestion {
    pub substitution_parts: Vec<Substitution>,
    pub msg: String,
}

Fields

substitution_parts: Vec<Substitution>

Each substitute can have multiple variants due to multiple applicable suggestions

foo.bar might be replaced with a.b or x.y by replacing foo and bar on their own:

This example is not tested
vec![
    (0..3, vec!["a", "x"]),
    (4..7, vec!["b", "y"]),
]

or by replacing the entire span:

This example is not tested
vec![(0..7, vec!["a.b", "x.y"])]
msg: String

Implementations

impl CodeSuggestion[src]

pub fn substitution_spans<'a>(
    &'a self
) -> Map<<&'a Vec<Substitution> as IntoIterator>::IntoIter, fn(_: &Substitution) -> Span>
[src]

Returns the number of substitutions

pub fn splice_lines(&self, cm: &dyn CodeMapper) -> Vec<String>[src]

Returns the assembled code suggestions.

Trait Implementations

impl Clone for CodeSuggestion[src]

impl Debug for CodeSuggestion[src]

impl<'de> Deserialize<'de> for CodeSuggestion[src]

impl PartialEq<CodeSuggestion> for CodeSuggestion[src]

impl Serialize for CodeSuggestion[src]

impl StructuralPartialEq for CodeSuggestion[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.