Struct gluon_base::source::Source
[−]
[src]
pub struct Source<'a> { /* fields omitted */ }
Type which provides a bidirectional mapping between byte offsets and line and column locations
Methods
impl<'a> Source<'a>
[src]
fn new(src: &str) -> Source
fn src(&self) -> &str
Returns the string which defines the source
fn line(&self, line_number: Line) -> Option<(BytePos, &str)>
Returns the byte offset and source of line_number
fn line_at_byte(&self, byte: BytePos) -> Option<(BytePos, &str)>
Returns the line number and the source at byte
fn line_number_at_byte(&self, byte: BytePos) -> Line
Returns which line byte
points to
fn location(&self, byte: BytePos) -> Option<Location>
Returns the line and column location of byte
Trait Implementations
impl<'a> Clone for Source<'a>
[src]
fn clone(&self) -> Source<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more