[−][src]Trait pad::PadStr
Functions to do with string padding.
Required methods
fn pad(
&self,
width: usize,
pad_char: char,
alignment: Alignment,
truncate: bool
) -> String
&self,
width: usize,
pad_char: char,
alignment: Alignment,
truncate: bool
) -> String
Pad a string to the given width somehow.
Provided methods
fn pad_to_width(&self, width: usize) -> String
Pad a string to be at least the given width by adding spaces on the right.
fn pad_to_width_with_char(&self, width: usize, pad_char: char) -> String
Pad a string to be at least the given width by adding the given character on the right.
fn pad_to_width_with_alignment(
&self,
width: usize,
alignment: Alignment
) -> String
&self,
width: usize,
alignment: Alignment
) -> String
Pad a string to be at least the given with by adding spaces around it.
fn with_exact_width(&self, width: usize) -> String
Pad a string to be exactly the given width by either adding spaces on the right, or by truncating it to that width.