pub enum ValueErrorKind {
TypeMismatch,
DimensionMismatch,
DivisionByZero,
MissingInput,
Custom(String),
Null,
Ref,
Name,
Num,
Na,
}Expand description
The kind of an error value. The first four are the spreadsheet errors a
formula produces (named as Excel shows them, see ValueErrorKind::code);
the rest carry Improv’s own structural and external-function failures.
Variant names are persisted (an error literal in a stored formula), so
existing names keep their meaning: DivisionByZero is #DIV/0! and
TypeMismatch is #VALUE!.
Variants§
TypeMismatch
#VALUE!: wrong value type for an operation.
DimensionMismatch
Dimensions don’t line up (a structural error).
DivisionByZero
#DIV/0!.
MissingInput
A required input cell had no value.
Custom(String)
Null
#NULL!.
Ref
#REF!.
Name
#NAME?.
Num
#NUM!: a numeric domain error (SQRT(-1), LN(0), overflow).
Na
#N/A: no value available (NA(), a failed lookup).
Implementations§
Source§impl ValueErrorKind
impl ValueErrorKind
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
The spreadsheet error text: #DIV/0!, #N/A, …; Improv’s own kinds
show as #ERR.
Sourcepub fn error_type(&self) -> Option<u8>
pub fn error_type(&self) -> Option<u8>
ERROR.TYPE’s number for a spreadsheet error (1 #NULL! … 7 #N/A),
or None for Improv’s own kinds.
Sourcepub fn from_error_type(n: u8) -> Option<Self>
pub fn from_error_type(n: u8) -> Option<Self>
The kind for an ERROR.TYPE number (the inverse of Self::error_type).
Trait Implementations§
Source§impl Clone for ValueErrorKind
impl Clone for ValueErrorKind
Source§fn clone(&self) -> ValueErrorKind
fn clone(&self) -> ValueErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more