std.fmt
padding, justified numbers and joining over io.Writer; number parsing no Display interface: dispatch that passes another interface pointer hits a compiler bug
write_padded_left
Section titled “write_padded_left”pub write_padded_left :: fn(w: *Writer, data: []const u8, width: usize, fill: u8) -> usize ! IoErrorwrite_padded_right
Section titled “write_padded_right”pub write_padded_right :: fn(w: *Writer, data: []const u8, width: usize, fill: u8) -> usize ! IoErrorwrite_padded_center
Section titled “write_padded_center”pub write_padded_center :: fn(w: *Writer, data: []const u8, width: usize, fill: u8) -> usize ! IoErrorodd leftover padding goes right
write_u64_padded
Section titled “write_u64_padded”pub write_u64_padded :: fn(w: *Writer, value: u64, width: usize, fill: u8) -> usize ! IoErrorwrite_i64_padded
Section titled “write_i64_padded”pub write_i64_padded :: fn(w: *Writer, value: i64, width: usize, fill: u8) -> usize ! IoErrorwrite_hex_u64_padded
Section titled “write_hex_u64_padded”pub write_hex_u64_padded :: fn(w: *Writer, value: u64, width: usize, fill: u8) -> usize ! IoErrorjoin_bytes
Section titled “join_bytes”pub join_bytes :: fn(w: *Writer, items: []const []const u8, sep: []const u8) -> usize ! IoErroritems separated by sep
ParseError
Section titled “ParseError”pub ParseError :: errors { empty, invalid, overflow,}empty: no digitsinvalid: non-digit for the base, or a misplaced sign or_overflow: the number does not fit the type
parse_int
Section titled “parse_int”pub parse_int :: fn($T: type, text: []const u8, base: u8) -> T ! ParseErrorany integer T; base 2..36, or 0 to read a 0x/0o/0b prefix; _ allowed between digits
parse_float
Section titled “parse_float”pub parse_float :: fn(text: []const u8) -> f64 ! ParseErrorsign, digits, optional . and exponent; inf/infinity/nan; too large -> inf
exact for <= 15 digits and |exp| <= 22; beyond that may be off by one ulp