Struct asset_lru::AssetCacheConfig [−][src]
pub struct AssetCacheConfig {
pub max_bytes_cost: u64,
pub max_decoded_cost: u64,
pub max_single_object_bytes_cost: u64,
pub max_single_object_decoded_cost: u64,
}
Expand description
Configuration for a AssetCache.
This type doesn’t implement Default
: applications should carefully consider their memory requirements and decide
on appropriate values.
Fields
max_bytes_cost: u64
Maximum cost of the bytes cache in bytes.
max_decoded_cost: u64
Maximum cost of the decoded cache in bytes.
max_single_object_bytes_cost: u64
Maximum size of a single vec of bytes before we won’t cache it.
Use this to avoid caching huge objects.
max_single_object_decoded_cost: u64
Point at which we will avoid caching individual decoded objects.
For example maybe your audio file is 50mb when decoded, and you’d like to not keep it around.
Note that even when we choose not to cache such objects, we still keep them around via weak references, so it’s not always the case that the cache will refuse to give it back to you without decoding a second time.