pub struct AlignRight;
Expand description
Pad to the left, content to the right.
Example:
use zero_copy_pads::{AlignRight, PaddedValue, PanicOnExcess};
let padded_value = PaddedValue {
pad: AlignRight,
value: "abcdef",
pad_block: '-',
total_width: 9,
handle_excess: PanicOnExcess,
};
assert_eq!(padded_value.to_string(), "---abcdef");
Trait Implementations§
Source§impl Clone for AlignRight
impl Clone for AlignRight
Source§fn clone(&self) -> AlignRight
fn clone(&self) -> AlignRight
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AlignRight
impl Debug for AlignRight
Source§impl Default for AlignRight
impl Default for AlignRight
Source§fn default() -> AlignRight
fn default() -> AlignRight
Returns the “default value” for a type. Read more
Source§impl PartialEq for AlignRight
impl PartialEq for AlignRight
impl Copy for AlignRight
impl Eq for AlignRight
impl StructuralPartialEq for AlignRight
impl<Value: Width, PadBlock: Display> UnitPad<Value, PadBlock> for AlignRight
Auto Trait Implementations§
impl Freeze for AlignRight
impl RefUnwindSafe for AlignRight
impl Send for AlignRight
impl Sync for AlignRight
impl Unpin for AlignRight
impl UnwindSafe for AlignRight
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