pub enum WriteError {
InvalidHeadingLevel(u8),
NewlineInInlineElement(EcoString),
FmtError(EcoString),
IoError(Error),
UnsupportedNodeType,
InvalidStructure(EcoString),
InvalidHtmlTag(EcoString),
InvalidHtmlAttribute(EcoString),
HtmlRenderingError(HtmlWriteError),
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for WriteError
impl From<Error> for WriteError
Source§impl From<Error> for WriteError
impl From<Error> for WriteError
Source§impl From<HtmlWriteError> for WriteError
impl From<HtmlWriteError> for WriteError
Source§fn from(err: CoreHtmlWriteError) -> Self
fn from(err: CoreHtmlWriteError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for WriteError
impl !RefUnwindSafe for WriteError
impl Send for WriteError
impl Sync for WriteError
impl Unpin for WriteError
impl !UnwindSafe for WriteError
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