UPDATE: Adds bincode to serializer/deserializer

This commit is contained in:
Nicolás Hatcher
2024-03-13 07:49:05 +01:00
parent 1381533b9c
commit afecf29356
7 changed files with 132 additions and 30 deletions

View File

@@ -7,6 +7,7 @@
//! IronCalc is row first. A cell is referenced by (`sheet`, `row`, `column`)
//!
use bincode::config;
use serde_json::json;
use std::collections::HashMap;
@@ -1718,6 +1719,12 @@ impl Model {
}
}
/// bin
pub fn to_binary_str(&self) -> Vec<u8> {
let config = config::standard();
bincode::encode_to_vec(&self.workbook, config).expect("")
}
/// Returns markup representation of the given `sheet`.
pub fn sheet_markup(&self, sheet: u32) -> Result<String, String> {
let worksheet = self.workbook.worksheet(sheet)?;