pub type StringBuf = StringBufInner;
Expand description
A string buffer type.
Used at Formatter
.
By default, it is an alias for String
, if feature flexible-string
is
enabled, an internal type FlexibleString
will be used.
FlexibleString
has a fixed stack buffer of 250 bytes, and upgrades to
String
when more space is needed. It provides APIs that are as
consistent as possible with String
, but some APIs are not yet
implemented or cannot be implemented.
Warnings
FlexibleString
can improve performance as it avoids memory allocation when
formatting records (most log messages do not exceed 250 bytes), however it
contains unsafe code.