[][src]Enum pdbtbx::Context

pub enum Context {
    None,
    Show {
        line: String,
    },
    FullLine {
        linenumber: usize,
        line: String,
    },
    Line {
        linenumber: usize,
        line: String,
        offset: usize,
        length: usize,
    },
}

A struct to define the context of an error message

Variants

None

When no context can be given

Show

When only a line (eg filename) can be shown

Fields of Show

line: String
FullLine

When a full line is faulty and no special position can be annotated

Fields of FullLine

linenumber: usizeline: String
Line

When a special position can be annotated on a line

Fields of Line

linenumber: usizeline: Stringoffset: usizelength: usize

Implementations

impl Context[src]

pub fn none() -> Context[src]

Creates a new context when no context can be given

pub fn show(line: &str) -> Context[src]

Creates a new context when only a line (eg filename) can be shown

pub fn full_line(linenumber: usize, line: &str) -> Context[src]

Creates a new context when a full line is faulty and no special position can be annotated

pub fn line(
    linenumber: usize,
    line: &str,
    offset: usize,
    length: usize
) -> Context
[src]

Creates a new context when a special position can be annotated on a line

Trait Implementations

impl Clone for Context[src]

impl Debug for Context[src]

impl Display for Context[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> 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> ToString for T where
    T: Display + ?Sized
[src]

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.