set method
Future<SetResult>
set(
- String key,
- Object value, {
- ExpireMode? expire,
- SetMode? mode,
- bool get = false,
Sets a value for the given key.
Returns a SetResult.
Implementation
Future<SetResult> set(String key, Object value, {ExpireMode? expire, SetMode? mode, bool get = false}) async {
final result = (await tier1.set(key, value, expire: expire, mode: mode, get: get));
return result.handleAs<SetResult>(
simple: (_) => SetResult._(true, null),
bulk: (type) => SetResult._(type.payload != null, type.payload),
error: (_) => SetResult._(false, null),
);
}