Skip to main content

DesktopRuntime

Struct DesktopRuntime 

Source
pub struct DesktopRuntime { /* private fields */ }
Expand description

Runtime state shared by a desktop webview custom-protocol handler.

Implementations§

Source§

impl DesktopRuntime

Source

pub fn from_bundle(bundle_dir: PathBuf) -> Result<Self>

Load a desktop runtime from a bundle directory.

§Errors

Returns DesktopError if the bundle manifest, protocol, state, or asset root cannot be loaded.

Source

pub fn from_bundle_config(config: DesktopBundleConfig) -> Result<Self>

Load a desktop runtime from a bundle directory with Rust host state.

§Errors

Returns DesktopError if the bundle manifest, protocol, state, or asset root cannot be loaded, or if startup rendering fails.

Source

pub fn from_bundle_config_and_manifest( config: DesktopBundleConfig, manifest: DesktopBundleManifest, ) -> Result<Self>

Load a desktop runtime from a bundle directory with an already-loaded manifest.

Use this when the caller also needs manifest metadata such as window or shell configuration, so startup does not read and parse the manifest twice.

§Errors

Returns DesktopError if the protocol, state, or asset root cannot be loaded, or if startup rendering fails.

Source

pub fn handle_request( &self, request: &DesktopProtocolRequest<'_>, ) -> Result<DesktopProtocolResponse>

Handle one custom-protocol request.

This method is intentionally independent of any specific webview crate, so path safety, IPC dispatch, and routing can be unit tested without creating an OS window.

Source

pub fn startup_html(&self) -> &str

Return the construction-time HTML snapshot rendered for /.

This does not invoke route providers or include later window-control changes. Use Self::handle_request for the current document styling.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.