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: usize

The 1-based line number of the character.

column: usize

The 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) -> LineColumn

Return 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>

impl StructuralPartialEq for LineColumn

Auto Trait Implementations

impl Freeze for LineColumn

impl RefUnwindSafe for LineColumn

impl Send for LineColumn

impl Sync for LineColumn

impl Unpin for LineColumn

impl UnsafeUnpin for LineColumn

impl UnwindSafe for LineColumn

Blanket Implementations

impl<F, T, S> SimdInto<T, S> for LineColumn where T: SimdFrom<F, S>, S: Simd,

impl<T> Any for LineColumn where T: 'static + ?Sized,

impl<T> Borrow<T> for LineColumn where T: ?Sized,

impl<T> BorrowMut<T> for LineColumn where T: ?Sized,

impl<T> CloneToUninit for LineColumn where T: Clone,

impl<T> From<T> for LineColumn

impl<T> ToOwned for LineColumn where T: Clone,

impl<T, S> SimdFrom<T, S> for LineColumn where S: Simd,

impl<T, U> Into<U> for LineColumn where U: From<T>,

impl<T, U> TryFrom<U> for LineColumn where U: Into<T>,

impl<T, U> TryInto<U> for LineColumn where U: TryFrom<T>,