[−][src]Struct lark_span::Span
Methods
impl<File: SpanFile> Span<File>
[src]
pub fn new(
file: File,
start: impl Into<ByteIndex>,
end: impl Into<ByteIndex>
) -> Self
[src]
file: File,
start: impl Into<ByteIndex>,
end: impl Into<ByteIndex>
) -> Self
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(&self) -> 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]
fn partial_cmp(&self, other: &Span<File>) -> Option<Ordering>
[src]
fn lt(&self, other: &Span<File>) -> bool
[src]
fn le(&self, other: &Span<File>) -> bool
[src]
fn gt(&self, other: &Span<File>) -> bool
[src]
fn ge(&self, other: &Span<File>) -> bool
[src]
impl<File: PartialEq + SpanFile> PartialEq<Span<File>> for Span<File>
[src]
impl<File: Ord + SpanFile> Ord for Span<File>
[src]
fn cmp(&self, other: &Span<File>) -> Ordering
[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<__HFile: Hasher>(&self, state: &mut __HFile)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<File: SpanFile> Index<Span<File>> for Text
[src]
impl<File: SpanFile> Index<Span<File>> for str
[src]
impl<File: Debug + SpanFile> Debug for Span<File>
[src]
impl<File: SpanFile + DebugWith> DebugWith for Span<File>
[src]
fn fmt_with<Cx: ?Sized>(&self, cx: &Cx, fmt: &mut Formatter) -> Result
[src]
fn debug_with<Cx>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, &'me Self, Cx> where
Cx: ?Sized,
[src]
Cx: ?Sized,
fn into_debug_with<Cx>(self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> where
Cx: ?Sized,
[src]
Cx: ?Sized,
impl<F: SpanFile> ReportingSpan for Span<F>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<Cx, T> FmtWithSpecialized for T where
Cx: ?Sized,
T: Debug + ?Sized,
[src]
Cx: ?Sized,
T: Debug + ?Sized,