pub trait GpuiWindowExt {
// Required methods
fn attach_gpui_view<F, V>(
&self,
options: GpuiOptions,
root: F,
) -> Result<(), GpuiError>
where F: FnOnce(&mut Window, &mut App) -> Entity<V> + 'static,
V: Render + 'static;
fn is_gpui_attached(&self) -> bool;
// Provided methods
fn attach_gpui<F, V>(&self, root: F) -> Result<(), GpuiError>
where F: FnOnce(&mut App) -> Entity<V> + 'static,
V: Render + 'static { ... }
fn attach_gpui_with<F, V>(
&self,
options: GpuiOptions,
root: F,
) -> Result<(), GpuiError>
where F: FnOnce(&mut App) -> Entity<V> + 'static,
V: Render + 'static { ... }
}Expand description
Attaches GPUI as the content renderer of a Tauri window.
Required Methods§
Sourcefn attach_gpui_view<F, V>(
&self,
options: GpuiOptions,
root: F,
) -> Result<(), GpuiError>
fn attach_gpui_view<F, V>( &self, options: GpuiOptions, root: F, ) -> Result<(), GpuiError>
Like attach_gpui_with, but the root
builder also receives the GPUI Window. Component
libraries need this to wrap content in their root view, e.g.
|window, cx| cx.new(|cx| Root::new(view, window, cx)).
Sourcefn is_gpui_attached(&self) -> bool
fn is_gpui_attached(&self) -> bool
Whether GPUI is attached to this window.
Provided Methods§
Sourcefn attach_gpui<F, V>(&self, root: F) -> Result<(), GpuiError>
fn attach_gpui<F, V>(&self, root: F) -> Result<(), GpuiError>
Permanently attaches GPUI to this window and mounts root as its root
view. There is no detach: the GPUI root and its rendering surface are
destroyed together with the Tauri window.
Must be called on the main thread for a window without a WebView.
Child webviews can be added afterwards and placed with
webview_frame.
When called from inside GPUI code the mount completes right after the
current GPUI update returns.
Sourcefn attach_gpui_with<F, V>(
&self,
options: GpuiOptions,
root: F,
) -> Result<(), GpuiError>
fn attach_gpui_with<F, V>( &self, options: GpuiOptions, root: F, ) -> Result<(), GpuiError>
attach_gpui with explicit options.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".