pub trait SeverityVisuals {
// Required methods
fn icon(self) -> &'static str;
fn color_code(self) -> &'static str;
}Expand description
Terminal-rendering helpers for Severity used by jsdet’s CLI
output. Lives here because secfinding stays presentation-agnostic
(no ANSI color codes), and adding methods directly to the foreign
enum is forbidden by Rust’s orphan rules. Importing this trait
(use jsdet_core::analysis::SeverityVisuals;) brings .icon()
and .color_code() back into scope wherever the old inherent
methods were called.
Required Methods§
Sourcefn color_code(self) -> &'static str
fn color_code(self) -> &'static str
ANSI escape sequence for the severity’s terminal colour.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".