Struct mediawiki_parser::Position
source · Expand description
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
Implementations§
source§impl Position
impl Position
pub fn new(offset: usize, slocs: &[SourceLine<'_>]) -> Self
pub fn any_position() -> Self
Trait Implementations§
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