pub struct WuiConfig {
pub devtools_mode: DevToolsMode,
pub remote_debugging_port: u16,
pub locale: String,
pub cache_directory_path: Utf8PathBuf,
pub wui_resources_path: Utf8PathBuf,
pub max_tab_frame_rate: u32,
pub no_sandbox: bool,
}Expand description
Main configuration structure for WUI
Fields§
§devtools_mode: DevToolsModeDevelopment tools mode
remote_debugging_port: u16Port for remote debugging (only used if devtools_mode is Enabled)
Warning: If binding to a port lower than 1024, the program must be run as root (though this is dangerous and not recommended).
To access the remote debugger:
- Open a Webkit-based browser (Chrome, Edge, etc.)
- Go to
chrome://inspect(or equivalent) - Click “Configure” next to “Discover network targets”
- Add
localhost:{port}to the list (e.g.,localhost:8088) - Click “Done”
The browser should then show the remote debugger when the program is running.
locale: StringLocale forwarded to the browser
This controls the language and regional settings used by the embedded browser. Common values include “en-US”, “de-DE”, “fr-FR”, etc.
cache_directory_path: Utf8PathBufCache directory for the internal browser
This directory is used to store cookies, cache, and other browser data.
Warning: This data may be sensitive depending on your application.
Note: Since this is the cache for the browser internally, undesired side effects may occur if an existing directory is used.
If empty, a new directory is created inside the system’s temporary directory.
The path is constructed as: temp_dir/rui/{timestamp}
wui_resources_path: Utf8PathBufDirectory where RUI resources are located
This is the directory where the RUI subprocess executable is located.
The check concatenates rui_resources_path + "/rui_subprocess" or
rui_resources_path + "/rui_subprocess.exe" on Windows.
Warning: No trailing slash is allowed.
max_tab_frame_rate: u32Maximum frame rate for tabs (not currently implemented)
This would be the maximum frame rate for web UI tabs. The actual frame rate is determined by the browser and the page being rendered.
Note: Currently all tabs run at 30fps max.
no_sandbox: boolImplementations§
Source§impl WuiConfig
impl WuiConfig
pub fn with_no_sandbox(self, mode: bool) -> Self
Sourcepub fn with_devtools(self) -> Self
pub fn with_devtools(self) -> Self
Enable development tools with default port
Sourcepub fn with_debugging_port(self, port: u16) -> Self
pub fn with_debugging_port(self, port: u16) -> Self
Set the remote debugging port
Sourcepub fn with_locale(self, locale: impl Into<String>) -> Self
pub fn with_locale(self, locale: impl Into<String>) -> Self
Set the locale
Sourcepub fn with_cache_directory(self, path: impl Into<Utf8PathBuf>) -> Self
pub fn with_cache_directory(self, path: impl Into<Utf8PathBuf>) -> Self
Set the cache directory path
Sourcepub fn with_resources_path(self, path: impl Into<Utf8PathBuf>) -> Self
pub fn with_resources_path(self, path: impl Into<Utf8PathBuf>) -> Self
Set the resources directory path
Sourcepub fn with_max_frame_rate(self, fps: u32) -> Self
pub fn with_max_frame_rate(self, fps: u32) -> Self
Set the maximum frame rate
pub fn get_subprocess_path(&self) -> Utf8PathBuf
Sourcepub fn validate_config(&self) -> Result<(), WuiError>
pub fn validate_config(&self) -> Result<(), WuiError>
Validate the configuration Check for subprocess existance, check for invalid debug ports check for chache directory
Sourcepub fn effective_cache_directory(&self) -> Utf8PathBuf
pub fn effective_cache_directory(&self) -> Utf8PathBuf
Get the effective cache directory path
If the cache directory is empty, generates a temporary directory path.
Sourcepub fn subprocess_path(&self) -> Utf8PathBuf
pub fn subprocess_path(&self) -> Utf8PathBuf
Get the subprocess executable path