Interface IMemoizationCache<T, TResult>
Interface representing a cache to store memoization entries for a memoized function.
Namespace: System.Memory
Assembly: Nuqleon.Memory.dll
Syntax
public interface IMemoizationCache<T, TResult> : IMemoizationCache, IClearable, IDisposable
Type Parameters
| Name | Description |
|---|---|
| T | Type of the memoized function argument. |
| TResult | Type of the memoized function result. |
Methods
GetOrAdd(T)
Gets the result of invoking the memoized function with the specified argument.
If the memoization cache does not have the result of the function invocation stored yet, it will call the function.
Declaration
TResult GetOrAdd(T argument)
Parameters
| Type | Name | Description |
|---|---|---|
| T | argument | The argument to get the function invocation result for. |
Returns
| Type | Description |
|---|---|
| TResult | The function invocation result. |
Extension Methods
MemoizationCacheExtensions.AsTrimmableByArgumentAndResult<T, TResult>(IMemoizationCache<T, TResult>)