pub struct AssetClosureStore {
pub slots: Vec<Option<Closure<dyn FnMut()>>>,
pub settled: Vec<bool>,
}Expand description
The backing store behind AssetClosures.
Slots are appended in pairs by AssetLoader::load_image — even indices
hold an onload closure, odd indices the matching onerror closure — so
a callback can identify its own slot with one captured index.
The fields are public because the type is reachable from the public
AssetClosures alias: a private-field type exposed through a public
alias would be unusable to callers, and the retained-slot count is
genuinely useful as a leak diagnostic.
Fields§
§slots: Vec<Option<Closure<dyn FnMut()>>>The load callbacks, in registration order. A None slot is one that
has already been released by AssetLoader::collect.
settled: Vec<bool>Whether the closure in the slot at the same index has run. A settled
closure cannot free itself (see AssetClosures) but is no longer
keeping anything alive that the cache still needs.