pub struct Coord(/* private fields */);Expand description
Absolute grid coordinate (row, column) with Excel-compatible bounds.
Implementations§
Source§impl Coord
impl Coord
pub const INVALID: Self
Sourcepub fn new(row: u32, col: u32) -> Self
pub fn new(row: u32, col: u32) -> Self
Construct a coordinate, panicking if values exceed the supported limits.
Sourcepub fn from_excel(row: u32, col: u32) -> Self
pub fn from_excel(row: u32, col: u32) -> Self
Construct from Excel 1-based coordinates.
Sourcepub fn try_new(row: u32, col: u32) -> Result<Self, CoordError>
pub fn try_new(row: u32, col: u32) -> Result<Self, CoordError>
Fallible constructor that reports overflow rather than panicking.
Sourcepub fn from_raw(raw: u64) -> Result<Self, CoordError>
pub fn from_raw(raw: u64) -> Result<Self, CoordError>
Reconstruct from a raw packed value, ensuring reserved bits stay zero.
pub fn row(self) -> u32
pub fn col(self) -> u32
pub fn as_u64(self) -> u64
pub fn is_valid(self) -> bool
Sourcepub fn into_relative(self) -> RelativeCoord
pub fn into_relative(self) -> RelativeCoord
Convert to a relative coordinate with absolute anchors on both axes.
Sourcepub fn try_from_a1(input: &str) -> Result<Self, A1ParseError>
pub fn try_from_a1(input: &str) -> Result<Self, A1ParseError>
Parse an A1-style reference (e.g. "A1", "$B$12") into a Coord.
Trait Implementations§
Source§impl From<Coord> for RelativeCoord
impl From<Coord> for RelativeCoord
Source§impl From<RelativeCoord> for Coord
impl From<RelativeCoord> for Coord
Source§fn from(value: RelativeCoord) -> Self
fn from(value: RelativeCoord) -> Self
Converts to this type from the input type.
impl Copy for Coord
impl Eq for Coord
impl StructuralPartialEq for Coord
Auto Trait Implementations§
impl Freeze for Coord
impl RefUnwindSafe for Coord
impl Send for Coord
impl Sync for Coord
impl Unpin for Coord
impl UnsafeUnpin for Coord
impl UnwindSafe for Coord
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
Mutably borrows from an owned value. Read more