pub trait HookedRender: Sized + HookedElement {
// Required method
fn render(
&mut self,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> impl IntoElement;
// Provided method
fn pre_render(&mut self, _window: &mut Window, _cx: &mut Context<'_, Self>) { ... }
}Expand description
HookedRender trait - 在GPUI的Render后执行钩子代码
Required Methods§
Sourcefn render(
&mut self,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> impl IntoElement
fn render( &mut self, window: &mut Window, cx: &mut Context<'_, Self>, ) -> impl IntoElement
render的主要逻辑
Provided Methods§
Sourcefn pre_render(&mut self, _window: &mut Window, _cx: &mut Context<'_, Self>)
fn pre_render(&mut self, _window: &mut Window, _cx: &mut Context<'_, Self>)
render之前执行的代码(默认执行所有hooks)
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.