pub struct Diagnostic {
pub severity: Severity,
pub chunk: String,
pub pos: Pos,
pub end: Pos,
pub line: u32,
pub message: String,
/* private fields */
}Expand description
One message about source text.
Fields§
§severity: SeverityHow serious.
chunk: StringThe chunk’s name (a file name, usually).
pos: PosWhere the text it is about starts.
end: PosWhere that text ends: the line and column just past its last character (pos when
it is about a point, such as the end of input).
line: u32The line Lua’s own error message gives: where C Lua notices the problem, which can
lie after end (an undefined goto is noticed where its function ends).
message: StringWhat is wrong, for the person who wrote it.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn lua_message(&self) -> String
pub fn lua_message(&self) -> String
As Lua’s own error message reads: chunk:line: message.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl Display for Diagnostic
impl Display for Diagnostic
impl Eq for Diagnostic
Source§impl Error for Diagnostic
impl Error for Diagnostic
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 Diagnostic
impl PartialEq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Forget for Diagnostic
impl Freeze for Diagnostic
impl Move for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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