pub struct Problem {
pub code: Code,
pub path: FieldPath,
pub span: Option<Span>,
pub reason: String,
pub fix: Option<String>,
}Expand description
One thing wrong with a spec.
Fields§
§code: CodeWhat kind of problem it is.
path: FieldPathThe field it is about.
span: Option<Span>Where that field is in the file, when it is written there (a field a group gives a machine has the machine’s own place, or none).
reason: StringWhy it is wrong.
fix: Option<String>What to write instead, when there is one answer.
Implementations§
Source§impl Problem
impl Problem
Sourcepub fn new(code: Code, path: FieldPath, reason: impl Into<String>) -> Problem
pub fn new(code: Code, path: FieldPath, reason: impl Into<String>) -> Problem
A problem with no fix to offer and no place yet (see crate::syntax::Spans::place).
Sourcepub fn render(&self, file: &str) -> String
pub fn render(&self, file: &str) -> String
The three lines an author reads, naming file (isoloom.yml) on the first.
Trait Implementations§
impl Eq for Problem
impl StructuralPartialEq for Problem
Auto Trait Implementations§
impl Freeze for Problem
impl RefUnwindSafe for Problem
impl Send for Problem
impl Sync for Problem
impl Unpin for Problem
impl UnsafeUnpin for Problem
impl UnwindSafe for Problem
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.