Trait Source

Source
pub trait Source:
    Send
    + Sync
    + Debug {
    // Required method
    fn content(&self) -> Box<&str>;

    // Provided method
    fn name(&self) -> Option<&str> { ... }
}
Expand description

Defines a source file, which can be used to provide context for diagnostics.

This trait represents some sort of source code, which will be reported to the user as part of the reporting process.

Required Methods§

Source

fn content(&self) -> Box<&str>

Gets the full content of the source file.

Provided Methods§

Source

fn name(&self) -> Option<&str>

Defines the name of the source file.

Implementations on Foreign Types§

Source§

impl Source for &str

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for &String

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for &[u8]

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for str

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for String

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for Vec<u8>

Source§

fn content(&self) -> Box<&str>

Source§

impl Source for [u8]

Source§

fn content(&self) -> Box<&str>

Implementors§