pub struct CefWebviewDispatcher<T: UserEvent> { /* private fields */ }Implementations§
Source§impl<T: UserEvent> CefWebviewDispatcher<T>
impl<T: UserEvent> CefWebviewDispatcher<T>
Sourcepub fn send_dev_tools_message(&self, message: &[u8]) -> Result<()>
pub fn send_dev_tools_message(&self, message: &[u8]) -> Result<()>
Sends a UTF-8 encoded Chrome DevTools Protocol message to the DevTools agent.
The message’s id must come from
allocate_devtools_message_id, the
allocator every caller on this browser shares. A hardcoded or
self-incremented id can consume another caller’s
DevToolsProtocol::MethodResult. The runtime’s own requests use
identifiers reserved above that allocator’s range, so they cannot be
answered by a caller’s message.
Sourcepub fn on_dev_tools_protocol<F: Fn(DevToolsProtocol) + Send + Sync + 'static>(
&self,
f: F,
) -> Result<()>
pub fn on_dev_tools_protocol<F: Fn(DevToolsProtocol) + Send + Sync + 'static>( &self, f: F, ) -> Result<()>
Observes the DevToolsProtocol traffic of this browser.
The observer receives every message on the browser, including the runtime’s
own requests, so results must be matched against an identifier obtained from
allocate_devtools_message_id.
Scoped to this webview’s own native browser. A CEF-owned popup is a
separate browser whose protocol traffic — its page content, its network
activity and its dialog messages — is never reported here, the way a
FrameEvent of a popup is not. Observe popups
through Webview::popups, whose
FrameNavigationState follows a popup’s
native lifecycle without exposing what it loaded.
Trait Implementations§
Source§impl AsCefWebviewDispatcher for CefWebviewDispatcher<EventLoopMessage>
impl AsCefWebviewDispatcher for CefWebviewDispatcher<EventLoopMessage>
Source§fn as_cef_webview_dispatcher(
&self,
) -> Option<&CefWebviewDispatcher<EventLoopMessage>>
fn as_cef_webview_dispatcher( &self, ) -> Option<&CefWebviewDispatcher<EventLoopMessage>>
Source§impl<T: UserEvent> WebviewDispatch<T> for CefWebviewDispatcher<T>
impl<T: UserEvent> WebviewDispatch<T> for CefWebviewDispatcher<T>
Source§type Runtime = CefRuntime<T>
type Runtime = CefRuntime<T>
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<()>
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
Source§fn with_webview<F: FnOnce(<Self::Runtime as Runtime<T>>::Webview) + Send + 'static>(
&self,
f: F,
) -> Result<()>
fn with_webview<F: FnOnce(<Self::Runtime as Runtime<T>>::Webview) + Send + 'static>( &self, f: F, ) -> Result<()>
Source§fn open_devtools(&self)
fn open_devtools(&self)
Source§fn close_devtools(&self)
fn close_devtools(&self)
Source§fn is_devtools_open(&self) -> Result<bool>
fn is_devtools_open(&self) -> Result<bool>
Source§fn position(&self) -> Result<PhysicalPosition<i32>>
fn position(&self) -> Result<PhysicalPosition<i32>>
Source§fn size(&self) -> Result<PhysicalSize<u32>>
fn size(&self) -> Result<PhysicalSize<u32>>
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<()>
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<()>
WebviewDispatch represents.
The evaluation result will be serialized into a JSON string and passed to the callback function. Read moreSource§fn set_auto_resize(&self, auto_resize: bool) -> Result<()>
fn set_auto_resize(&self, auto_resize: bool) -> Result<()>
Source§fn set_background_color(&self, color: Option<Color>) -> Result<()>
fn set_background_color(&self, color: Option<Color>) -> Result<()>
Source§fn clear_all_browsing_data(&self) -> Result<()>
fn clear_all_browsing_data(&self) -> Result<()>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CefWebviewDispatcher<T>
impl<T> !UnwindSafe for CefWebviewDispatcher<T>
impl<T> Freeze for CefWebviewDispatcher<T>where
RuntimeContext<T>: Freeze,
impl<T> Send for CefWebviewDispatcher<T>where
RuntimeContext<T>: Send,
impl<T> Sync for CefWebviewDispatcher<T>where
RuntimeContext<T>: Sync,
impl<T> Unpin for CefWebviewDispatcher<T>where
RuntimeContext<T>: Unpin,
impl<T> UnsafeUnpin for CefWebviewDispatcher<T>where
RuntimeContext<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
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.