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§
Source§impl Debug for LazyCompact
impl Debug for LazyCompact
Source§impl SmartStringMode for LazyCompact
impl SmartStringMode for LazyCompact
Auto Trait Implementations§
impl Freeze for LazyCompact
impl RefUnwindSafe for LazyCompact
impl Send for LazyCompact
impl Sync for LazyCompact
impl Unpin for LazyCompact
impl UnwindSafe for LazyCompact
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more