Trait gluon_base::source::Source [−][src]
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,
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
Trait Implementations
Implementations on Foreign Types
impl Source for FileMap
[src]
impl Source for FileMap
fn new(s: &str) -> Self where
Self: Sized,
[src]
fn new(s: &str) -> Self where
Self: Sized,
fn span(&self) -> Span<BytePos>
[src]
fn span(&self) -> Span<BytePos>
fn src(&self) -> &str
[src]
fn src(&self) -> &str
fn src_slice(&self, span: Span<BytePos>) -> &str
[src]
fn src_slice(&self, span: Span<BytePos>) -> &str
fn line_number_at_byte(&self, pos: BytePos) -> Option<Line>
[src]
fn line_number_at_byte(&self, pos: BytePos) -> Option<Line>
fn location(&self, byte: BytePos) -> Option<Location>
[src]
fn location(&self, byte: BytePos) -> Option<Location>
Returns the line and column location of byte
fn comment_start_before(&self, end: BytePos) -> BytePos
[src]
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
[src]
ⓘImportant traits for CommentIter<'a>
fn comments_between(&self, span: Span<BytePos>) -> CommentIter
impl Source for ()
[src]
impl Source for ()
fn new(_: &str) -> Self where
Self: Sized,
[src]
fn new(_: &str) -> Self where
Self: Sized,
fn span(&self) -> Span<BytePos>
[src]
fn span(&self) -> Span<BytePos>
fn src(&self) -> &str
[src]
fn src(&self) -> &str
fn src_slice(&self, _: Span<BytePos>) -> &str
[src]
fn src_slice(&self, _: Span<BytePos>) -> &str
fn line_number_at_byte(&self, _: BytePos) -> Option<Line>
[src]
fn line_number_at_byte(&self, _: BytePos) -> Option<Line>
fn location(&self, _: BytePos) -> Option<Location>
[src]
fn location(&self, _: BytePos) -> Option<Location>
fn comment_start_before(&self, pos: BytePos) -> BytePos
[src]
fn comment_start_before(&self, pos: BytePos) -> BytePos
ⓘImportant traits for CommentIter<'a>fn comments_between(&self, _: Span<BytePos>) -> CommentIter
[src]
ⓘImportant traits for CommentIter<'a>
fn comments_between(&self, _: Span<BytePos>) -> CommentIter