Changelog
v2.2.0
A synchronous increment for the hybrid limiters, and a borrowed Redis key type.
Status: Released · October 4, 2026
Version 2.2.0 adds a synchronous increment to the two hybrid limiters and a borrowed form of the Redis key.
Added
- Added
try_inc(key, count)to the absolute and suppressed hybrid limiters. It is synchronous. It makes the decision from the local state of the instance and does not wait for Redis. try_increturnsOk(None)and records nothing when the decision needs Redis. This occurs for a new key, for expired local state, and when the local capacity is used. Then callinc.- Added
RedisKeyRef, a borrowed key with the same validation rules asRedisKey.RedisKeyRef::try_fromaccepts a&strand does not allocate. - Added
RedisKey::as_key_ref(). It borrows an owned key and does not validate the key again. RedisKeynow implementsBorrow<str>. Thus, a map withRedisKeykeys accepts a&strfor a lookup.
let decision = match provider.absolute().try_inc(key.as_key_ref(), 1)? {
Some(decision) => decision,
None => provider.absolute().inc(&key, &rate, 1).await?,
};

