pub struct Holding { /* private fields */ }Expand description
Wraps a widget so that dropping the widget drops a set of Effects with it.
An Effect deregisters on drop, so one bound to a let inside a function that returns a widget stops
the moment that function returns — the closure runs exactly once and then never again, which reads as a
working binding right up until the value it derives is expected to move. A widget that owns its effects
(Container::keeping) solves that for itself, and this solves it for
anything else: a leaf, a boxed component, whatever a .rsx happens to have at its root.
Unrelated to kept, which keeps a value across rebuilds of a surface. This keeps a
subscription alive for as long as a widget lives.
Invisible in every other respect. Layout, painting, hit-testing and debug_name all pass straight
through, so wrapping costs no layout node and the devtools tree still names the widget underneath.