pub trait Rebuild {
// Required method
fn rebuild(&self, cx: &mut RebuildCx<'_, '_>, old: &Self);
}Expand description
A convenience trait for rebuilding a View.
When derived this will detect changes in the fields of the struct and
request a rebuild, layout or draw when necessary. This is done by
specifying the #[rebuild(...)] attribute on the fields of the struct.
Valid values are layout and draw.
§Example
ⓘ
#[derive(Rebuild)]
struct MyView {
#[rebuild(layout)]
size: f32,
#[rebuild(draw)]
color: Color,
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.