Struct rhai::Position [−][src]
pub struct Position { /* fields omitted */ }
Expand description
A location (line number + character position) in the input script.
Limitations
In order to keep footprint small, both line number and character position have 16-bit resolution, meaning they go up to a maximum of 65,535 lines and 65,535 characters per line.
Advancing beyond the maximum line length or maximum number of lines is not an error but has no effect.
Implementations
Create a new Position
.
line
must not be zero.
If position
is zero, then it is at the beginning of a line.
Panics
Panics if line
is zero.
Get the line number (1-based), or None
if there is no position.
Get the character position (1-based), or None
if at beginning of a line.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Position
impl UnwindSafe for Position
Blanket Implementations
Mutably borrows from an owned value. Read more