Trait gluon_base::source::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) -> Selfwhere
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>
sourcefn comment_start_before(&self, end: BytePos) -> BytePos
fn comment_start_before(&self, end: BytePos) -> BytePos
Returns the starting position of any comments and whitespace before end
fn comments_between(&self, span: Span<BytePos>) -> CommentIter<'_> ⓘ
Trait Implementations
Implementations on Foreign Types
sourceimpl Source for FileMap
impl Source for FileMap
sourcefn location(&self, byte: BytePos) -> Option<Location>
fn location(&self, byte: BytePos) -> Option<Location>
Returns the line and column location of byte
sourcefn comment_start_before(&self, end: BytePos) -> BytePos
fn comment_start_before(&self, end: BytePos) -> BytePos
Returns the starting position of any comments and whitespace before end