Enum streamcatcher::GrowthStrategy [−][src]
pub enum GrowthStrategy {
Constant(usize),
Linear {
start: usize,
max: usize,
},
Geometric {
start: usize,
max: usize,
},
}
Expand description
Growth pattern for allocating new chunks as the rope expands.
Linear
and Geometric
greatly reduce allocation count and contention when
readers are highly synchronised, offering significant performance gains and are
recommended when available memory is no limit. However, they run the risk of consuming
significantly more memory than a stream requires—for this reason, Constant
is the default choice.
If a length hint is provided, the second chunk will have the given start size, and will grow from that point onwards.
Variants
Constant(usize)
Tuple Fields
0: usize
Every new chunk will have the same size.
Linear
Every new chunk will be larger than the last by start
,
given some start and maximum.
Geometric
Every new chunk will be twice as large as the last, given some start and maximum.
Implementations
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for GrowthStrategy
impl Send for GrowthStrategy
impl Sync for GrowthStrategy
impl Unpin for GrowthStrategy
impl UnwindSafe for GrowthStrategy
Blanket Implementations
Mutably borrows from an owned value. Read more