std/fmt

Interfaces

Display

@derivable
pub interface Display {
    pure fn display(self) -> String
}

Human-readable rendering. A record or ADT gets a generated display (the same text debug already renders it as) unless it defines one.

Functions

uint

pub pure fn uint(v: u64, base: usize, width: usize) -> String

v in base, left-padded with '0' to at least width digits. A base below 2 or above 36 renders as base 10; a value of 0 is one digit.

hex

pub pure fn hex(v: u64, width: usize) -> String

v in lower-case hexadecimal, left-padded with '0' to width digits.

int

pub pure fn int(v: i64, width: usize) -> String

v in base 10, left-padded with '0' to width digits; a negative value keeps its sign outside the padding.

padLeft

pub pure fn padLeft(s: String, to: usize, fill: Char) -> String

s padded on the left with fill until it holds to characters. Counts Unicode scalar values, not display cells.

padRight

pub pure fn padRight(s: String, to: usize, fill: Char) -> String

s padded on the right with fill until it holds to characters.