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

Formats the value using the given formatter. Read more

The boxed string type for this layout.

The inline string type for this layout.

A constant to decide whether to turn a wrapped string back into an inlined string whenever possible (true) or leave it as a wrapped string once wrapping has occurred (false). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.