exists abstract method
Determines whether an entry associated with the given key exists.
This operation is commonly used by caching subsystems, rate-limit controllers, or configuration resolvers to avoid unnecessary retrievals. Implementations should ensure this check is efficient and free of side effects.
Parameters
- key: The identifier representing the stored entry.
Returns
trueif the key exists in the underlying store.falseif the key is not present.
Example
if (tokens.exists('session:abc')) {
print('Session token found.');
}
Implementation
bool exists(Key key);