Struct office::Range
[−]
[src]
pub struct Range { /* fields omitted */ }
A struct which represents a squared selection of cells
Methods
impl Range
[src]
fn new(position: (u32, u32), size: (usize, usize)) -> Range
Creates a new range
fn get_position(&self) -> (u32, u32)
Get top left cell position (row, column)
fn get_size(&self) -> (usize, usize)
Get size
fn set_value(&mut self, pos: (u32, u32), value: DataType)
Set inner value
Panics if indexes are out of range bounds
Examples
use office::{Range, DataType}; let mut range = Range::new((0, 0), (5, 2)); assert_eq!(range.get_value(2, 1), &DataType::Empty); range.set_value((2, 1), DataType::Float(1.0)); assert_eq!(range.get_value(2, 1), &DataType::Float(1.0));
fn get_value(&self, i: usize, j: usize) -> &DataType
Get cell value
Panics if indexes are out of range bounds
fn rows(&self) -> Rows
Get an iterator over inner rows
Examples
use office::{Range, DataType}; let range = Range::new((0, 0), (5, 2)); // with rows item row: &[DataType] assert_eq!(range.rows().flat_map(|row| row).count(), 10);
Trait Implementations
impl Debug for Range
[src]
impl Default for Range
[src]
impl Clone for Range
[src]
fn clone(&self) -> Range
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more