#[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.