pub enum Level {
Note,
Help,
Warning,
Error,
}Expand description
Represents the severity level of an issue.
Variants§
Note
A note, providing additional information or context.
Help
A help message, suggesting possible solutions or further actions.
Warning
A warning, indicating a potential problem that may need attention.
Error
An error, indicating a problem that prevents the code from functioning correctly.
Implementations§
Source§impl Level
impl Level
Sourcepub fn downgrade(&self) -> Self
pub fn downgrade(&self) -> Self
Downgrades the level to the next lower severity.
This function maps levels to their less severe counterparts:
ErrorbecomesWarningWarningbecomesHelpHelpbecomesNoteNoteremains asNote
§Examples
use mago_reporting::Level;
let level = Level::Error;
assert_eq!(level.downgrade(), Level::Warning);
let level = Level::Warning;
assert_eq!(level.downgrade(), Level::Help);
let level = Level::Help;
assert_eq!(level.downgrade(), Level::Note);
let level = Level::Note;
assert_eq!(level.downgrade(), Level::Note);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Level
impl<'de> Deserialize<'de> for Level
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Level
impl Ord for Level
Source§impl PartialOrd for Level
impl PartialOrd for Level
Source§impl VariantNames for Level
impl VariantNames for Level
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
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