Skip to main content

Source

Trait Source 

Source
pub trait Source: Debug {
    // Required methods
    fn label(&self) -> &str;
    fn sheets(&self) -> &[SheetInfo];
    fn names(&self) -> &[NameInfo];
    fn tables(&self) -> &[TableInfo];
    fn external_books(&self) -> &[String];
    fn summary(&self) -> Summary;
    fn walk_sheet_with(
        &self,
        index: usize,
        sink: &mut dyn Sink,
        book_distinct: &mut HashSet<String>,
    ) -> Result<SheetStats, Refusal>;

    // Provided methods
    fn walk_sheet(
        &self,
        index: usize,
        sink: &mut dyn Sink,
    ) -> Result<SheetStats, Refusal> { ... }
    fn printed_name(&self, name: &NameInfo) -> String { ... }
    fn header_rows(&self, sink: &mut dyn Sink) { ... }
}
Expand description

A workbook opened far enough to walk, in either format: what the door, diff, audit and --cone ask of a file. The sheet parts are read one at a time by Source::walk_sheet and dropped.

Required Methods§

Source

fn label(&self) -> &str

What a refusal calls the file.

Source

fn sheets(&self) -> &[SheetInfo]

Source

fn names(&self) -> &[NameInfo]

Source

fn tables(&self) -> &[TableInfo]

Source

fn external_books(&self) -> &[String]

The other workbooks the file links to, by file name.

Source

fn summary(&self) -> Summary

The counts --counts prints for the workbook.

Source

fn walk_sheet_with( &self, index: usize, sink: &mut dyn Sink, book_distinct: &mut HashSet<String>, ) -> Result<SheetStats, Refusal>

One sheet’s cells in document order, to the sink: a cell row for a value the file holds, a formula row for a formula, then its refers rows; with the workbook-wide set of distinct R1C1 formulas carried across sheets for --counts. What the walk counted comes back.

Provided Methods§

Source

fn walk_sheet( &self, index: usize, sink: &mut dyn Sink, ) -> Result<SheetStats, Refusal>

Source::walk_sheet_with with no workbook-wide set.

Source

fn printed_name(&self, name: &NameInfo) -> String

A name row’s first field: the name, a sheet-scoped one behind its sheet as a reference quotes it (Model!Local). The key diff and audit match names by.

Source

fn header_rows(&self, sink: &mut dyn Sink)

The rows that come before any cell, in the fixed order: every sheet row in tab order, every name row sorted by its name without case, every table row by its sheet’s tab order then its name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§