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
impl Position
[src]
impl Position
[src]pub fn line(self) -> Option<usize>
[src]
pub fn line(self) -> Option<usize>
[src]Get the line number (1-based), or None
if there is no position.
pub fn position(self) -> Option<usize>
[src]
pub fn position(self) -> Option<usize>
[src]Get the character position (1-based), or None
if at beginning of a line.
pub fn is_beginning_of_line(self) -> bool
[src]
pub fn is_beginning_of_line(self) -> bool
[src]Is this Position
at the beginning of a line?
Trait Implementations
impl AddAssign<Position> for Position
[src]
impl AddAssign<Position> for Position
[src]fn add_assign(&mut self, rhs: Self)
[src]
fn add_assign(&mut self, rhs: Self)
[src]Performs the +=
operation. Read more
impl Ord for Position
[src]
impl Ord for Position
[src]impl PartialOrd<Position> for Position
[src]
impl PartialOrd<Position> for Position
[src]fn partial_cmp(&self, other: &Position) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Position) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Position
[src]
impl Eq for Position
[src]
impl StructuralEq for Position
[src]
impl StructuralPartialEq for Position
[src]
Auto Trait Implementations
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more