pub enum ImagePlaceholder {
Color(Color),
Skeleton(Skeleton),
Image(Box<Image>),
}Expand description
What stands in for an image while it is on its way.
Not crate::Placeholder, which is the design tool’s crossed box: this one is the
slot Image::placeholder fills.
Three, because they are the three things anybody puts there: a flat colour, the shimmering block a list of thumbnails wants, or a smaller picture — a blurred thumbnail, a low-resolution copy, the one already in the cache.
It is not a widget slot, and that is deliberate: Image carries no message type
(impl<Msg> Widget<Msg> for Image), which is what lets one be built once and dropped
into any tree. Taking an arbitrary child would make it Image<Msg> and cost that
everywhere, to buy a fourth case nobody has asked for.
Variants§
Color(Color)
A flat colour.
Skeleton(Skeleton)
The shimmering block, at whatever shape it was built with.
Image(Box<Image>)
Another picture: a blur, a thumbnail, the cached copy.