pub trait DynViewPart:
'static
+ Debug
+ Send {
// Required methods
fn render(&self, cx: &Cx, w: &mut HtmlWriter<'_, '_>);
fn clone_box(&self) -> Box<dyn DynViewPart>;
// Provided method
fn size_hint(&self) -> usize { ... }
}Expand description
A boxed view part that writes its output at render time.
Implement this for values whose output is only known when the view
renders, such as resolved asset URLs. The writer passed to
render already carries the HtmlContext of the
position the part was pushed into, so everything written through it is
escaped or validated for that position.
Required Methods§
Sourcefn render(&self, cx: &Cx, w: &mut HtmlWriter<'_, '_>)
fn render(&self, cx: &Cx, w: &mut HtmlWriter<'_, '_>)
Writes this part’s output into w.
Sourcefn clone_box(&self) -> Box<dyn DynViewPart>
fn clone_box(&self) -> Box<dyn DynViewPart>
Clones this view part into a fresh boxed value.
Provided Methods§
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".