pub enum Argument<'a> {
Pid(Koid),
Tid(Koid),
Tag(Cow<'a, str>),
Dropped(u64),
File(Cow<'a, str>),
Message(Cow<'a, str>),
Line(u64),
Other {
name: Cow<'a, str>,
value: Value<'a>,
},
}
Expand description
An argument of the log record identified by a name and with an associated value.
Variants§
Pid(Koid)
Process ID
Tid(Koid)
Thread ID
Tag(Cow<'a, str>)
A log tag
Dropped(u64)
Number of dropped logs
File(Cow<'a, str>)
A filename
Message(Cow<'a, str>)
A log message
Line(u64)
A line number in a file
Other
A custom argument with a given name and value
Implementations§
Source§impl<'a> Argument<'a>
impl<'a> Argument<'a>
Sourcepub fn new(name: impl Into<Cow<'a, str>>, value: impl Into<Value<'a>>) -> Self
pub fn new(name: impl Into<Cow<'a, str>>, value: impl Into<Value<'a>>) -> Self
Creates a new argument given its name and a value.
Sourcepub fn message(message: impl Into<Cow<'a, str>>) -> Self
pub fn message(message: impl Into<Cow<'a, str>>) -> Self
Creates a new argument for a log message.
Sourcepub fn other(name: impl Into<Cow<'a, str>>, value: impl Into<Value<'a>>) -> Self
pub fn other(name: impl Into<Cow<'a, str>>, value: impl Into<Value<'a>>) -> Self
Creates a new key-value argument.
Sourcepub fn into_owned(self) -> Argument<'static>
pub fn into_owned(self) -> Argument<'static>
Consumes the current value and returns one in the static lifetime.
Trait Implementations§
Source§impl<B: MutableBuffer> WriteArgumentValue<B> for Argument<'_>
impl<B: MutableBuffer> WriteArgumentValue<B> for Argument<'_>
Source§fn write_value(
&self,
header: &mut Header,
encoder: &mut Encoder<B>,
) -> Result<(), EncodingError>
fn write_value( &self, header: &mut Header, encoder: &mut Encoder<B>, ) -> Result<(), EncodingError>
Writes the value of the argument.
impl<'a> StructuralPartialEq for Argument<'a>
Auto Trait Implementations§
impl<'a> Freeze for Argument<'a>
impl<'a> RefUnwindSafe for Argument<'a>
impl<'a> Send for Argument<'a>
impl<'a> Sync for Argument<'a>
impl<'a> Unpin for Argument<'a>
impl<'a> UnwindSafe for Argument<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)