Expand description
The factory execution context and its product.
When get_or_set must produce a value, it hands the factory a
FactoryContext. Through it the factory can:
- read the previously-cached stale value and its
ETag/LastModified(conditional refresh); - adapt the entry options for the value it is about to produce
(adaptive caching) via
FactoryContext::options_mut; - signal one of three outcomes: a new value (
FactoryContext::value/FactoryContext::modified), “nothing changed, reuse the stale value” (FactoryContext::not_modified), or failure (FactoryContext::fail).
The factory returns Result<FactoryProduct<V>, FactoryError>; an Err
drives the fail-safe path.
Structs§
- Factory
Context - Context passed to a factory, carrying stale-value information and the mutable options for the value being produced.
- Factory
Product - The value (and metadata) a factory produced, ready to be cached.
- Modified
Builder - Builder for a modified factory result with conditional-refresh metadata.