#[non_exhaustive]pub enum ValidationError {
Show 16 variants
EmptyDocument,
EmptySection {
section_index: usize,
},
EmptyParagraph {
section_index: usize,
paragraph_index: usize,
},
EmptyTable {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
EmptyTableRow {
section_index: usize,
paragraph_index: usize,
run_index: usize,
row_index: usize,
},
InvalidSpan {
field: &'static str,
value: u16,
section_index: usize,
paragraph_index: usize,
run_index: usize,
row_index: usize,
cell_index: usize,
},
EmptyTextBox {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
EmptyFootnote {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
EmptyEndnote {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
InvalidPolygon {
section_index: usize,
paragraph_index: usize,
run_index: usize,
vertex_count: usize,
},
InvalidShapeDimension {
section_index: usize,
paragraph_index: usize,
run_index: usize,
shape_type: &'static str,
},
EmptyChartData {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
EmptyEquation {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
EmptyCategoryLabels {
section_index: usize,
paragraph_index: usize,
run_index: usize,
},
MismatchedSeriesLengths {
section_index: usize,
paragraph_index: usize,
run_index: usize,
series_name: String,
x_len: usize,
y_len: usize,
},
EmptyTableCell {
section_index: usize,
paragraph_index: usize,
run_index: usize,
row_index: usize,
cell_index: usize,
},
}Expand description
Specific validation failures with precise location context.
Every variant carries enough information to pinpoint the exact location of the problem (section index, paragraph index, etc.).
Marked #[non_exhaustive] so future phases can add variants
without a breaking change.
§Examples
use hwpforge_core::error::ValidationError;
let err = ValidationError::EmptySection { section_index: 2 };
assert!(err.to_string().contains("Section 2"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyDocument
The document contains zero sections.
EmptySection
A section contains zero paragraphs.
EmptyParagraph
A paragraph contains zero runs.
Fields
EmptyTable
A table contains zero rows.
Fields
EmptyTableRow
A table row contains zero cells.
Fields
InvalidSpan
A span value (col_span or row_span) is zero.
Fields
EmptyTextBox
A TextBox control contains zero paragraphs.
Fields
EmptyFootnote
A Footnote control contains zero paragraphs.
Fields
EmptyEndnote
An Endnote control contains zero paragraphs.
Fields
InvalidPolygon
A Polygon control has fewer than 3 vertices.
Fields
InvalidShapeDimension
A shape (Ellipse or Polygon) has zero width or height.
Fields
EmptyChartData
A Chart control has no data series.
Fields
EmptyEquation
An Equation control has an empty script.
Fields
EmptyCategoryLabels
A Category chart has an empty categories list.
Fields
MismatchedSeriesLengths
An XY series has mismatched x/y value lengths.
Fields
EmptyTableCell
A table cell contains zero paragraphs.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn code(&self) -> CoreErrorCode
pub fn code(&self) -> CoreErrorCode
Returns the numeric error code for this validation error.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ValidationError> for CoreError
impl From<ValidationError> for CoreError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
impl Eq for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.