pub struct CodeDiagnostic {
pub line: usize,
pub column: usize,
pub length: usize,
pub message: String,
pub hint: Option<String>,
pub tone: Tone,
}Expand description
Something found at a place in the code: what CodeEditor::diagnostics marks and
what a Playground lists under its editor.
Fields§
§line: usizeThe line, from 1.
column: usizeThe column of the first character, from 1; 0 marks the whole line.
length: usizeHow many characters it covers; 0 marks the whole line.
message: StringWhat happened.
hint: Option<String>How to fix it, when there is a likely way.
tone: ToneTone::Danger for errors, Tone::Warning for warnings; other tones read as notes.
Implementations§
Source§impl CodeDiagnostic
impl CodeDiagnostic
Sourcepub fn error(
line: usize,
column: usize,
length: usize,
message: impl Into<String>,
) -> Self
pub fn error( line: usize, column: usize, length: usize, message: impl Into<String>, ) -> Self
An error at line and column (both from 1), covering length characters.
Trait Implementations§
Source§impl Clone for CodeDiagnostic
impl Clone for CodeDiagnostic
Source§fn clone(&self) -> CodeDiagnostic
fn clone(&self) -> CodeDiagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CodeDiagnostic
impl Debug for CodeDiagnostic
impl Eq for CodeDiagnostic
Source§impl PartialEq for CodeDiagnostic
impl PartialEq for CodeDiagnostic
impl StructuralPartialEq for CodeDiagnostic
Auto Trait Implementations§
impl Freeze for CodeDiagnostic
impl RefUnwindSafe for CodeDiagnostic
impl Send for CodeDiagnostic
impl Sync for CodeDiagnostic
impl Unpin for CodeDiagnostic
impl UnsafeUnpin for CodeDiagnostic
impl UnwindSafe for CodeDiagnostic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more