Skip to main content

Module cache

Module cache 

Source
Expand description

A cache for storing the results of layout computation

StructsΒ§

Cache
A cache for caching the results of a sizing a Grid Item or Flexbox Item
CacheEntry πŸ”’
Cached intermediate layout results
CacheKey πŸ”’
Space-optimised cache key that packs bits into as small a size as possible
CacheMode πŸ”’
The layout inputs that affect a node’s layout but are not part of the CacheKey: the SizingMode and whether each of the node’s vertical margins is collapsible, packed into a u8.

EnumsΒ§

ClearState
Clear operation outcome. See Cache::clear

ConstantsΒ§

BOTH_SIGN_BITS_MASK πŸ”’
Mask of both sign bits (used to compute NON_SIGN_BITS_MASK)
CACHE_SIZE πŸ”’
The number of cache entries for each node in the tree
INFINITY_BITS πŸ”’
f32::INFINITY as a u32
MODE_CHANGE_EVICTIONS πŸ”’
See [cache_mode_change_evictions]
NEG_INFINITY_BITS πŸ”’
f32::NEG_INFINITY as a u32
NON_SIGN_BITS_MASK πŸ”’
Mask of excluding the sign bits (used when setting/getting the size excluding the packed bits)
SIGN_BIT_1 πŸ”’
The sign bit of the first f32
SIGN_BIT_2 πŸ”’
The sign bit of the second f32
X_AXIS_VALUE_MASK πŸ”’
Mask which includes only the bits which encode the x-axis value that we can use to ignore the y-axis value when comparing a cache key.

FunctionsΒ§

available_space_cache_key πŸ”’
Pack AvailableSpace into u32
mixed_cache_key πŸ”’
Encodes combination of a known_dimension (Option) and AvailableSpace in a single dimension into a cache key in a single dimension.
option_cache_key πŸ”’
Pack Option<f32> into u32
size_available_space_cache_key πŸ”’
Pack Size<AvailableSpace> into u64
size_mixed_cache_key πŸ”’
Encodes combination of a known_dimension (Option) and AvailableSpace in two dimensions into a cache key in a single dimension.
size_option_cache_key πŸ”’
Pack Size<Option<f32>> into u64