pub enum Level {
Debug,
Info,
Warn,
Error,
Fatal,
}Expand description
The severity of a span, from least to most severe.
PHP: Utopia\Span\Level. Names follow Grafana Loki’s detected_level
vocabulary (warn, not warning).
Variants§
Debug
debug.
Info
info: the level of a span finished without an error.
Warn
warn.
Error
error: the level of a span finished with an error.
Fatal
fatal.
Implementations§
Source§impl Level
impl Level
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The level’s name, as the level attribute holds it.
PHP: $level->value.
use utopia_span::Level;
assert_eq!(Level::Warn.as_str(), "warn");use Utopia\Span\Level;
echo Level::Warn->value, "\n"; // warnSourcepub fn parse(name: &[u8]) -> Option<Level>
pub fn parse(name: &[u8]) -> Option<Level>
The level named name, if any.
PHP: Level::tryFrom($name) (Level::from() throws a \ValueError
where this returns None).
use utopia_span::Level;
assert_eq!(Level::parse(b"error"), Some(Level::Error));
assert_eq!(Level::parse(b"warning"), None);use Utopia\Span\Level;
var_dump(Level::tryFrom('error') === Level::Error); // bool(true)
var_dump(Level::tryFrom('warning')); // NULLTrait Implementations§
impl Copy for Level
impl Eq for Level
Source§impl Ord for Level
impl Ord for Level
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Level
impl PartialOrd for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Forget for Level
impl Freeze for Level
impl Move for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnsafeUnpin 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
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§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.