pub struct Formula {
pub text: String,
pub expr: Option<Arc<Expr>>,
pub array: Option<RangeRef>,
pub dynamic: bool,
}Expand description
A parsed formula. text is the canonical formula text without the leading =.
Fields§
§text: String§expr: Option<Arc<Expr>>§array: Option<RangeRef>Legacy array formula (Ctrl+Shift+Enter) covering this range; the formula lives in the top-left cell.
dynamic: boolRead from a file that marks this formula as a dynamic-array formula (cell metadata cm).
The writer keeps the mark, so a formula Excel evaluates as an array is never saved as a
legacy formula (which Excel evaluates with implicit intersection). Formulas entered or
rewritten in GridCraft start without it, and the writer decides from their shape.
Implementations§
Source§impl Formula
impl Formula
Sourcepub fn new(text: &str) -> Formula
pub fn new(text: &str) -> Formula
Parses text (with or without =). Unparseable formulas keep their text and evaluate to
#NAME?.
pub fn from_expr(e: Expr) -> Formula
Sourcepub fn expr_arc(&self) -> Option<Arc<Expr>>
pub fn expr_arc(&self) -> Option<Arc<Expr>>
The parsed expression without copying it (re-parses after deserialization).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Formula
impl<'de> Deserialize<'de> for Formula
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
impl StructuralPartialEq for Formula
Auto Trait Implementations§
impl Freeze for Formula
impl RefUnwindSafe for Formula
impl Send for Formula
impl Sync for Formula
impl Unpin for Formula
impl UnsafeUnpin for Formula
impl UnwindSafe for Formula
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