pub struct WebViewAttributesBuilder(/* private fields */);Expand description
WebView configuration attributes builder
Implementations§
Source§impl WebViewAttributesBuilder
impl WebViewAttributesBuilder
Sourcepub fn with_request_handler_factory(
self,
value: CustomRequestHandlerFactory,
) -> Self
pub fn with_request_handler_factory( self, value: CustomRequestHandlerFactory, ) -> Self
Set the request handler factory
This function is used to set the request handler factory.
Sourcepub fn with_window_handle(self, value: RawWindowHandle) -> Self
pub fn with_window_handle(self, value: RawWindowHandle) -> Self
Set the window handle
In windowed mode, setting the window handle will set the browser as a child view.
In windowless mode, setting the window handle is used to identify monitor information and as a parent view for dialog boxes, context menus, and other elements. If not provided, the main screen monitor will be used, and some features that require a parent view may not work properly.
Sourcepub fn with_windowless_frame_rate(self, value: u32) -> Self
pub fn with_windowless_frame_rate(self, value: u32) -> Self
Set the frame rate in windowless rendering mode
This function is used to set the frame rate in windowless rendering mode.
Note that this parameter only works in windowless rendering mode.
Sourcepub fn with_width(self, value: u32) -> Self
pub fn with_width(self, value: u32) -> Self
Set the window width
This function is used to set the window width.
Note that this parameter only works in windowless rendering mode.
Sourcepub fn with_height(self, value: u32) -> Self
pub fn with_height(self, value: u32) -> Self
Set the window height
This function is used to set the window height.
Note that this parameter only works in windowless rendering mode.
Sourcepub fn with_device_scale_factor(self, value: f32) -> Self
pub fn with_device_scale_factor(self, value: f32) -> Self
Set the device scale factor
This function is used to set the device scale factor.
Sourcepub fn with_default_font_size(self, value: u32) -> Self
pub fn with_default_font_size(self, value: u32) -> Self
Set the default font size
This function is used to set the default font size.
Sourcepub fn with_default_fixed_font_size(self, value: u32) -> Self
pub fn with_default_fixed_font_size(self, value: u32) -> Self
Set the default fixed font size
This function is used to set the default fixed font size.
Sourcepub fn with_minimum_font_size(self, value: u32) -> Self
pub fn with_minimum_font_size(self, value: u32) -> Self
Set the minimum font size
This function is used to set the minimum font size.
Sourcepub fn with_minimum_logical_font_size(self, value: u32) -> Self
pub fn with_minimum_logical_font_size(self, value: u32) -> Self
Set the minimum logical font size
This function is used to set the minimum logical font size.
Sourcepub fn with_local_storage(self, value: bool) -> Self
pub fn with_local_storage(self, value: bool) -> Self
Set whether local storage is enabled
This function is used to set whether local storage is enabled.
Sourcepub fn with_webgl(self, value: bool) -> Self
pub fn with_webgl(self, value: bool) -> Self
Set whether WebGL is enabled
This function is used to set whether WebGL is enabled.
Sourcepub fn with_databases(self, value: bool) -> Self
pub fn with_databases(self, value: bool) -> Self
Set whether databases are enabled
This function is used to set whether databases are enabled.
Sourcepub fn with_javascript(self, value: bool) -> Self
pub fn with_javascript(self, value: bool) -> Self
Set whether JavaScript is enabled
This function is used to set whether JavaScript is enabled.
Sourcepub fn with_javascript_access_clipboard(self, value: bool) -> Self
pub fn with_javascript_access_clipboard(self, value: bool) -> Self
Set whether JavaScript can access the clipboard
This function is used to set whether JavaScript can access the clipboard.
Sourcepub fn with_javascript_close_windows(self, value: bool) -> Self
pub fn with_javascript_close_windows(self, value: bool) -> Self
Set whether JavaScript can be used to close windows that were not opened via JavaScript.
This function is used to set whether JavaScript can be used to close windows that were not opened via JavaScript.
Sourcepub fn with_javascript_dom_paste(self, value: bool) -> Self
pub fn with_javascript_dom_paste(self, value: bool) -> Self
Set whether DOM pasting is supported in the editor via execCommand(“paste”).
This function is used to set whether DOM pasting is supported in the editor via execCommand(“paste”).
Sourcepub fn with_background_color(self, value: u32) -> Self
pub fn with_background_color(self, value: u32) -> Self
Set the background color
This function is used to set the background color.
pub fn build(self) -> WebViewAttributes
Trait Implementations§
Source§impl Default for WebViewAttributesBuilder
impl Default for WebViewAttributesBuilder
Source§fn default() -> WebViewAttributesBuilder
fn default() -> WebViewAttributesBuilder
Auto Trait Implementations§
impl Freeze for WebViewAttributesBuilder
impl !RefUnwindSafe for WebViewAttributesBuilder
impl Send for WebViewAttributesBuilder
impl Sync for WebViewAttributesBuilder
impl Unpin for WebViewAttributesBuilder
impl !UnwindSafe for WebViewAttributesBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.