Skip to main content

HookedRender

Trait HookedRender 

Source
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§

Source

fn render( &mut self, window: &mut Window, cx: &mut Context<'_, Self>, ) -> impl IntoElement

render的主要逻辑

Provided Methods§

Source

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.

Implementors§