Crate zero_copy_pads[−][src]
Padding/aligning values without heap allocation.
Features:
std
(default feature):- Disable
#![no_std]
. - Enable features that require heap allocation.
- Disable
Usage:
Almost all items are documented with example codes, such as
align_left
, align_right
, align_center_left
, align_center_right
,
align_column_left
, align_column_right
,
align_column_center_left
, align_column_center_right
,
PaddedValue
, PaddedColumn
, Alignment
,
AlignLeft
, AlignRight
, AlignCenterLeft
, AlignCenterRight
,
etc.
Structs
AlignCenterLeft | Pad to both sides, place content in the middle, but shift to the left one block if it can’t be exactly central. |
AlignCenterRight | Pad to both sides, place content in the middle, but shift to the right one block if it can’t be exactly central. |
AlignLeft | Pad to the right, content to the left. |
AlignRight | Pad to the left, content to the right. |
CharCount | Treat character count as width. |
ErrorOnExcess | Forbid all excesses, panic once encounter one. |
Excess | Information about a situation where |
ExcessHandlingFunction | Turn a function (without closure) into a |
IgnoreExcess | Ignore excess, write |
Len | Treat |
PaddedColumn | Pad all values in a collection to be of same (maximum) width. |
PaddedColumnBuilder | Builder for |
PaddedColumnIter | Iterator created by calling |
PaddedValue | Pad a single value. |
PaddedValueBuilder | Builder for |
PanicOnExcess | Forbid all excesses, panic once encounter one. |
UnicodeWidth | Treat |
UnicodeWidthCjk | Treat |
Enums
Alignment | Where the place the pad blocks. |
PaddedColumnBuilderError | Error type for PaddedColumnBuilder |
PaddedValueBuilderError | Error type for PaddedValueBuilder |
Constants
UNICODE_VERSION | The version of Unicode that this version of unicode-width is based on. |
Traits
ExcessHandler | What to do when the width of the value exceeds total. |
Pad | Pad a value knowing the number of blocks. |
UnicodeWidthChar | Methods for determining displayed width of Unicode characters. |
UnicodeWidthStr | Methods for determining displayed width of Unicode strings. |
Width | Value that has width. |
Functions
align_center_left | Pad space characters both side of a value with the remainder block (if any) in the right. |
align_center_right | Pad space characters both side of a value with the remainder block (if any) in the left. |
align_column_center_left | Pad space characters to both sides of every value so that they all share the same width. The remainder blocks will be placed at the right. |
align_column_center_right | Pad space characters to both sides of every value so that they all share the same width. The remainder blocks will be placed at the left. |
align_column_left | Pad space characters to the right of every value so that they all share the same width. |
align_column_right | Pad space characters to the left of every value so that they all share the same width. |
align_left | Pad space characters to the right of a value. |
align_right | Pad space characters to the left of a value. |
error_on_excess | Create a |
ignore_excess | Create a |
panic_on_excess | Create a |