WuiConfig

Struct WuiConfig 

Source
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: DevToolsMode

Development tools mode

§remote_debugging_port: u16

Port 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:

  1. Open a Webkit-based browser (Chrome, Edge, etc.)
  2. Go to chrome://inspect (or equivalent)
  3. Click “Configure” next to “Discover network targets”
  4. Add localhost:{port} to the list (e.g., localhost:8088)
  5. Click “Done”

The browser should then show the remote debugger when the program is running.

§locale: String

Locale 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: Utf8PathBuf

Cache 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: Utf8PathBuf

Directory 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: u32

Maximum 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: bool

Implementations§

Source§

impl WuiConfig

Source

pub fn new() -> Self

Create a new configuration with default values

Source

pub fn with_no_sandbox(self, mode: bool) -> Self

Source

pub fn with_devtools(self) -> Self

Enable development tools with default port

Source

pub fn with_debugging_port(self, port: u16) -> Self

Set the remote debugging port

Source

pub fn with_locale(self, locale: impl Into<String>) -> Self

Set the locale

Source

pub fn with_cache_directory(self, path: impl Into<Utf8PathBuf>) -> Self

Set the cache directory path

Source

pub fn with_resources_path(self, path: impl Into<Utf8PathBuf>) -> Self

Set the resources directory path

Source

pub fn with_max_frame_rate(self, fps: u32) -> Self

Set the maximum frame rate

Source

pub fn get_subprocess_path(&self) -> Utf8PathBuf

Source

pub fn validate_config(&self) -> Result<(), WuiError>

Validate the configuration Check for subprocess existance, check for invalid debug ports check for chache directory

Source

pub fn effective_cache_directory(&self) -> Utf8PathBuf

Get the effective cache directory path

If the cache directory is empty, generates a temporary directory path.

Source

pub fn subprocess_path(&self) -> Utf8PathBuf

Get the subprocess executable path

Trait Implementations§

Source§

impl Clone for WuiConfig

Source§

fn clone(&self) -> WuiConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WuiConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WuiConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

fn into_raw(self) -> U

Source§

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

Source§

fn wrap_result(self) -> U

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.