pub struct WebView<'a, T: 'a> { /* private fields */ }
Expand description
An owned webview instance.
Construct via a WebViewBuilder
.
Implementations§
Source§impl<'a, T> WebView<'a, T>
impl<'a, T> WebView<'a, T>
Sourcepub fn handle(&self) -> Handle<T>
pub fn handle(&self) -> Handle<T>
Creates a thread-safe Handle
to the WebView
, from which closures can be dispatched.
Sourcepub fn user_data_mut(&mut self) -> &mut T
pub fn user_data_mut(&mut self) -> &mut T
Borrows the user data mutably.
pub fn terminate(&mut self)
👎Deprecated: Please use exit instead
Sourcepub fn eval(&mut self, js: &str) -> WVResult
pub fn eval(&mut self, js: &str) -> WVResult
Executes the provided string as JavaScript code within the WebView
instance.
Sourcepub fn inject_css(&mut self, css: &str) -> WVResult
pub fn inject_css(&mut self, css: &str) -> WVResult
Injects the provided string as CSS within the WebView
instance.
Sourcepub fn set_title(&mut self, title: &str) -> WVResult
pub fn set_title(&mut self, title: &str) -> WVResult
Sets the title displayed at the top of the window.
§Errors
If title
contain a nul byte, returns Error::NulByte
.
Sourcepub fn set_fullscreen(&mut self, fullscreen: bool)
pub fn set_fullscreen(&mut self, fullscreen: bool)
Enables or disables fullscreen.
Sourcepub fn dialog<'b>(&'b mut self) -> DialogBuilder<'a, 'b, T>
👎Deprecated: Please use crates like ‘tinyfiledialogs’ for dialog handling, see example in examples/dialog.rs
pub fn dialog<'b>(&'b mut self) -> DialogBuilder<'a, 'b, T>
Returns a builder for opening a new dialog window.
Sourcepub fn step(&mut self) -> Option<WVResult>
pub fn step(&mut self) -> Option<WVResult>
Iterates the event loop. Returns None
if the view has been closed or terminated.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the WebView
and returns ownership of the user data.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for WebView<'a, T>
impl<'a, T> RefUnwindSafe for WebView<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for WebView<'a, T>
impl<'a, T> !Sync for WebView<'a, T>
impl<'a, T> Unpin for WebView<'a, T>
impl<'a, T> !UnwindSafe for WebView<'a, T>
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
Mutably borrows from an owned value. Read more