pub struct Limits {
pub max_packed_bytes: usize,
pub max_packed_entries: Option<usize>,
}Expand description
Where a list changes representation.
One number, because Redis has one: list-max-listpack-size. A negative value
there is a size in kilobytes and a positive one is a count of elements, and
both arrive here already turned into the two fields the bands actually ask
about.
Fields§
§max_packed_bytes: usizeThe most bytes a packed list holds before it becomes chunks.
max_packed_entries: Option<usize>The most elements a packed list holds, or none for no limit.
The default configuration has no count limit at all, because -2 is a
size. A server configured with a positive list-max-listpack-size has
one and no size limit, which is why these are two fields and not an enum
of one or the other: the halving rule for shrinking applies to whichever
is set and the code below should not have to know which that was.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn of(fill: i32) -> Limits
pub fn of(fill: i32) -> Limits
The limits a list-max-listpack-size of fill describes.
This is quicklistNodeLimit. A positive fill is a count and the size is
left at the safety limit, a negative one is an index into Redis’s five
sizes, and zero means one element per node, which is a setting nobody
uses and which still has to mean something.