From d822f0b630d4f8003db8b3c706fcd690439f8424 Mon Sep 17 00:00:00 2001 From: Schneems Date: Wed, 18 Dec 2024 14:29:18 -0600 Subject: [PATCH] Clarify intermediate struct docs --- commons/src/layer/cache_buddy.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commons/src/layer/cache_buddy.rs b/commons/src/layer/cache_buddy.rs index 3880da45..a3dfdbe6 100644 --- a/commons/src/layer/cache_buddy.rs +++ b/commons/src/layer/cache_buddy.rs @@ -174,9 +174,9 @@ where } } -/// Either contains metadata or a message describing the state +/// Either contains (old) metadata or a message describing the state /// -/// Why: The `CachedLayerDefinition` allows returning information about the cache state +/// Why: The [`CachedLayerDefinition`] allows returning information about the cache state /// from either `invalid_metadata_action` or `restored_layer_action` functions. /// /// Because the function returns only a single type, that type must be the same for @@ -189,11 +189,10 @@ where /// to inspect the previous metadata they can match on the enum and extract /// what they need. /// +/// When produced using functions in this module: +/// /// - Will only ever contain metadata when the cache is retained. /// - Will contain a message when the cache is cleared, describing why it was cleared. -/// It is also allowable to return a message when the cache is retained, and the -/// message describes the state of the cache. (i.e. because a message is returned -/// does not guarantee the cache was cleared). pub enum Meta { Message(String), Data(M),