Struct smartstring::LazyCompact [−][src]
pub struct LazyCompact;
Expand description
A representation similar to Compact
but which doesn’t re-inline strings.
This is a variant of Compact
which doesn’t aggressively inline strings.
Where Compact
automatically turns a heap allocated string back into an
inlined string if it should become short enough, LazyCompact
keeps
it heap allocated once heap allocation has occurred. If your aim is to defer heap
allocation as much as possible, rather than to ensure cache locality, this is the
variant you want - it won’t allocate until the inline capacity is exceeded, and it
also won’t deallocate once allocation has occurred, which risks reallocation if the
string exceeds its inline capacity in the future.
Trait Implementations
type BoxedString = String
type BoxedString = String
The boxed string type for this layout.
type InlineArray = [u8; 23]
type InlineArray = [u8; 23]
The inline string type for this layout.