pub struct LexicalError { /* private fields */ }Expand description
A JS invariant failure (or another error JS throws), carrying the same
message. Invariants that only a bug in a node implementation can break
panic instead, as RefCell does; the ones a document can break return
this.
Implementations§
Source§impl LexicalError
impl LexicalError
pub fn new(message: impl Into<String>) -> Self
pub fn message(&self) -> &str
Sourcepub fn from_warning(warning: LexicalWarning) -> Self
pub fn from_warning(warning: LexicalWarning) -> Self
warning as the error onWarn receives, with its message.
Sourcepub fn warning(&self) -> Option<&LexicalWarning>
pub fn warning(&self) -> Option<&LexicalWarning>
The LexicalWarning this error is, as JS’s
error instanceof LexicalWarning.
Trait Implementations§
Source§impl Clone for LexicalError
impl Clone for LexicalError
Source§impl Debug for LexicalError
impl Debug for LexicalError
Source§impl Display for LexicalError
impl Display for LexicalError
impl Eq for LexicalError
Source§impl Error for LexicalError
impl Error for LexicalError
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 PartialEq for LexicalError
impl PartialEq for LexicalError
impl StructuralPartialEq for LexicalError
Auto Trait Implementations§
impl !Send for LexicalError
impl !Sync for LexicalError
impl Forget for LexicalError
impl Freeze for LexicalError
impl Move for LexicalError
impl RefUnwindSafe for LexicalError
impl Unpin for LexicalError
impl UnsafeUnpin for LexicalError
impl UnwindSafe for LexicalError
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