pub struct DesktopRuntime { /* private fields */ }Expand description
Runtime state shared by a desktop webview custom-protocol handler.
Implementations§
Source§impl DesktopRuntime
impl DesktopRuntime
Sourcepub fn from_bundle(bundle_dir: PathBuf) -> Result<Self>
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.
Sourcepub fn from_bundle_config(config: DesktopBundleConfig) -> Result<Self>
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.
Sourcepub fn from_bundle_config_and_manifest(
config: DesktopBundleConfig,
manifest: DesktopBundleManifest,
) -> Result<Self>
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.
Sourcepub fn handle_request(
&self,
request: &DesktopProtocolRequest<'_>,
) -> Result<DesktopProtocolResponse>
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.
Sourcepub fn startup_html(&self) -> &str
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.