Struct LineColumn
pub struct LineColumn { pub line: usize, pub column: usize }
Represents the 1-based line and column positions of a given character.
By default, the column value is measured in UTF-8 byte offsets (1-based),
matching cmark behavior. This means multi-byte UTF-8 characters
(for example, ö or 好) increase the column count by their byte
length rather than by Rust's char count.
Enable [parse.sourcepos_chars][crate::options::Parse#structfield.sourcepos_chars] to have
column values reported as a Unicode character count instead.
Fields
line: usizeThe 1-based line number of the character.
column: usizeThe 1-based column number of the character.
By default this is counted in UTF-8 bytes (so a 3-byte character increments the column by 3). Enable [
parse.sourcepos_chars][crate::options::Parse#structfield.sourcepos_chars] to have it reported as a Unicode character count instead.
Implementations
impl LineColumn
fn column_add(&self, offset: isize) -> LineColumnReturn a new LineColumn based on this one, with the column adjusted by offset.
Trait Implementations
impl Clone for LineColumn
fn clone(&self) -> Self
impl Copy for LineColumn
impl Debug for LineColumn
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for LineColumn
fn default() -> Self
impl Eq for LineColumn
impl From<(usize, usize)> for LineColumn
fn from(lc: (usize, usize)) -> LineColumn
impl Ord for LineColumn
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for LineColumn
fn eq(&self, other: &Self) -> bool
impl PartialOrd for LineColumn
fn partial_cmp(&self, other: &Self) -> Option<Ordering>