pub struct DesktopFrame { /* private fields */ }Expand description
Cross-platform desktop frame owned by a native shell backend.
A frame owns its event registrations and command channel until the backend
returns. Use the optional native runner or a custom DesktopFrameBackend;
clone individual handles, not the owning frame.
Implementations§
Source§impl DesktopFrame
impl DesktopFrame
Sourcepub fn runtime(&self) -> &Arc<DesktopRuntime> ⓘ
pub fn runtime(&self) -> &Arc<DesktopRuntime> ⓘ
Borrow the request dispatcher owned by this frame.
Sourcepub fn window(&self) -> &WindowOptions
pub fn window(&self) -> &WindowOptions
Borrow the immutable window configuration.
Sourcepub fn shell(&self) -> &DesktopShellConfig
pub fn shell(&self) -> &DesktopShellConfig
Borrow the immutable native shell configuration.
Sourcepub fn events(&self) -> &EventRegistry
pub fn events(&self) -> &EventRegistry
Borrow the frame’s event registry for a custom backend.
Sourcepub fn window_handle(&self) -> &WindowHandle
pub fn window_handle(&self) -> &WindowHandle
Borrow the sendable window command handle.
Sourcepub fn new(runtime: Arc<DesktopRuntime>, window: WindowOptions) -> Result<Self>
pub fn new(runtime: Arc<DesktopRuntime>, window: WindowOptions) -> Result<Self>
Create a desktop frame with default shell options and deny-all IPC permissions.
§Errors
Returns an error if the IPC schema is invalid or window styling differs from the already-rendered runtime.
Sourcepub fn on_event<F>(&self, handler: F) -> Result<(), EventRegistrationError>
pub fn on_event<F>(&self, handler: F) -> Result<(), EventRegistrationError>
Register a non-blocking callback for the frame’s lifetime.
§Errors
Returns an error when registration is closed or its bounded capacity is full.
Sourcepub fn subscribe<F>(
&self,
handler: F,
) -> Result<EventSubscription, EventRegistrationError>
pub fn subscribe<F>( &self, handler: F, ) -> Result<EventSubscription, EventRegistrationError>
Register a callback until the returned subscription is dropped.
§Errors
Returns an error when registration is closed or its bounded capacity is full.
Sourcepub fn with_app_id(self, app_id: impl Into<String>) -> Self
pub fn with_app_id(self, app_id: impl Into<String>) -> Self
Set the application’s stable identity for native services.
Sourcepub fn with_shell(self, shell: DesktopShellConfig) -> Self
pub fn with_shell(self, shell: DesktopShellConfig) -> Self
Attach shell options to the frame.