pub struct Webview { /* private fields */ }Expand description
Webview wrapper
Implementations§
Source§impl Webview
impl Webview
Sourcepub fn create_no_win(debug: bool) -> Webview
pub fn create_no_win(debug: bool) -> Webview
Create a new instance of the webview
Navigate to a url
Sourcepub fn set_html(&self, html: &str) -> Result<(), WvError>
pub fn set_html(&self, html: &str) -> Result<(), WvError>
Set the html content of the weview window
Sourcepub fn init(&self, js: &str) -> Result<(), WvError>
pub fn init(&self, js: &str) -> Result<(), WvError>
Injects JavaScript code at the initialization of the new page
Sourcepub fn eval(&self, js: &str) -> Result<(), WvError>
pub fn eval(&self, js: &str) -> Result<(), WvError>
Evaluates arbitrary JavaScript code. Evaluation happens asynchronously
Sourcepub fn dispatch<F>(&mut self, f: F) -> Result<(), WvError>
pub fn dispatch<F>(&mut self, f: F) -> Result<(), WvError>
Posts a function to be executed on the main thread
Sourcepub fn bind<F>(&self, name: &str, f: F) -> Result<(), WvError>
pub fn bind<F>(&self, name: &str, f: F) -> Result<(), WvError>
Binds a native C callback so that it will appear under the given name as a global JavaScript function
Sourcepub fn unbind(&self, name: &str) -> Result<(), WvError>
pub fn unbind(&self, name: &str) -> Result<(), WvError>
Unbinds a native C callback so that it will appear under the given name as a global JavaScript function
Sourcepub fn return_(
&self,
seq: &str,
status: i32,
result: &str,
) -> Result<(), WvError>
pub fn return_( &self, seq: &str, status: i32, result: &str, ) -> Result<(), WvError>
Allows to return a value from the native binding.
Sourcepub fn set_size(
&self,
width: i32,
height: i32,
hints: SizeHint,
) -> Result<(), WvError>
pub fn set_size( &self, width: i32, height: i32, hints: SizeHint, ) -> Result<(), WvError>
Set the size of the webview window
Sourcepub fn get_window(&self) -> *mut c_void
pub fn get_window(&self) -> *mut c_void
Get the webview’s window
Trait Implementations§
Source§impl FromFltkWindow for Webview
impl FromFltkWindow for Webview
impl Send for Webview
impl Sync for Webview
Auto Trait Implementations§
impl Freeze for Webview
impl RefUnwindSafe for Webview
impl Unpin for Webview
impl UnwindSafe for Webview
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