pub enum EventLevel {
Trace,
Debug,
Info,
Warning,
Error,
Fatal,
}Expand description
Severity level for a stream event.
Levels are ordered from least to most severe, allowing minimum-level filtering (e.g., show only Warning and above).
§Example
use envision::component::EventLevel;
assert!(EventLevel::Error > EventLevel::Info);
assert!(EventLevel::Trace < EventLevel::Debug);
assert_eq!(EventLevel::default(), EventLevel::Info);Variants§
Trace
Finest-grained informational events.
Debug
Fine-grained informational events useful for debugging.
Info
Informational messages highlighting normal operation.
Warning
Potentially harmful situations.
Error
Error events that might still allow the application to continue.
Fatal
Very severe error events that will likely cause the application to abort.
Implementations§
Source§impl EventLevel
impl EventLevel
Sourcepub fn abbreviation(&self) -> &'static str
pub fn abbreviation(&self) -> &'static str
Returns a short abbreviation for display (3 chars).
§Example
use envision::component::EventLevel;
assert_eq!(EventLevel::Info.abbreviation(), "INF");
assert_eq!(EventLevel::Error.abbreviation(), "ERR");Sourcepub fn color(&self) -> Color
pub fn color(&self) -> Color
Returns the display color for this severity level.
- Trace: DarkGray (dim)
- Debug: Gray
- Info: Blue
- Warning: Yellow
- Error: Red
- Fatal: LightRed (bright red)
§Example
use envision::component::EventLevel;
use ratatui::style::Color;
assert_eq!(EventLevel::Info.color(), Color::Blue);
assert_eq!(EventLevel::Error.color(), Color::Red);Trait Implementations§
Source§impl Clone for EventLevel
impl Clone for EventLevel
Source§fn clone(&self) -> EventLevel
fn clone(&self) -> EventLevel
Returns a duplicate of the value. Read more
1.0.0 · 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 EventLevel
impl Debug for EventLevel
Source§impl Default for EventLevel
impl Default for EventLevel
Source§fn default() -> EventLevel
fn default() -> EventLevel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventLevel
impl<'de> Deserialize<'de> for EventLevel
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 Display for EventLevel
impl Display for EventLevel
Source§impl Hash for EventLevel
impl Hash for EventLevel
Source§impl Ord for EventLevel
impl Ord for EventLevel
Source§fn cmp(&self, other: &EventLevel) -> Ordering
fn cmp(&self, other: &EventLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EventLevel
impl PartialEq for EventLevel
Source§impl PartialOrd for EventLevel
impl PartialOrd for EventLevel
Source§impl Serialize for EventLevel
impl Serialize for EventLevel
impl Eq for EventLevel
impl StructuralPartialEq for EventLevel
Auto Trait Implementations§
impl Freeze for EventLevel
impl RefUnwindSafe for EventLevel
impl Send for EventLevel
impl Sync for EventLevel
impl Unpin for EventLevel
impl UnsafeUnpin for EventLevel
impl UnwindSafe for EventLevel
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> Comparable<K> for Q
impl<Q, K> Comparable<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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more