Skip to main content

setting

Function setting 

Source
pub fn setting(f: Field, val: i64, on: Overflow) -> Option<i64>
Expand description

The value a SET of val should write, or None for FAIL.

A negative value into an unsigned field is the one that surprises people. It is not clamped to zero: Redis reads the value as the unsigned number its two’s complement bits spell, which is enormous, so it overflows off the top and SAT gives the field’s maximum rather than nothing. Measured on 8.10.1: OVERFLOW SAT SET u8 0 -5 leaves 255 and OVERFLOW WRAP leaves 251.