#[repr(C)]
pub struct Loc {
pub begin: usize,
pub end: usize,
}
Expand description
Representation of any location in the given input
Converts location to a range
Constructs a new Loc struct
Returns begin
field of the Loc
Returns end
field of the Loc
Returns size of the Loc
(i.e. end - begin
)
Returns a new Loc
with given begin
and current end
Returns a new Loc
with given end
and current begin
Adds given delta
to begin
Returns a new Loc
with the same begin
, but adjusted end
,
so that its size is equal to given new_size
Joins two Loc
s by choosing min(begin)
+ max(end)
Returns true if Loc
is empty (i.e. begin
== end
)
Returns source code of the current Loc
on a given Input
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.