Struct dioxus_desktop::Config
source · pub struct Config { /* private fields */ }Expand description
The configuration for the desktop application.
Implementations§
source§impl Config
impl Config
sourcepub fn with_resource_directory(self, path: impl Into<PathBuf>) -> Self
pub fn with_resource_directory(self, path: impl Into<PathBuf>) -> Self
set the directory from which assets will be searched in release mode
Set whether or not the right-click context menu should be disabled.
sourcepub fn with_prerendered(self, content: String) -> Self
pub fn with_prerendered(self, content: String) -> Self
Set the pre-rendered HTML content
sourcepub fn with_window(self, window: WindowBuilder) -> Self
pub fn with_window(self, window: WindowBuilder) -> Self
Set the configuration for the window.
sourcepub fn with_file_drop_handler(
self,
handler: impl Fn(&Window, FileDropEvent) -> bool + 'static
) -> Self
pub fn with_file_drop_handler(
self,
handler: impl Fn(&Window, FileDropEvent) -> bool + 'static
) -> Self
Set a file drop handler
sourcepub fn with_custom_protocol<F>(self, name: String, handler: F) -> Selfwhere
F: Fn(&HttpRequest<Vec<u8>>) -> WryResult<HttpResponse<Vec<u8>>> + 'static,
pub fn with_custom_protocol<F>(self, name: String, handler: F) -> Selfwhere
F: Fn(&HttpRequest<Vec<u8>>) -> WryResult<HttpResponse<Vec<u8>>> + 'static,
Set a custom protocol
sourcepub fn with_custom_head(self, head: String) -> Self
pub fn with_custom_head(self, head: String) -> Self
Inject additional content into the document’s HEAD.
This is useful for loading CSS libraries, JS libraries, etc.
sourcepub fn with_custom_index(self, index: String) -> Self
pub fn with_custom_index(self, index: String) -> Self
Use a custom index.html instead of the default Dioxus one.
Make sure your index.html is valid HTML.
Dioxus injects some loader code into the closing body tag. Your document must include a body element!
sourcepub fn with_root_name(self, name: impl Into<String>) -> Self
pub fn with_root_name(self, name: impl Into<String>) -> Self
Set the name of the element that Dioxus will use as the root.
This is akint to calling React.render() on the element with the specified name.