pub struct RelativeCoord(/* private fields */);Expand description
Relative coordinate (row, column) with anchor flags.
Anchor bits mirror Excel semantics:
row_abs = truekeeps the row fixed during rebasing.col_abs = truekeeps the column fixed during rebasing.
Implementations§
Source§impl RelativeCoord
impl RelativeCoord
pub fn new(row: u32, col: u32, row_abs: bool, col_abs: bool) -> Self
pub fn try_new( row: u32, col: u32, row_abs: bool, col_abs: bool, ) -> Result<Self, CoordError>
pub fn from_raw(raw: u64) -> Result<Self, CoordError>
pub fn row(self) -> u32
pub fn col(self) -> u32
pub fn row_abs(self) -> bool
pub fn col_abs(self) -> bool
pub fn with_row_abs(self, abs: bool) -> Self
pub fn with_col_abs(self, abs: bool) -> Self
Sourcepub fn offset(self, drow: i32, dcol: i32) -> Self
pub fn offset(self, drow: i32, dcol: i32) -> Self
Offset by signed deltas, ignoring anchor flags (matching legacy behaviour).
Sourcepub fn rebase(self, origin: RelativeCoord, target: RelativeCoord) -> Self
pub fn rebase(self, origin: RelativeCoord, target: RelativeCoord) -> Self
Rebase as if the enclosing formula moved from origin to target.
pub fn into_absolute(self) -> Coord
pub fn as_u64(self) -> u64
pub fn col_to_letters(col: u32) -> String
pub fn letters_to_col(s: &str) -> Option<u32>
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 into a RelativeCoord.
Trait Implementations§
Source§impl Clone for RelativeCoord
impl Clone for RelativeCoord
Source§fn clone(&self) -> RelativeCoord
fn clone(&self) -> RelativeCoord
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelativeCoord
impl Debug for RelativeCoord
Source§impl Display for RelativeCoord
impl Display for RelativeCoord
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.
Source§impl FromStr for RelativeCoord
impl FromStr for RelativeCoord
Source§impl Hash for RelativeCoord
impl Hash for RelativeCoord
Source§impl Ord for RelativeCoord
impl Ord for RelativeCoord
Source§impl PartialEq for RelativeCoord
impl PartialEq for RelativeCoord
Source§impl PartialOrd for RelativeCoord
impl PartialOrd for RelativeCoord
Source§impl TryFrom<&str> for RelativeCoord
impl TryFrom<&str> for RelativeCoord
impl Copy for RelativeCoord
impl Eq for RelativeCoord
impl StructuralPartialEq for RelativeCoord
Auto Trait Implementations§
impl Freeze for RelativeCoord
impl RefUnwindSafe for RelativeCoord
impl Send for RelativeCoord
impl Sync for RelativeCoord
impl Unpin for RelativeCoord
impl UnwindSafe for RelativeCoord
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)