pub trait ContentCx<'a> {
type Spec: Spec;
// Required methods
fn with_paint<R>(
&mut self,
f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<Self::Spec>, &Tokens) -> R,
) -> R;
fn time_ms(&self) -> u64;
// Provided methods
fn ime_area(&mut self, _rect: Rect) { ... }
fn frame_now_ms(&self) -> f64 { ... }
fn request_frame(&mut self) { ... }
fn is_overlay(&self) -> bool { ... }
}Expand description
Required Associated Types§
Required Methods§
Sourcefn with_paint<R>(
&mut self,
f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<Self::Spec>, &Tokens) -> R,
) -> R
fn with_paint<R>( &mut self, f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<Self::Spec>, &Tokens) -> R, ) -> R
Run f against this frame’s paint target and registration face.
Provided Methods§
Sourcefn ime_area(&mut self, _rect: Rect)
fn ime_area(&mut self, _rect: Rect)
Report the focused field’s caret rect so the OS IME window opens there.
Sourcefn frame_now_ms(&self) -> f64
fn frame_now_ms(&self) -> f64
The frame clock in milliseconds, unrounded: the stamp scroll containers share within one frame.
Sourcefn request_frame(&mut self)
fn request_frame(&mut self)
Ask for another frame (an animation or a scroll is still moving).
Sourcefn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Painting into an overlay (a modal makes the page’s scroll containers inert to keys).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".