pub struct DynWebviewDispatcher<T: UserEvent> { /* private fields */ }Expand description
The WebviewDispatch of DynRuntime.
Implementations§
Source§impl<T: UserEvent> DynWebviewDispatcher<T>
impl<T: UserEvent> DynWebviewDispatcher<T>
Sourcepub fn new<D: WebviewDispatch<T>>(dispatcher: D) -> Self
pub fn new<D: WebviewDispatch<T>>(dispatcher: D) -> Self
Wraps a webview dispatcher.
Sourcepub fn is<D: WebviewDispatch<T>>(&self) -> bool
pub fn is<D: WebviewDispatch<T>>(&self) -> bool
Whether the wrapped dispatcher is of type D.
Sourcepub fn downcast_ref<D: WebviewDispatch<T>>(&self) -> Option<&D>
pub fn downcast_ref<D: WebviewDispatch<T>>(&self) -> Option<&D>
Returns a reference to the wrapped dispatcher if it is of type D.
Trait Implementations§
Source§impl<T: UserEvent> Clone for DynWebviewDispatcher<T>
impl<T: UserEvent> Clone for DynWebviewDispatcher<T>
Source§impl<T: UserEvent> WebviewDispatch<T> for DynWebviewDispatcher<T>
impl<T: UserEvent> WebviewDispatch<T> for DynWebviewDispatcher<T>
Source§type Runtime = DynRuntime<T>
type Runtime = DynRuntime<T>
The runtime this
WebviewDispatch runs under.Source§fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
Run a task on the main thread.
Source§fn on_webview_event<F: Fn(&WebviewEvent) + Send + 'static>(
&self,
f: F,
) -> WebviewEventId
fn on_webview_event<F: Fn(&WebviewEvent) + Send + 'static>( &self, f: F, ) -> WebviewEventId
Registers a webview event handler.
Source§fn with_webview<F: FnOnce(DynWebview) + Send + 'static>(
&self,
f: F,
) -> Result<()>
fn with_webview<F: FnOnce(DynWebview) + Send + 'static>( &self, f: F, ) -> Result<()>
Runs a closure with the platform webview object as argument.
Source§fn open_devtools(&self)
fn open_devtools(&self)
Open the web inspector which is usually called devtools. Read more
Source§fn close_devtools(&self)
fn close_devtools(&self)
Close the web inspector which is usually called devtools. Read more
Source§fn is_devtools_open(&self) -> Result<bool>
fn is_devtools_open(&self) -> Result<bool>
Gets the devtools window’s current open state. Read more
Source§fn position(&self) -> Result<PhysicalPosition<i32>>
fn position(&self) -> Result<PhysicalPosition<i32>>
Returns the position of the top-left hand corner of the webviews’s client area relative to the top-left hand corner of the window.
Source§fn size(&self) -> Result<PhysicalSize<u32>>
fn size(&self) -> Result<PhysicalSize<u32>>
Returns the physical size of the webviews’s client area.
Navigate to the given URL.
fn go_back(&self) -> Result<()>
fn can_go_back(&self) -> Result<bool>
fn go_forward(&self) -> Result<()>
fn can_go_forward(&self) -> Result<bool>
Source§fn eval_script<S: Into<String>>(&self, script: S) -> Result<()>
fn eval_script<S: Into<String>>(&self, script: S) -> Result<()>
Executes javascript on the window this
WindowDispatch represents.Source§fn eval_script_with_callback<S: Into<String>>(
&self,
script: S,
callback: impl Fn(String) + Send + 'static,
) -> Result<()>
fn eval_script_with_callback<S: Into<String>>( &self, script: S, callback: impl Fn(String) + Send + 'static, ) -> Result<()>
Evaluate JavaScript with callback function on the webview this
WebviewDispatch represents.
The evaluation result will be serialized into a JSON string and passed to the callback function. Read moreGet cookies for a particular url. Read more
Return all cookies in the cookie store. Read more
Set a cookie for the webview. Read more
Delete a cookie for the webview. Read more
Source§fn set_auto_resize(&self, auto_resize: bool) -> Result<()>
fn set_auto_resize(&self, auto_resize: bool) -> Result<()>
Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes.
Source§fn set_background_color(&self, color: Option<Color>) -> Result<()>
fn set_background_color(&self, color: Option<Color>) -> Result<()>
Set the webview background.
Source§fn clear_all_browsing_data(&self) -> Result<()>
fn clear_all_browsing_data(&self) -> Result<()>
Clear all browsing data for this webview.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DynWebviewDispatcher<T>
impl<T> !UnwindSafe for DynWebviewDispatcher<T>
impl<T> Freeze for DynWebviewDispatcher<T>
impl<T> Send for DynWebviewDispatcher<T>
impl<T> Sync for DynWebviewDispatcher<T>
impl<T> Unpin for DynWebviewDispatcher<T>
impl<T> UnsafeUnpin for DynWebviewDispatcher<T>where
Box<dyn ErasedWebviewDispatch<T>>: UnsafeUnpin,
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