pub enum Alignment {
Left,
Right,
Center,
}Expand description
Specifies the alignment strategy to use when padding or truncating a buffer.
Left: aligns content to the left, padding goes to the right.Right: aligns content to the right, padding goes to the left.Center: distributes padding equally on both sides (extra symbol goes to the right of number of symbols to padd is odd).
§Examples
use padder::{Alignment, Pads};
let l = Alignment::Left;
assert_eq!(Pads(0, 4), l.pads(4));
let r = Alignment::Right;
assert_eq!(Pads(52, 0), r.pads(52));
let c = Alignment::Center;
assert_eq!(Pads(5, 6), c.pads(11));Variants§
Implementations§
Trait Implementations§
impl Copy for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnsafeUnpin for Alignment
impl UnwindSafe for Alignment
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