[−][src]Struct autumn::Span
The location of a sequence of characters within a text source
This tracks a span of characters from a text source. It can also be used to present a human-readable location of the range in the source.
Methods
impl Span
[src]
pub fn start(&self) -> &Location
[src]
Get the start of the span
pub fn end(&self) -> &Location
[src]
Get the end of the span
The end itself is not part of the span
pub fn characters(&self) -> usize
[src]
Get the number of characters between the start and the end
pub fn bytes(&self) -> usize
[src]
Get the number of bytes between the start and the end
pub fn move_start(&mut self, new_start: Location)
[src]
Move the start position of a span
pub fn move_end(&mut self, new_end: Location)
[src]
Move the end position of a span
pub fn following_span(&self) -> Self
[src]
Create a span following the given span
pub fn take(&mut self) -> Self
[src]
Take the current span and set this span to the empty span following it
pub fn after(&mut self, next_character: char)
[src]
Advance the end of a span by adding a character
pub fn bind<T>(self, object: T) -> Meta<T, Self>
[src]
Bind to an object
pub fn substr<'s>(&self, source: &'s str) -> &'s str
[src]
Get the substring related to a span
Trait Implementations
impl Clone for Span
[src]
impl Concat for Span
[src]
fn empty() -> Self
[src]
fn empty_at(location: Span) -> Self
[src]
fn concat(self, other: Self) -> Self
[src]
impl Copy for Span
[src]
impl Debug for Span
[src]
impl Default for Span
[src]
impl Display for Span
[src]
impl Eq for Span
[src]
impl<E, P: Parser<Span, E>, F: Fn(&str) -> bool> Parser<Span, E> for StrCondition<P, F, E>
[src]
impl<E> Parser<Span, E> for str
[src]
impl<'_, E> Parser<Span, E> for &'_ str
[src]
impl<E> Parser<Span, E> for String
[src]
impl PartialEq<Span> for Span
[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> 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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,