[−][src]Struct web_view::WebView
An owned webview instance.
Construct via a WebViewBuilder
.
Implementations
impl<'a, T> WebView<'a, T>
[src]
pub fn handle(&self) -> Handle<T>
[src]
Creates a thread-safe Handle
to the WebView
, from which closures can be dispatched.
pub fn user_data(&self) -> &T
[src]
Borrows the user data immutably.
pub fn user_data_mut(&mut self) -> &mut T
[src]
Borrows the user data mutably.
pub fn terminate(&mut self)
[src]
Please use exit instead
pub fn exit(&mut self)
[src]
Gracefully exits the webview
pub fn eval(&mut self, js: &str) -> WVResult
[src]
Executes the provided string as JavaScript code within the WebView
instance.
pub fn inject_css(&mut self, css: &str) -> WVResult
[src]
Injects the provided string as CSS within the WebView
instance.
pub fn set_color<C: Into<Color>>(&mut self, color: C)
[src]
Sets the color of the title bar.
Examples
Without specifying alpha (defaults to 255):
webview.set_color((123, 321, 213));
Specifying alpha:
webview.set_color((123, 321, 213, 127));
pub fn set_title(&mut self, title: &str) -> WVResult
[src]
Sets the title displayed at the top of the window.
Errors
If title
contain a nul byte, returns Error::NulByte
.
pub fn set_fullscreen(&mut self, fullscreen: bool)
[src]
Enables or disables fullscreen.
pub fn dialog<'b>(&'b mut self) -> DialogBuilder<'a, 'b, T>
[src]
Please use crates like 'tinyfiledialogs' for dialog handling, see example in examples/dialog.rs
Returns a builder for opening a new dialog window.
pub fn step(&mut self) -> Option<WVResult>
[src]
Iterates the event loop. Returns None
if the view has been closed or terminated.
pub fn run(self) -> WVResult<T>
[src]
Runs the event loop to completion and returns the user data.
pub fn into_inner(self) -> T
[src]
Consumes the WebView
and returns ownership of the user data.
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for WebView<'a, T> where
T: RefUnwindSafe,
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,