Struct zero_copy_pads::AlignCenterLeft [−][src]
pub struct AlignCenterLeft;
Pad to both sides, place content in the middle, but shift to the left one block if it can’t be exactly central.
Example:
use zero_copy_pads::{AlignCenterLeft, PaddedColumn, PanicOnExcess}; let values = [ "Rust", "C", "C++", "C#", "JavaScript", "TypeScript", "Java", "Kotlin", "Go", ]; let padded_column = PaddedColumn { pad: AlignCenterLeft, values: values.iter(), pad_block: '-', }; let padded_values: Vec<_> = padded_column .into_iter() .map(|x| x.to_string()) .collect(); let expected = [ "---Rust---", "----C-----", "---C++----", "----C#----", "JavaScript", "TypeScript", "---Java---", "--Kotlin--", "----Go----", ]; assert_eq!(padded_values, expected);
Trait Implementations
impl Clone for AlignCenterLeft
[src]
impl Clone for AlignCenterLeft
[src]fn clone(&self) -> AlignCenterLeft
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for AlignCenterLeft
[src]
impl Copy for AlignCenterLeft
[src]impl Default for AlignCenterLeft
[src]
impl Default for AlignCenterLeft
[src]fn default() -> AlignCenterLeft
[src]
impl Eq for AlignCenterLeft
[src]
impl Eq for AlignCenterLeft
[src]impl<Value: Width, PadBlock: Display> Pad<Value, PadBlock> for AlignCenterLeft
[src]
impl<Value: Width, PadBlock: Display> Pad<Value, PadBlock> for AlignCenterLeft
[src]impl PartialEq<AlignCenterLeft> for AlignCenterLeft
[src]
impl PartialEq<AlignCenterLeft> for AlignCenterLeft
[src]impl StructuralEq for AlignCenterLeft
[src]
impl StructuralEq for AlignCenterLeft
[src]impl StructuralPartialEq for AlignCenterLeft
[src]
impl StructuralPartialEq for AlignCenterLeft
[src]impl Unit for AlignCenterLeft
[src]
impl Unit for AlignCenterLeft
[src]impl<Value: Width, PadBlock: Display> UnitPad<Value, PadBlock> for AlignCenterLeft
[src]
impl<Value: Width, PadBlock: Display> UnitPad<Value, PadBlock> for AlignCenterLeft
[src]Auto Trait Implementations
impl RefUnwindSafe for AlignCenterLeft
impl RefUnwindSafe for AlignCenterLeft
impl Send for AlignCenterLeft
impl Send for AlignCenterLeft
impl Sync for AlignCenterLeft
impl Sync for AlignCenterLeft
impl Unpin for AlignCenterLeft
impl Unpin for AlignCenterLeft
impl UnwindSafe for AlignCenterLeft
impl UnwindSafe for AlignCenterLeft
Blanket Implementations
impl<X> Pipe for X
impl<X> Pipe for X
pub fn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
Function: FnOnce(Self) -> Return,
pub fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
Function: FnOnce(&'a Self) -> Return,
pub fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
Function: FnOnce(&'a mut Self) -> Return,
pub fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_as_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
&'a mut self,
f: Function
) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
pub fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
&'a mut self,
f: Function
) -> Return where
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
pub fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,