pub struct FormatViolation {
pub line: usize,
pub col: usize,
pub rule: &'static str,
pub message: String,
pub before: Option<String>,
pub after: Option<String>,
}Expand description
One formatter rule firing on one location. Emitted by
try_format_source alongside the rewritten text, then folded into a
canonical needs-format Diagnostic by the factory.
rule is a stable slug (“bad-operator-spacing”, “effect-order”,
“verify-block-order”, …) consumed by LSP code, docs, and CI rules.
before/after are optional short snippets for teaching; long
rewrites can omit them.
Fields§
§line: usize§col: usize§rule: &'static str§message: String§before: Option<String>§after: Option<String>Trait Implementations§
Source§impl Clone for FormatViolation
impl Clone for FormatViolation
Source§fn clone(&self) -> FormatViolation
fn clone(&self) -> FormatViolation
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 FormatViolation
impl Debug for FormatViolation
Auto Trait Implementations§
impl Freeze for FormatViolation
impl RefUnwindSafe for FormatViolation
impl Send for FormatViolation
impl Sync for FormatViolation
impl Unpin for FormatViolation
impl UnsafeUnpin for FormatViolation
impl UnwindSafe for FormatViolation
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