pub struct Cell {
pub contents: CellType,
pub depends_on: Vec<CellRef>,
pub dirty: bool,
pub cached_value: Option<String>,
}Expand description
A cell in the spreadsheet grid.
Fields§
§contents: CellType§depends_on: Vec<CellRef>§dirty: bool§cached_value: Option<String>Cached display string for script cells (not serialized).
Implementations§
Source§impl Cell
impl Cell
pub fn new_empty() -> Cell
pub fn new_text(text: &str) -> Cell
pub fn new_number(n: f64) -> Cell
Sourcepub fn new_script(script: &str) -> Cell
pub fn new_script(script: &str) -> Cell
Create a new cell containing a script/formula. Dependencies are automatically extracted from the script.
Sourcepub fn from_input(input: &str) -> Cell
pub fn from_input(input: &str) -> Cell
Parse user input and create appropriate cell type.
- Empty string or whitespace -> Empty
- Starts with ‘=’ -> Script (without the ‘=’)
- Quoted string -> Text (without quotes)
- Valid number -> Number
- Otherwise -> Text
Sourcepub fn to_input_string(&self) -> String
pub fn to_input_string(&self) -> String
Get a display string for the cell content (for editing).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cell
impl<'de> Deserialize<'de> for Cell
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Cell
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more