Struct display_bytes::DisplayBytesConfig [] [src]

pub struct DisplayBytesConfig<'d, F: ?Sized> { /* fields omitted */ }

Configuration builder for DisplayBytes.

Statics with sane defaults are provided in this module.

Methods

impl<'d, F> DisplayBytesConfig<'d, F>
[src]

Set the type used to format byte sequences.

Get a mutable reference to the current ByteFormat.

Set the pair of delimiters used to wrap byte sequences in the formatted stream.

Note that this can change the lifetime bound.

Get a mutable reference to the current pair of delimiters.

If set to true, only displays ASCII byte sequences (bytes in [0x00, 0x7F]).

Otherwise, displays all valid UTF-8 sequences at least min_str_len bytes long.

The minimum number of bytes in length that a valid string sequence must be to be displayed.

Strings shorter than this length will be included in the nearest byte sequence. Use this to avoid extra noise from random decodable characters splitting byte sequences.

Note

This does not affect byte sequences that can be completely decoded. If print_terminators is set, this also will not affect strings at the beginning or at the end of the byte slice (e.g. valid strings at the start and end will be printed regardless of length).

If set to true, valid strings at the start and end of a byte slice will be printed regardless of their length relative to min_str_len.

If set to true, wraps decoded strings in the given delimiters rather than byte sequences.

impl<'d, F: ?Sized + ByteFormat> DisplayBytesConfig<'d, F>
[src]

Attempt to convert bytes to a string (an ASCII-only string if ascii_only is set, UTF-8 otherwise), or otherwise format bytes to a string using the properties in this configuration.

Get a type that implements Display which will format bytes to an output stream using the properties in this configuration.

Trait Implementations

impl<'d, F: Clone + ?Sized> Clone for DisplayBytesConfig<'d, F>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'d, F: Debug + ?Sized> Debug for DisplayBytesConfig<'d, F>
[src]

Formats the value using the given formatter.

impl Default for DisplayBytesConfig<'static, FormatHex<'static>>
[src]

Returns the "default value" for a type. Read more

impl Default for DisplayBytesConfig<'static, FormatBase64>
[src]

Returns the "default value" for a type. Read more