[][src]Struct lark_span::Span

pub struct Span<File: SpanFile> { /* fields omitted */ }

Methods

impl<File: SpanFile> Span<File>[src]

pub fn new(
    file: File,
    start: impl Into<ByteIndex>,
    end: impl Into<ByteIndex>
) -> Self
[src]

pub fn initial(file: File) -> Self[src]

Gives an empty span at the start of file.

pub fn eof(file: File, text: &Text) -> Self[src]

Gives the "EOF" span for a file with the given text. This is an empty span pointing at the end.

pub fn extended_until_end_of(self, other_span: Span<File>) -> Span<File>[src]

Returns a span beginning at the start of this span but ending at the end of other_span (which must be within the same file).

pub fn file(&self) -> File[src]

pub fn start(&self) -> ByteIndex[src]

pub fn end(&self) -> ByteIndex[src]

pub fn in_file<NewFile: SpanFile>(self, file: NewFile) -> Span<NewFile>[src]

pub fn in_file_named(self, file: FileName) -> Span<FileName>[src]

pub fn contains(self, span: Span<File>) -> bool[src]

pub fn contains_index(self, index: ByteIndex) -> bool[src]

pub fn len(&self) -> ByteSize[src]

pub fn relative_to_entity(self, entity_span: Span<File>) -> Span<CurrentEntity>[src]

Trait Implementations

impl<File: Eq + SpanFile> Eq for Span<File>[src]

impl<File: Clone + SpanFile> Clone for Span<File>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<File: Copy + SpanFile> Copy for Span<File>[src]

impl<File: PartialOrd + SpanFile> PartialOrd<Span<File>> for Span<File>[src]

impl<File: PartialEq + SpanFile> PartialEq<Span<File>> for Span<File>[src]

impl<File: Ord + SpanFile> Ord for Span<File>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<File: Hash + SpanFile> Hash for Span<File>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<File: SpanFile> Index<Span<File>> for Text[src]

type Output = str

The returned type after indexing.

impl<File: SpanFile> Index<Span<File>> for str[src]

type Output = str

The returned type after indexing.

impl<File: Debug + SpanFile> Debug for Span<File>[src]

impl<File: SpanFile + DebugWith> DebugWith for Span<File>[src]

fn debug_with<Cx>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, &'me Self, Cx> where
    Cx: ?Sized
[src]

fn into_debug_with<Cx>(self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> where
    Cx: ?Sized
[src]

impl<F: SpanFile> ReportingSpan for Span<F>[src]

Auto Trait Implementations

impl<File> Send for Span<File> where
    File: Send

impl<File> Sync for Span<File> where
    File: Sync

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized
[src]

impl<T> Erased for T