Struct mediawiki_parser::Position [−][src]
Represents a position in the source document.
The PartialEq
implementation allows for a "any" position (all zero), which is
equal to any other position. This is used to reduce clutter in tests, where
a default Position ("{}") can be used where the actual representation is irrelevant.
Fields
offset: usize
line: usize
col: usize
Methods
impl Position
[src]
impl Position
pub fn new(offset: usize, slocs: &[SourceLine]) -> Self
[src]
pub fn new(offset: usize, slocs: &[SourceLine]) -> Self
pub fn any_position() -> Self
[src]
pub fn any_position() -> Self
Trait Implementations
impl Debug for Position
[src]
impl Debug for Position
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Position
[src]
impl Clone for Position
fn clone(&self) -> Position
[src]
fn clone(&self) -> Position
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Position
[src]
impl PartialEq for Position