InMemoryPrefixStateStore class final
A PrefixStateStore that keeps its index in memory and records every call, for tests.
The engine still writes and reads files, so each state is a file in directory (a temporary folder created on first use unless given; clear deletes it). No eviction. A state whose file was deleted behind the store's back counts as missing, as a purged cache would.
- Implemented types
Constructors
- InMemoryPrefixStateStore([String? _given])
Properties
- directory → String
-
The folder of the state files.
no setter
-
finds
→ List<
String> -
The keys (PrefixKey.id) of find calls, in order.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ List<
String> -
The keys of the states it holds, in the order they were put.
no setter
-
puts
→ List<
String> -
The keys of put calls, in order.
final
-
removes
→ List<
String> -
The keys of remove calls, in order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → Future< void> -
Forgets every state and deletes the folder when it created it.
override
-
find(
PrefixKey key) → Future< String?> -
The path of the state of
key, marked as just used; null when there is none.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
PrefixKey key, Future< void> write(String tempPath)) → Future<String> -
Calls
writewith a temporary path to fill, then moves the file into place atomically and evicts old states; returns the state's path. Whenwritethrows, the temporary file is removed and the error rethrown.override -
remove(
PrefixKey key) → Future< void> -
Removes the state of
key, if any.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited