Enum BytesKind
#[non_exhaustive]pub enum BytesKind {
Stream,
Value,
PlainValue,
}Expand description
The kind of bytes to log
The main distinction is between bytes as “values” (like checksums) or bytes as “streams” (like user input)
This changes the default formatting,
although different Drain implementations can handle
this information differently.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Stream
Format the bytes as a “stream”
By default, this prints as hex bytes prefixed with 0x (but without underscores).
Drain implementations are encouraged to switch to more efficient formats like base64 (or direct binary).
Value
Format the bytes as a “value”
By default, this prints as uppercase hex prefixed with 0x,
implicitly separated by underscores
For example, sha1("foo") would format as 0xF1D2_D2F9_24E9_86AC_86FD_F7B3_6C94_BCDF_32BE_EC15
Notice the leading 0x and the underscores.
If this leading 0x and underscores are not desired, consider BytesKind::PlainValue
PlainValue
Format the bytes as a “plain” value.
This is very similar to BytesKind::Value,
however by default it avoids underscores and a leading 0x.
For example, sha1("foo") would format as F1D2D2F924E986AC86FDF7B36C94BCDF32BEEC15
Notice the lack of leading 0x and the lack of underscores.
Trait Implementations§
impl Copy for BytesKind
Auto Trait Implementations§
impl Freeze for BytesKind
impl RefUnwindSafe for BytesKind
impl Send for BytesKind
impl Sync for BytesKind
impl Unpin for BytesKind
impl UnsafeUnpin for BytesKind
impl UnwindSafe for BytesKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 more