| Crates.io | formualizer-common |
| lib.rs | formualizer-common |
| version | 0.1.0 |
| created_at | 2025-09-20 00:07:27.219262+00 |
| updated_at | 2025-09-20 00:07:27.219262+00 |
| description | Shared value, reference, function, and error types for the Formualizer spreadsheet engine |
| homepage | https://github.com/psu3d0/formualizer |
| repository | https://github.com/psu3d0/formualizer |
| max_upload_size | |
| id | 1847276 |
| size | 28,556 |
formualizer-common hosts the shared data structures that keep the Formualizer
spreadsheet engine cohesive across crates and language bindings. Types in this
crate represent literal values, ranges, function signatures, and diagnostic
errors that travel between the parser, evaluator, workbook, and external
surfaces.
Note: This crate exists primarily to satisfy compile-time sharing across the Formualizer workspace. It is published so downstream crates resolve, but its APIs are considered internal and may change between releases without notice. Prefer the higher-level
formualizer-*crates unless you are working within the Formualizer project itself.
LiteralValue and related helpers cover Excel
scalars, arrays, dates/times, and error variants with round-trippable
conversions.ExcelError and evaluation diagnostics shared
across Rust, Python, and WASM bindings.Most users interact with higher-level crates such as formualizer-parse,
formualizer-eval, or formualizer-workbook. Depend on formualizer-common
directly if you need the shared types in a standalone integration or when
building a new Formualizer dialect/binding.
use formualizer_common::{ExcelError, ExcelErrorKind, LiteralValue};
fn normalize(value: LiteralValue) -> LiteralValue {
match value {
LiteralValue::Text(text) if text.is_empty() => LiteralValue::Empty,
LiteralValue::Boolean(_) | LiteralValue::Number(_) => value,
LiteralValue::Error(_) => value,
other => other.coerce_to_single_value().unwrap_or_else(|_| {
LiteralValue::Error(ExcelError::from(ExcelErrorKind::Value))
})
}
}
Dual-licensed under MIT or Apache-2.0, at your option.
See the main project README for contributor guidelines and release steps.