textwrap
Text Wrapping and Formatting
Functions
| Function | Description |
|---|---|
_tw_byte_at | Internal byte reader. |
_tw_copy | Internal: copy bytes. |
textwrap_fill | Wrap text at word boundaries. Inserts newlines. Returns total length. |
textwrap_wrap | Wrap text (alias for fill). |
textwrap_dedent | Remove common leading whitespace from all lines. |
textwrap_indent | Add prefix to each line. |
textwrap_shorten | Truncate text to width, adding […] if too long. |
Details
_tw_byte_at
fn _tw_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_tw_copy
fn _tw_copy(dst: &i8, doff: i64, src: &i8, soff: i64, n: i64)Internal: copy bytes.
textwrap_fill
fn textwrap_fill(src: &i8, slen: i64, width: i64, out: &i8, max: i64) -> i64Wrap text at word boundaries. Inserts newlines. Returns total length.
textwrap_wrap
fn textwrap_wrap(src: &i8, slen: i64, width: i64, out: &i8, max: i64) -> i64Wrap text (alias for fill).
textwrap_dedent
fn textwrap_dedent(src: &i8, slen: i64, out: &i8, max: i64) -> i64Remove common leading whitespace from all lines.
textwrap_indent
fn textwrap_indent(src: &i8, slen: i64, pfx: &i8, plen: i64, out: &i8, max: i64) -> i64Add prefix to each line.
textwrap_shorten
fn textwrap_shorten(src: &i8, slen: i64, width: i64, out: &i8, max: i64) -> i64Truncate text to width, adding […] if too long.