[][src]Struct coral::Span

pub struct Span {
    pub file_name: PathBuf,
    pub byte_start: usize,
    pub byte_end: usize,
    pub line_start: usize,
    pub line_end: usize,
    pub column_start: usize,
    pub column_end: usize,
    pub is_primary: bool,
    pub text: Vec<Text>,
    pub label: Option<String>,
    pub suggested_replacement: Option<String>,
    pub suggestion_applicability: Option<String>,
    pub expansion: Option<Box<Expansion>>,
}

A span output by cargo

Fields

file_name: PathBufbyte_start: usizebyte_end: usizeline_start: usizeline_end: usizecolumn_start: usizecolumn_end: usizeis_primary: booltext: Vec<Text>label: Option<String>suggested_replacement: Option<String>suggestion_applicability: Option<String>expansion: Option<Box<Expansion>>

Methods

impl Span[src]

pub fn line(&self) -> (usize, usize)[src]

Get the Span's line and column

pub fn file_name_string(&self) -> String[src]

Get the Span's file name as a String

pub fn len(&self) -> usize[src]

Get the byte length of the Span

pub fn is_empty(&self) -> bool[src]

Check if the Span is empty

pub fn replace_in_file(self) -> Result<()>[src]

Modify the source file, replacing the span with its suggested replacement

This function consumes the Span because it is invalidated once the file is modified.

Trait Implementations

impl Clone for Span[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Span> for Span[src]

impl Eq for Span[src]

impl Debug for Span[src]

impl Serialize for Span[src]

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

Auto Trait Implementations

impl Sync for Span

impl Send for Span

impl Unpin for Span

impl RefUnwindSafe for Span

impl UnwindSafe for Span

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]