Struct ChromiumEngine
pub struct ChromiumEngine { /* private fields */ }Expand description
A real Chromium process. Initialization errors are returned to the caller; this type never creates a simulated engine or weakens Chromium’s sandbox.
Implementations§
§impl ChromiumEngine
impl ChromiumEngine
pub fn new() -> Result<Arc<ChromiumEngine>, String>
pub fn new() -> Result<Arc<ChromiumEngine>, String>
Start the packaged runtime and persistent local profile.
§Errors
Returns an error if the runtime/profile cannot be located or prepared,
or the host cannot be started. A host that starts but never becomes
ready fails the page later, as a WebViewEvent::LoadFailed.
pub fn new_with_extensions(
extensions: &[PathBuf],
) -> Result<Arc<ChromiumEngine>, String>
pub fn new_with_extensions( extensions: &[PathBuf], ) -> Result<Arc<ChromiumEngine>, String>
§Errors
Returns an error for invalid extensions, unavailable runtime/profile, or a helper that cannot be started.
pub fn new_private(root: &Path) -> Result<Arc<ChromiumEngine>, String>
pub fn new_private(root: &Path) -> Result<Arc<ChromiumEngine>, String>
§Errors
Returns an error if the private root is not owned, the runtime is missing, or the helper cannot be started.
pub fn with_profile_extensions(
profile: &Path,
extensions: &[PathBuf],
) -> Result<Arc<ChromiumEngine>, String>
pub fn with_profile_extensions( profile: &Path, extensions: &[PathBuf], ) -> Result<Arc<ChromiumEngine>, String>
Explicit profile with the packaged helper and approved extensions.
pub fn with_host(
host: &Path,
profile: &Path,
) -> Result<Arc<ChromiumEngine>, String>
pub fn with_host( host: &Path, profile: &Path, ) -> Result<Arc<ChromiumEngine>, String>
Explicit runtime/profile paths for packaging and isolated live tests.
§Errors
Returns an error if the profile cannot be prepared or the helper cannot start.
pub fn with_private_host(
host: &Path,
root: &Path,
) -> Result<Arc<ChromiumEngine>, String>
pub fn with_private_host( host: &Path, root: &Path, ) -> Result<Arc<ChromiumEngine>, String>
Start an incognito helper whose complete installation root is removed by the process supervisor only after the native child has exited.
§Errors
Returns an error if the private root is not owned, the profile cannot be prepared, or the helper cannot start.
pub fn with_service_session(
profile: &Path,
session_id: &str,
) -> Result<Arc<ChromiumEngine>, String>
pub fn with_service_session( profile: &Path, session_id: &str, ) -> Result<Arc<ChromiumEngine>, String>
A dedicated persistent profile for one explicitly consented service session. The caller owns a private, identity-bound profile directory; this never changes the normal Browser profile or accepts an unbound import.
pub fn sealed_documents(profile: &Path) -> Result<Arc<ChromiumEngine>, String>
pub fn sealed_documents(profile: &Path) -> Result<Arc<ChromiumEngine>, String>
A host for sealed documents over profile, its own: a page never
navigates, a followed link comes back as a new-tab request
(super::WebViewEngine::take_new_tab_requests), and the address
under the pointer as super::WebViewEvent::LinkHovered. For a mail.
§Errors
Returns an error if the runtime is missing, the profile cannot be prepared, or the host cannot start.
pub fn import_service_session(
&self,
request: ServiceSessionRequest,
) -> Result<(), String>
pub fn import_service_session( &self, request: ServiceSessionRequest, ) -> Result<(), String>
Admit private credentials only to the exact dedicated session host.
pub fn shutdown_service_session(&self) -> Result<(), String>
pub fn shutdown_service_session(&self) -> Result<(), String>
Stop this dedicated service host and confirm its actual child was reaped. Unrelated shared/default Browser hosts are never eligible for this operation.
Trait Implementations§
§impl Drop for ChromiumEngine
impl Drop for ChromiumEngine
§impl WebViewEngine for ChromiumEngine
impl WebViewEngine for ChromiumEngine
§fn cursor(&self) -> Option<CursorIcon>
fn cursor(&self) -> Option<CursorIcon>
None for the default arrow, or
an engine that does not say.§fn supports_composition(&self) -> bool
fn supports_composition(&self) -> bool
WebViewCommand::ImeComposition, WebViewCommand::ImeCommit)
and reports the page’s focused field (Self::text_field).§fn text_field(&self) -> Option<TextField>
fn text_field(&self) -> Option<TextField>
None while nothing editable in the page has the focus.§fn handle_undo_request(&self, request: UndoRequest) -> bool
fn handle_undo_request(&self, request: UndoRequest) -> bool
§fn measures_document(&self) -> bool
fn measures_document(&self) -> bool
WebViewCommand::ReportDocumentSize is answered: the
engine measures its document. Known once the engine is ready.§fn supports_guarded_edit_history(&self) -> bool
fn supports_guarded_edit_history(&self) -> bool
fn supports_text_input(&self) -> bool
§fn text_input(&self, request: Request) -> Option<Receipt>
fn text_input(&self, request: Request) -> Option<Receipt>
§fn create_tab(&self) -> Result<Arc<dyn WebViewEngine>, String>
fn create_tab(&self) -> Result<Arc<dyn WebViewEngine>, String>
§fn set_modifiers(&self, modifiers: KeyModifiers)
fn set_modifiers(&self, modifiers: KeyModifiers)
§fn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
§fn take_new_tab_requests(&self) -> Vec<(String, bool)>
fn take_new_tab_requests(&self) -> Vec<(String, bool)>
§fn accept_popups(&self)
fn accept_popups(&self)
window.open with a size: a sign-in,
a payment) opened as popups of this page, which can answer it,
rather than as tabs: Self::take_popups then lists them. An engine
that cannot goes on opening them as tabs.§fn accept_page_dialogs(&self)
fn accept_page_dialogs(&self)
alert, confirm, prompt, “leave
this page?”) sent as WebViewEvent::PageDialog for the embedder to
show and answer. Until then, and in an engine that cannot, each is
declined at once and a page may always be left.WebViewEvent::ClipboardWrite,
and its pastes and reads asked of the embedder
(WebViewEvent::ClipboardRead), where the engine cannot reach the
system clipboard itself. Until then, and in an engine that can or
cannot ask, the page’s clipboard is the engine’s own.§fn take_popups(&self) -> Vec<Popup>
fn take_popups(&self) -> Vec<Popup>
§fn adopt_popup(&self, popup: u32) -> Result<Arc<dyn WebViewEngine>, String>
fn adopt_popup(&self, popup: u32) -> Result<Arc<dyn WebViewEngine>, String>
Self::take_popups listed, to show it.
Dropping it closes the popup. Read more§fn supports_native_filtering(&self) -> bool
fn supports_native_filtering(&self) -> bool
WebKit JSON.§fn send(&self, command: WebViewCommand)
fn send(&self, command: WebViewCommand)
fn frames(&self) -> Arc<Mutex<Option<Frame>>> ⓘ
§fn drain_events(&self) -> Vec<WebViewEvent>
fn drain_events(&self) -> Vec<WebViewEvent>
§fn request_close(&self) -> bool
fn request_close(&self) -> bool
TabClosed, TabDetached or TabCloseBlocked.§fn drain_download_events(&self) -> Vec<WebViewEvent>
fn drain_download_events(&self) -> Vec<WebViewEvent>
§fn set_waker(&self, waker: Box<dyn Fn() + Send + Sync>)
fn set_waker(&self, waker: Box<dyn Fn() + Send + Sync>)
§fn paint_seq(&self) -> u64
fn paint_seq(&self) -> u64
Self::paint_frame’s Frame::seq):
moves on with every change to what the page draws, so a widget
repaints exactly when the page did. 0 for an engine that paints
pixels rather than a display list.§fn presented(&self)
fn presented(&self)
paint::PaintEngine) resume here.§fn wrapped(&self) -> Option<&Arc<dyn WebViewEngine>>
fn wrapped(&self) -> Option<&Arc<dyn WebViewEngine>>
§fn paint_frame(&self) -> Option<Arc<Frame>>
fn paint_frame(&self) -> Option<Arc<Frame>>
§fn paint_blob(&self, _hash: &[u8; 32]) -> Option<Arc<Vec<u8>>>
fn paint_blob(&self, _hash: &[u8; 32]) -> Option<Arc<Vec<u8>>>
paint_frame references.§fn take_paint_stream(&self, _keyframe: bool) -> Vec<Payload>
fn take_paint_stream(&self, _keyframe: bool) -> Vec<Payload>
keyframe (or when the consumer must start over), else the patches
since the last call, followed by images not sent yet. Empty for an
engine without a display list.Auto Trait Implementations§
impl Freeze for ChromiumEngine
impl RefUnwindSafe for ChromiumEngine
impl Send for ChromiumEngine
impl Sync for ChromiumEngine
impl Unpin for ChromiumEngine
impl UnsafeUnpin for ChromiumEngine
impl UnwindSafe for ChromiumEngine
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more