Struct spreadsheet_ods::refs::CellRange

source ·
pub struct CellRange { /* private fields */ }
Expand description

A cell-range.

As usual for a spreadsheet this is meant as inclusive from and to.

// // let r1 = CellRange::local(0, 0, 9, 9); // let r2 = CellRange::origin_span(5, 5, (3, 3)); //

Implementations§

source§

impl CellRange

source

pub fn new_all( iri: Option<String>, from_table: Option<String>, from_row_abs: bool, from_row: u32, from_col_abs: bool, from_col: u32, to_table: Option<String>, to_row_abs: bool, to_row: u32, to_col_abs: bool, to_col: u32, ) -> Self

Create a CellRange with all possible arguments.

source

pub fn new() -> Self

Empty

source

pub fn local(row: u32, col: u32, to_row: u32, to_col: u32) -> Self

Creates the cell range from from + to data.

Panic

If row > to_row or col > to_col.

source

pub fn remote<S: Into<String>>( table: S, row: u32, col: u32, to_row: u32, to_col: u32, ) -> Self

Creates the cell range from from + to data.

Panic

If row > to_row or col > to_col.

source

pub fn origin_span(row: u32, col: u32, span: (u32, u32)) -> Self

Creates the cell range from origin + spanning data.

Panic

Both span values must be > 0.

source

pub fn set_iri<S: Into<String>>(&mut self, iri: S)

External file

source

pub fn iri(&self) -> Option<&String>

External file

source

pub fn set_table<S: Into<String>>(&mut self, table: S)

Table name for references into other tables.

source

pub fn table(&self) -> Option<&String>

Table name for references into other tables.

source

pub fn set_row(&mut self, row: u32)

Row

source

pub fn row(&self) -> u32

Row

source

pub fn set_row_abs(&mut self, abs: bool)

“$” row reference

source

pub fn row_abs(&self) -> bool

“$” row reference

source

pub fn set_col(&mut self, col: u32)

Column

source

pub fn col(&self) -> u32

Column

source

pub fn set_col_abs(&mut self, abs: bool)

“$” column reference

source

pub fn col_abs(&self) -> bool

“$” column reference

source

pub fn set_to_table<S: Into<String>>(&mut self, table: S)

Table name for references into other tables.

source

pub fn to_table(&self) -> Option<&String>

Table name for references into other tables.

source

pub fn set_to_row(&mut self, to_row: u32)

To row

source

pub fn to_row(&self) -> u32

To row

source

pub fn set_to_row_abs(&mut self, abs: bool)

“$” row reference

source

pub fn to_row_abs(&self) -> bool

“$” row reference

source

pub fn set_to_col(&mut self, to_col: u32)

To column

source

pub fn to_col(&self) -> u32

To column

source

pub fn set_to_col_abs(&mut self, abs: bool)

“$” column reference

source

pub fn to_col_abs(&self) -> bool

“$” column reference

source

pub fn to_formula(&self) -> String

Returns a range reference for a formula.

source

pub fn absolute(self) -> Self

Makes this CellReference into an absolute reference.

source

pub fn absolute_rows(self) -> Self

Makes this CellReference into an absolute reference. The columns remain relative, the rows are fixed.

source

pub fn absolute_cols(self) -> Self

Makes this CellReference into an absolute reference. The rows remain relative, the columns are fixed.

source

pub fn contains(&self, row: u32, col: u32) -> bool

Does the range contain the cell. This is inclusive for to_row and to_col!

source

pub fn out_looped(&self, row: u32, col: u32) -> bool

Is this range any longer relevant, when looping rows first, then columns?

Trait Implementations§

source§

impl Clone for CellRange

source§

fn clone(&self) -> CellRange

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CellRange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CellRange

source§

fn default() -> CellRange

Returns the “default value” for a type. Read more
source§

impl Display for CellRange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl GetSize for CellRange

source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
source§

impl PartialEq for CellRange

source§

fn eq(&self, other: &CellRange) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&str> for CellRange

§

type Error = OdsError

The type returned in the event of a conversion error.
source§

fn try_from(s: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for CellRange

source§

impl StructuralPartialEq for CellRange

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.