StaticLRUCache

Undocumented in source.

Members

Aliases

opIndex
alias opIndex = get

Returns the cached value if key is in the cache; throws otherwise. This marks the item as recently used.

Functions

byKey
auto ref byKey()
Undocumented in source. Be warned that the author may not have intended to support it.
byKeyValue
auto ref byKeyValue()
Undocumented in source. Be warned that the author may not have intended to support it.
byValue
auto ref byValue()
Undocumented in source. Be warned that the author may not have intended to support it.
find
Value* find(Key key)
const(Value)* find(Key key)

Returns a pointer to the cached value if key is in the cache; null otherwise. The pointer may get invalidated by updating the cache. This marks the item as recently used.

get
Value get(Key key)

Returns the cached value if key is in the cache; throws otherwise. This marks the item as recently used.

has
bool has(Key key)

Returns true if key is in the cache.

opApply
int opApply(int delegate(ref inout(Key), ref inout(Value)) yield)
int opApply(int delegate(ref inout(Value)) yield)

Iterate over the entries in the cache. This does not count as an access.

opIndexAssign
Value opIndexAssign(Value value, Key key)
Value opIndexAssign(Func update, Key key)

Cache value at key. Updates the value if key is already in the cache. This marks the item as recently used.

set
Value set(Key key, Value value)
Value set(Key key, Func update)

Cache value at key. Updates the value if key is already in the cache. This marks the item as recently used.

Properties

length
size_t length [@property getter]

Returns the number of items in the cache.

Templates

opBinaryRight
template opBinaryRight(string op)

Returns a pointer to the cached value if key is in the cache; null otherwise. The pointer may get invalidated by updating the cache. This marks the item as recently used.

Meta