Struct moore_svlog_hir::Span
[−]
[src]
pub struct Span { pub source: Source, pub begin: usize, pub end: usize, }
A span of locations within a source file, expressed as a half-open interval
of bytes [begin,end)
.
Fields
source: Source
begin: usize
end: usize
Methods
impl Span
[src]
fn new(source: Source, begin: usize, end: usize) -> Span
[src]
Create a new span from two byte offsets.
fn union<S>(a: S, b: S) -> Span where
S: Into<Span>,
[src]
S: Into<Span>,
Create a new span that covers two spans, i.e. represents the smallest
possible span that fully contains both input spans a
and b
.
fn expand<S>(&mut self, other: S) -> &mut Span where
S: Into<Span>,
[src]
S: Into<Span>,
Modify this range to also cover the entirety of the other
range. The
other
range must lie in the same source as self
.
fn begin(&self) -> Location
[src]
Return the location just before the first character in this span.
fn end(&self) -> Location
[src]
Return the location just after the last character in this span.
fn extract(&self) -> String
[src]
Copy the portion of the source file in this span into an owned string.
fn iter(
self,
content: &'a Rc<SourceContent + 'static>
) -> Box<DoubleEndedIterator<Item = (usize, char)> + 'a>
[src]
self,
content: &'a Rc<SourceContent + 'static>
) -> Box<DoubleEndedIterator<Item = (usize, char)> + 'a>
Obtain an iterator over the extract of the source file describe by this span.
Trait Implementations
impl Ord for Span
[src]
impl Copy for Span
[src]
impl Clone for Span
[src]
fn clone(&self) -> Span
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Span> for Span
[src]
impl Debug for Span
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl Decodable for Span
[src]
fn decode<__D>(__arg_0: &mut __D) -> Result<Span, <__D as Decoder>::Error> where
__D: Decoder,
[src]
__D: Decoder,
impl Encodable for Span
[src]
fn encode<__S>(&self, __arg_0: &mut __S) -> Result<(), <__S as Encoder>::Error> where
__S: Encoder,
[src]
__S: Encoder,