Trait source_map::ToString

source ·
pub trait ToString {
    // Required methods
    fn push(&mut self, chr: char);
    fn push_new_line(&mut self);
    fn push_str(&mut self, string: &str);
    fn push_str_contains_new_line(&mut self, string: &str);
    fn add_mapping(&mut self, source_span: &Span);
}
Expand description

A trait for defining behavior of adding content to a buffer. As well as register markers for source maps

Required Methods§

source

fn push(&mut self, chr: char)

source

fn push_new_line(&mut self)

source

fn push_str(&mut self, string: &str)

Use ToString::push_str_contains_new_line if string could contain new lines

source

fn push_str_contains_new_line(&mut self, string: &str)

Used to push strings that may contain new lines

source

fn add_mapping(&mut self, source_span: &Span)

Adds a mapping of the from a original position in the source to the position in the current buffer

Implementations on Foreign Types§

source§

impl ToString for String

source§

fn push(&mut self, chr: char)

source§

fn push_new_line(&mut self)

source§

fn push_str(&mut self, string: &str)

source§

fn push_str_contains_new_line(&mut self, string: &str)

source§

fn add_mapping(&mut self, _source_span: &Span)

Implementors§