pub struct Position {
pub line: u32,
pub column: u32,
}Expand description
1-indexed line/column pair — what humans see in editors.
Fields§
§line: u32§column: u32Implementations§
Source§impl Position
impl Position
Sourcepub const fn new(line: u32, column: u32) -> Self
pub const fn new(line: u32, column: u32) -> Self
Substrate-primitive constructor every producer of a
1-indexed line/column pair reads through — folds the two-slot
Position { line, column } struct-literal wire-up (the sole
production emitter line_column’s tail, plus every
per-fixture line/column literal in the sibling test module)
onto one pub const fn dispatch. Matches the sibling
Span::new / Span::point pub const fn shape on the
same caixa-ast source-position primitive family; every
downstream LSP hover-registry / diagnostic emitter / future
position-carrying trivia-registry that wants a compile-time
position fixture (a const AT: Position = Position::new(1, 4);
LSP hover-oracle default, a per-diagnostic const-context
leading-position fixture, a compile-time position-partition
truth table the caixa-fmt trivia-owner resolver keys off)
now reaches through one substrate-primitive const dispatch
rather than duplicating the two-slot struct literal at every
construction site.
Sourcepub const fn origin() -> Self
pub const fn origin() -> Self
Canonical origin — line 1, column 1, matching the
line_column convention (both axes 1-indexed). pub const fn — the shape materialises at compile time so a future
const-context consumer (a substrate-wide const ORIGIN: Position = Position::origin(); LSP hover-oracle default, a
per-diagnostic const-context leading-position fixture that
today reaches for the (1, 1) magic pair inline) reads
through one substrate-primitive const dispatch rather than
duplicating the (1, 1) origin literal at every consumer.
Trait Implementations§
impl Copy for Position
impl Eq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.