encodeInt32 method

bool encodeInt32(
  1. String key,
  2. int value, [
  3. int? expireDurationInSecond
])

Use this when the value won't be larger than a normal int32. It's more efficient & cost less space. expireDurationInSecond override the default duration setting from enableAutoKeyExpire().

Implementation

bool encodeInt32(String key, int value, [int? expireDurationInSecond]) {
  final keyPtr = key.toNativeUtf8();
  final ret =
      (expireDurationInSecond == null) ? _encodeInt32(_handle, keyPtr, value) : _encodeInt32V2(_handle, keyPtr, value, expireDurationInSecond);
  calloc.free(keyPtr);
  return _int2Bool(ret);
}