[][src]Trait gluon_base::source::Source

pub trait Source {
    fn new(s: &str) -> Self
    where
        Self: Sized
;
fn location(&self, byte: BytePos) -> Option<Location>;
fn span(&self) -> Span<BytePos>;
fn src(&self) -> &str;
fn src_slice(&self, span: Span<BytePos>) -> &str;
fn line_number_at_byte(&self, pos: BytePos) -> Option<Line>;
fn comment_start_before(&self, end: BytePos) -> BytePos;
fn comments_between(&self, span: Span<BytePos>) -> CommentIter; }

Required methods

fn new(s: &str) -> Self where
    Self: Sized

fn location(&self, byte: BytePos) -> Option<Location>

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

fn src(&self) -> &str

fn src_slice(&self, span: Span<BytePos>) -> &str

fn line_number_at_byte(&self, pos: BytePos) -> Option<Line>

fn comment_start_before(&self, end: BytePos) -> BytePos

Returns the starting position of any comments and whitespace before end

Important traits for CommentIter<'a>
fn comments_between(&self, span: Span<BytePos>) -> CommentIter

Loading content...

Trait Implementations

impl<'a, I, A> ToDoc<'a, Arena<Doc<'a, RefDoc<'a, A>, A>>, A, &'a (dyn Source + 'a)> for ArcType<I> where
    I: AsRef<str>,
    A: Clone
[src]

Implementations on Foreign Types

impl Source for FileMap[src]

fn location(&self, byte: BytePos) -> Option<Location>[src]

Returns the line and column location of byte

fn comment_start_before(&self, end: BytePos) -> BytePos[src]

Returns the starting position of any comments and whitespace before end

impl Source for ()[src]

Loading content...

Implementors

Loading content...