Struct smartstring::LazyCompact
source · [−]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
sourceimpl Debug for LazyCompact
impl Debug for LazyCompact
sourceimpl SmartStringMode for LazyCompact
impl SmartStringMode for LazyCompact
Auto Trait Implementations
impl RefUnwindSafe for LazyCompact
impl Send for LazyCompact
impl Sync for LazyCompact
impl Unpin for LazyCompact
impl UnwindSafe for LazyCompact
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more