Struct office::Range [] [src]

pub struct Range { /* fields omitted */ }

A struct which represents a squared selection of cells

Methods

impl Range
[src]

Creates a new range

Get top left cell position (row, column)

Get size

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));

Get cell value

Panics if indexes are out of range bounds

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]

Formats the value using the given formatter.

impl Default for Range
[src]

Returns the "default value" for a type. Read more

impl Clone for Range
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more