Class MemoizationCacheExtensions
Provides a set of extension methods for memoization caches.
Inheritance
Namespace: System.Memory
Assembly: Nuqleon.Memory.dll
Syntax
public static class MemoizationCacheExtensions : Object
Methods
AsTrimmableByArgumentAndResult<T, TResult>(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results.
Declaration
public static ITrimmable<KeyValuePair<T, TResult>> AsTrimmableByArgumentAndResult<T, TResult>(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, TResult>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
AsTrimmableByArgumentAndResult<T, TResult>(IMemoizationCache<T, TResult>)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results.
Declaration
public static ITrimmable<KeyValuePair<T, TResult>> AsTrimmableByArgumentAndResult<T, TResult>(this IMemoizationCache<T, TResult> cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache<T, TResult> | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, TResult>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
AsTrimmableByArgumentAndResultOrError<T, TResult>(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results or errors.
Declaration
public static ITrimmable<KeyValuePair<T, IValueOrError<TResult>>> AsTrimmableByArgumentAndResultOrError<T, TResult>(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, IValueOrError<TResult>>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
AsTrimmableByArgumentAndResultOrError<T, TResult>(IMemoizationCache<T, TResult>)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results or errors.
Declaration
public static ITrimmable<KeyValuePair<T, IValueOrError<TResult>>> AsTrimmableByArgumentAndResultOrError<T, TResult>(this IMemoizationCache<T, TResult> cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache<T, TResult> | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, IValueOrError<TResult>>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
AsTrimmableByMetrics(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's cache entry metrics.
Declaration
public static ITrimmable<IMemoizationCacheEntryMetrics> AsTrimmableByMetrics(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<IMemoizationCacheEntryMetrics> | A trimmable view on the specified memoization |
ToTrimmableByArgumentAndResult<T, TResult>(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results.
Declaration
public static ITrimmable<KeyValuePair<T, TResult>> ToTrimmableByArgumentAndResult<T, TResult>(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, TResult>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
ToTrimmableByArgumentAndResult<T, TResult>(IMemoizationCache<T, TResult>)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results.
Declaration
public static ITrimmable<KeyValuePair<T, TResult>> ToTrimmableByArgumentAndResult<T, TResult>(this IMemoizationCache<T, TResult> cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache<T, TResult> | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, TResult>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
ToTrimmableByArgumentAndResultOrError<T, TResult>(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results or errors.
Declaration
public static ITrimmable<KeyValuePair<T, IValueOrError<TResult>>> ToTrimmableByArgumentAndResultOrError<T, TResult>(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, IValueOrError<TResult>>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
ToTrimmableByArgumentAndResultOrError<T, TResult>(IMemoizationCache<T, TResult>)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's pairs of arguments and results or errors.
Declaration
public static ITrimmable<KeyValuePair<T, IValueOrError<TResult>>> ToTrimmableByArgumentAndResultOrError<T, TResult>(this IMemoizationCache<T, TResult> cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache<T, TResult> | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<System.Collections.Generic.KeyValuePair<T, IValueOrError<TResult>>> | A trimmable view on the specified memoization |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the memoized function's arguments. |
| TResult | The type of the memoized function's result. |
ToTrimmableByMetrics(IMemoizationCache)
Gets a trimmable view on the specified memoization cache, exposing the memoized function's cache entry metrics.
Declaration
public static ITrimmable<IMemoizationCacheEntryMetrics> ToTrimmableByMetrics(this IMemoizationCache cache)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemoizationCache | cache | The memoization cache to obtain a trimmable view for. |
Returns
| Type | Description |
|---|---|
| ITrimmable<IMemoizationCacheEntryMetrics> | A trimmable view on the specified memoization |