pub enum WriteError {
InvalidHeadingLevel(u8),
NewlineInInlineElement(EcoString),
FmtError(EcoString),
IoError(Error),
UnsupportedNodeType,
InvalidStructure(EcoString),
InvalidHtmlTag(EcoString),
InvalidHtmlAttribute(EcoString),
HtmlRenderingError(HtmlWriteError),
HtmlFallbackError(EcoString),
Custom {
message: EcoString,
code: Option<EcoString>,
},
}Expand description
Errors that can occur during CommonMark writing.
Variants§
InvalidHeadingLevel(u8)
An invalid heading level was encountered (must be 1-6).
NewlineInInlineElement(EcoString)
A newline character was found in an inline element where it’s not allowed (e.g., in strict mode or specific contexts like table cells, link text, image alt text).
FmtError(EcoString)
An underlying formatting error occurred.
IoError(Error)
An underlying I/O error occurred.
UnsupportedNodeType
An unsupported node type was encountered.
InvalidStructure(EcoString)
Invalid structure in a node (e.g., mismatched table columns)
InvalidHtmlTag(EcoString)
An invalid HTML tag was found (contains unsafe characters)
InvalidHtmlAttribute(EcoString)
An invalid HTML attribute was found (contains unsafe characters)
HtmlRenderingError(HtmlWriteError)
An error occurred during dedicated HTML rendering.
HtmlFallbackError(EcoString)
An error occurred during HTML fallback rendering for tables with block elements.
Custom
A custom error with a message and optional error code.
Implementations§
Source§impl WriteError
Convenience methods for creating custom errors
impl WriteError
Convenience methods for creating custom errors
Trait Implementations§
Source§impl Debug for WriteError
impl Debug for WriteError
Source§impl Display for WriteError
impl Display for WriteError
Source§impl Error for WriteError
impl Error for WriteError
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
use the Display impl or to_string()