Workbook

Struct Workbook 

Source
pub struct Workbook { /* private fields */ }
Expand description

Engine-backed workbook facade.

Implementations§

Source§

impl Workbook

Source

pub fn new_with_config(config: EvalConfig) -> Self

Source

pub fn new() -> Self

Source

pub fn engine(&self) -> &Engine<WBResolver>

Source

pub fn engine_mut(&mut self) -> &mut Engine<WBResolver>

Source

pub fn set_changelog_enabled(&mut self, enabled: bool)

Source

pub fn begin_action(&mut self, description: impl Into<String>)

Source

pub fn end_action(&mut self)

Source

pub fn undo(&mut self) -> Result<(), IoError>

Source

pub fn redo(&mut self) -> Result<(), IoError>

Source

pub fn sheet_names(&self) -> Vec<String>

Source

pub fn sheet_dimensions(&self, name: &str) -> Option<(u32, u32)>

Return (rows, cols) for a sheet if present in the Arrow store

Source

pub fn has_sheet(&self, name: &str) -> bool

Source

pub fn add_sheet(&mut self, name: &str)

Source

pub fn delete_sheet(&mut self, name: &str)

Source

pub fn rename_sheet(&mut self, old: &str, new: &str)

Source

pub fn set_value( &mut self, sheet: &str, row: u32, col: u32, value: LiteralValue, ) -> Result<(), IoError>

Source

pub fn set_formula( &mut self, sheet: &str, row: u32, col: u32, formula: &str, ) -> Result<(), IoError>

Source

pub fn get_value(&self, sheet: &str, row: u32, col: u32) -> Option<LiteralValue>

Source

pub fn get_formula(&self, sheet: &str, row: u32, col: u32) -> Option<String>

Source

pub fn read_range(&self, addr: &RangeAddress) -> Vec<Vec<LiteralValue>>

Source

pub fn write_range( &mut self, sheet: &str, _start: (u32, u32), cells: BTreeMap<(u32, u32), CellData>, ) -> Result<(), IoError>

Source

pub fn set_values( &mut self, sheet: &str, start_row: u32, start_col: u32, rows: &[Vec<LiteralValue>], ) -> Result<(), IoError>

Source

pub fn set_formulas( &mut self, sheet: &str, start_row: u32, start_col: u32, rows: &[Vec<String>], ) -> Result<(), IoError>

Source

pub fn prepare_graph_all(&mut self) -> Result<(), IoError>

Source

pub fn prepare_graph_for_sheets<'a, I: IntoIterator<Item = &'a str>>( &mut self, sheets: I, ) -> Result<(), IoError>

Source

pub fn evaluate_cell( &mut self, sheet: &str, row: u32, col: u32, ) -> Result<LiteralValue, IoError>

Source

pub fn evaluate_cells( &mut self, targets: &[(&str, u32, u32)], ) -> Result<Vec<LiteralValue>, IoError>

Source

pub fn evaluate_all(&mut self) -> Result<EvalResult, IoError>

Source

pub fn evaluate_with_plan( &mut self, plan: &RecalcPlan, ) -> Result<EvalResult, IoError>

Source

pub fn named_range_address(&self, name: &str) -> Option<RangeAddress>

Resolve a named range (workbook-scoped or unique sheet-scoped) to an absolute address.

Source

pub fn begin_tx<'a, W: SpreadsheetWriter>( &'a mut self, writer: &'a mut W, ) -> WriteTransaction<'a, W>

Source

pub fn from_reader<B: SpreadsheetReader>( backend: B, strategy: LoadStrategy, config: EvalConfig, ) -> Result<Self, IoError>

Trait Implementations§

Source§

impl Default for Workbook

Source§

fn default() -> Self

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

impl SpreadsheetWriter for Workbook

Source§

type Error = IoError

Source§

fn write_cell( &mut self, sheet: &str, row: u32, col: u32, data: CellData, ) -> Result<(), Self::Error>

Source§

fn write_range( &mut self, sheet: &str, cells: BTreeMap<(u32, u32), CellData>, ) -> Result<(), Self::Error>

Source§

fn clear_range( &mut self, sheet: &str, start: (u32, u32), end: (u32, u32), ) -> Result<(), Self::Error>

Source§

fn create_sheet(&mut self, name: &str) -> Result<(), Self::Error>

Source§

fn delete_sheet(&mut self, name: &str) -> Result<(), Self::Error>

Source§

fn rename_sheet(&mut self, old: &str, new: &str) -> Result<(), Self::Error>

Source§

fn flush(&mut self) -> Result<(), Self::Error>

Source§

fn save(&mut self) -> Result<(), Self::Error>

Source§

fn save_to<'a>( &mut self, dest: SaveDestination<'a>, ) -> Result<Option<Vec<u8>>, Self::Error>

Advanced save: specify destination (in place, path, writer, or bytes in memory). Returns Ok(Some(bytes)) only for Bytes destination, else Ok(None).
Source§

fn save_as_path<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Self::Error>

Source§

fn save_to_bytes(&mut self) -> Result<Vec<u8>, Self::Error>

Source§

fn write_to<W: Write>(&mut self, writer: &mut W) -> Result<(), Self::Error>

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V