Trait i_slint_backend_winit::WinitWindowAccessor

source ·
pub trait WinitWindowAccessor: WinitWindowAccessorSealed {
    // Required methods
    fn has_winit_window(&self) -> bool;
    fn with_winit_window<T>(
        &self,
        callback: impl FnOnce(&Window) -> T
    ) -> Option<T>;
}
Expand description

This helper trait can be used to obtain access to the winit::window::Window for a given slint::Window.

Required Methods§

source

fn has_winit_window(&self) -> bool

Returns true if a winit::window::Window exists for this window. This is the case if the window is backed by this winit backend.

source

fn with_winit_window<T>(&self, callback: impl FnOnce(&Window) -> T) -> Option<T>

Invokes the specified callback with a reference to the winit::window::Window that exists for this Slint window and returns Some(T); otherwise None.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WinitWindowAccessor for Window

source§

fn has_winit_window(&self) -> bool

source§

fn with_winit_window<T>(&self, callback: impl FnOnce(&Window) -> T) -> Option<T>

Implementors§