[][src]Struct autumn::Span

pub struct Span { /* fields omitted */ }

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.