Skip to content

Commit

Permalink
Clarify intermediate struct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Dec 18, 2024
1 parent b9d9f1d commit d822f0b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions commons/src/layer/cache_buddy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<M> {
Message(String),
Data(M),
Expand Down

0 comments on commit d822f0b

Please sign in to comment.