Macro bwrap::wrap_maybrk
source · macro_rules! wrap_maybrk { ($s:expr) => { ... }; ($s:expr, $mw:expr) => { ... }; ($s:expr, $mw:expr, $prep:expr) => { ... }; ($s:expr, $mw:expr, $prep:expr, $appd:expr) => { ... }; }
Available on crate feature
use_std
only.Expand description
Wrap text in May-Break
style.
This macro has three forms:
-
wrap_maybrk(A)
A
is input string, assuming 80-width limit and no prepending or appending.
-
wrap_maybrk(A,B)
A
is input string,B
is width limit, assuming no prepending or appending.
-
wrap_maybrk(A,B,C)
A
is input string,B
is width limit,C
is prepended string, assuming no appending.
-
wrap_maybrk(A,B,C,D)
A
is input string,B
is width limit,C
is prepended string,D
is appended string.
Panics
Panics if input string consists of invalid UTF8 bytes.