pub struct AlignLeft;
Expand description
Pad to the right, content to the left.
Example:
use zero_copy_pads::{AlignLeft, PaddedValue, PanicOnExcess};
let padded_value = PaddedValue {
pad: AlignLeft,
value: "abcdef",
pad_block: '-',
total_width: 9,
handle_excess: PanicOnExcess,
};
assert_eq!(padded_value.to_string(), "abcdef---");
Trait Implementations§
impl Copy for AlignLeft
impl Eq for AlignLeft
impl StructuralPartialEq for AlignLeft
impl<Value: Width, PadBlock: Display> UnitPad<Value, PadBlock> for AlignLeft
Auto Trait Implementations§
impl Freeze for AlignLeft
impl RefUnwindSafe for AlignLeft
impl Send for AlignLeft
impl Sync for AlignLeft
impl Unpin for AlignLeft
impl UnwindSafe for AlignLeft
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§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>
Converts
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>
Converts
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