[][src]Trait pad::PadStr

pub trait PadStr {
    fn pad(
        &self,
        width: usize,
        pad_char: char,
        alignment: Alignment,
        truncate: bool
    ) -> String; fn pad_to_width(&self, width: usize) -> String { ... }
fn pad_to_width_with_char(&self, width: usize, pad_char: char) -> String { ... }
fn pad_to_width_with_alignment(
        &self,
        width: usize,
        alignment: Alignment
    ) -> String { ... }
fn with_exact_width(&self, width: usize) -> String { ... } }

Functions to do with string padding.

Required methods

fn pad(
    &self,
    width: usize,
    pad_char: char,
    alignment: Alignment,
    truncate: bool
) -> String

Pad a string to the given width somehow.

Loading content...

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

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.

Loading content...

Implementations on Foreign Types

impl PadStr for str[src]

Loading content...

Implementors

Loading content...