#[non_exhaustive]pub enum ExcelError {
Null,
DivisionByZero,
Value,
Reference,
Name,
Number,
NotAvailable,
GettingData,
Spill,
Calculation,
}Expand description
An error value stored by a spreadsheet cell.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Null
#NULL!
DivisionByZero
#DIV/0!
Value
#VALUE!
Reference
#REF!
Name
#NAME?
Number
#NUM!
NotAvailable
#N/A
GettingData
#GETTING_DATA
Spill
#SPILL!
Calculation
#CALC!
Implementations§
Source§impl ExcelError
impl ExcelError
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the canonical display form.
Examples found in repository?
examples/select_calculation_modes.rs (line 79)
73fn render(calculation: &CalculationSnapshot, cell: CalculationCellId) -> String {
74 match calculation.cell(cell) {
75 Some(CalculationCellResult::Value(CellValue::Number(number))) => {
76 render_number(number.get())
77 }
78 Some(CalculationCellResult::Value(CellValue::Logical(logical))) => logical.to_string(),
79 Some(CalculationCellResult::Value(CellValue::Error(error))) => error.as_str().to_owned(),
80 Some(CalculationCellResult::Unavailable(issue)) => {
81 format!("unavailable: {}", issue.code().as_str())
82 }
83 // `CellValue` and `CalculationCellResult` are `#[non_exhaustive]`, so a wildcard arm is
84 // required even when every variant this example can produce is handled above.
85 Some(_) => "<other value>".to_owned(),
86 None => "<not calculated>".to_owned(),
87 }
88}Trait Implementations§
Source§impl Clone for ExcelError
impl Clone for ExcelError
Source§fn clone(&self) -> ExcelError
fn clone(&self) -> ExcelError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ExcelError
Source§impl Debug for ExcelError
impl Debug for ExcelError
Source§impl Display for ExcelError
impl Display for ExcelError
impl Eq for ExcelError
Source§impl Hash for ExcelError
impl Hash for ExcelError
Source§impl PartialEq for ExcelError
impl PartialEq for ExcelError
impl StructuralPartialEq for ExcelError
Auto Trait Implementations§
impl Freeze for ExcelError
impl RefUnwindSafe for ExcelError
impl Send for ExcelError
impl Sync for ExcelError
impl Unpin for ExcelError
impl UnsafeUnpin for ExcelError
impl UnwindSafe for ExcelError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.