Enum xswag_base::diag::Snippet [] [src]

pub enum Snippet {
    None,
    Orig(Span),
    Replace {
        span: Span,
        with: String,
    },
}

Variants

None

No snippet

Orig

Show the original code with this highlighted span

Replace

Show original code, but replace a part of it with something new and highlight the new part. Hint: also able to only insert.

Fields

span
with

Methods

impl Snippet

fn span(&self) -> Option<Span>

Returns the span if it exists

Trait Implementations

Derived Implementations

impl Eq for Snippet

impl PartialEq for Snippet

fn eq(&self, __arg_0: &Snippet) -> bool

fn ne(&self, __arg_0: &Snippet) -> bool

impl Clone for Snippet

fn clone(&self) -> Snippet

fn clone_from(&mut self, source: &Self)

impl Debug for Snippet

fn fmt(&self, __arg_0: &mut Formatter) -> Result