pub struct Position { /* private fields */ }Expand description
A position in the ECMAScript source code.
Stores both the column number and the line number.
§Similar Implementations
Implementations§
Source§impl Position
impl Position
Sourcepub const fn new(line_number: u32, column_number: u32) -> Self
pub const fn new(line_number: u32, column_number: u32) -> Self
Creates a new Position from Non-Zero values.
§Panics
Will panic if the line number or column number is zero.
Sourcepub const fn line_number(self) -> u32
pub const fn line_number(self) -> u32
Gets the line number of the position.
Sourcepub const fn column_number(self) -> u32
pub const fn column_number(self) -> u32
Gets the column number of the position.
Trait Implementations§
impl Copy for Position
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Position
Source§impl From<(NonZero<u32>, NonZero<u32>)> for Position
impl From<(NonZero<u32>, NonZero<u32>)> for Position
Source§fn from(value: (NonZeroU32, NonZeroU32)) -> Self
fn from(value: (NonZeroU32, NonZeroU32)) -> Self
Converts to this type from the input type.
Source§impl From<PositionGroup> for Position
impl From<PositionGroup> for Position
Source§fn from(value: PositionGroup) -> Self
fn from(value: PositionGroup) -> Self
Converts to this type from the input type.
Source§impl Ord for Position
impl Ord for Position
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Position
impl PartialOrd for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.