[−][src]Struct moore_common::source::Span
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]
pub fn new(source: Source, begin: usize, end: usize) -> Span
[src]
Create a new span from two byte offsets.
pub fn union<S: Into<Span>>(a: S, b: S) -> Span
[src]
Create a new span that covers two spans, i.e. represents the smallest
possible span that fully contains both input spans a
and b
.
pub fn expand<S: Into<Span>>(&mut self, other: S) -> &mut Self
[src]
Modify this range to also cover the entirety of the other
range. The
other
range must lie in the same source as self
.
pub fn begin(&self) -> Location
[src]
Return the location just before the first character in this span.
pub fn end(&self) -> Location
[src]
Return the location just after the last character in this span.
pub fn extract(&self) -> String
[src]
Copy the portion of the source file in this span into an owned string.
pub fn iter<'a>(self, content: &'a Rc<dyn SourceContent>) -> Box<CharIter<'a>>
[src]
Obtain an iterator over the extract of the source file describe by this span.
Trait Implementations
impl Clone for Span
[src]
impl Copy for Span
[src]
impl Debug for Span
[src]
impl Decodable for Span
[src]
impl Encodable for Span
[src]
impl Eq for Span
[src]
impl Hash for Span
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<Span> for Location
[src]
impl Ord for Span
[src]
fn cmp(&self, other: &Span) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Span> for Span
[src]
impl PartialOrd<Span> for Span
[src]
fn partial_cmp(&self, other: &Span) -> Option<Ordering>
[src]
fn lt(&self, other: &Span) -> bool
[src]
fn le(&self, other: &Span) -> bool
[src]
fn gt(&self, other: &Span) -> bool
[src]
fn ge(&self, other: &Span) -> bool
[src]
impl StructuralEq for Span
[src]
impl StructuralPartialEq for Span
[src]
Auto Trait Implementations
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,