pub struct LatexError(pub Range<usize>, _);Expand description
Represents an error that occurred during LaTeX parsing.
Tuple Fields§
§0: Range<usize>Implementations§
Source§impl LatexError
impl LatexError
Sourcepub fn to_html(
&self,
latex: &str,
display: MathDisplay,
css_class: Option<&str>,
) -> String
pub fn to_html( &self, latex: &str, display: MathDisplay, css_class: Option<&str>, ) -> String
Format a LaTeX error as an HTML snippet.
§Arguments
latex: The original LaTeX input that caused the error.display: The display mode of the equation (inline or block).css_class: An optional CSS class to apply to the error element. IfNone, defaults to"math-core-error".
pub fn error_message(&self) -> String
Sourcepub fn to_message(&self, s: &mut String, input: &str)
pub fn to_message(&self, s: &mut String, input: &str)
Format a LaTeX error as a plain text message, including the source name and position.
§Arguments
s: The string to write the message into.input: The original LaTeX input that caused the error; used to calculate the character offset for the error position.
Trait Implementations§
Source§impl Clone for LatexError
impl Clone for LatexError
Source§fn clone(&self) -> LatexError
fn clone(&self) -> LatexError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LatexError
impl Debug for LatexError
Source§impl Display for LatexError
impl Display for LatexError
Source§impl Error for LatexError
impl Error for LatexError
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()
Auto Trait Implementations§
impl Freeze for LatexError
impl RefUnwindSafe for LatexError
impl Send for LatexError
impl Sync for LatexError
impl Unpin for LatexError
impl UnsafeUnpin for LatexError
impl UnwindSafe for LatexError
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