Skip to main content

ChromiumEngine

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

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>

§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>

§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>

Explicit profile with the packaged helper and approved extensions.

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>

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>

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>

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>

Admit private credentials only to the exact dedicated session host.

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

§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
§

impl WebViewEngine for ChromiumEngine

§

fn cursor(&self) -> Option<CursorIcon>

The pointer shape the page last asked for where the pointer is (a hand on a link, an I-beam on text); None for the default arrow, or an engine that does not say.
§

fn supports_composition(&self) -> bool

Whether the engine takes an input method’s composition (WebViewCommand::ImeComposition, WebViewCommand::ImeCommit) and reports the page’s focused field (Self::text_field).
§

fn text_field(&self) -> Option<TextField>

The page’s focused editable field, for the platform input method; None while nothing editable in the page has the focus.
§

fn handle_undo_request(&self, request: UndoRequest) -> bool

Offer system Undo/Redo to this page’s native editing history. True means the backend consumed the request, not that a history entry existed or that an asynchronous edit has already completed.
§

fn measures_document(&self) -> bool

Whether WebViewCommand::ReportDocumentSize is answered: the engine measures its document. Known once the engine is ready.
§

fn supports_guarded_edit_history(&self) -> bool

Whether original-field acknowledged Undo/Redo is supported.
§

fn supports_text_input(&self) -> bool

§

fn text_input(&self, request: Request) -> Option<Receipt>

Private text transactions never enter the app event or page-agent stream.
§

fn navigate_owned( &self, request_id: u32, command: NavigationCommand, ) -> Result<(), String>

Admit a navigation and reserve its terminal outcome. IDs must increase strictly within this engine’s lifetime and fit a positive CEF signed integer. Read more
§

fn create_tab(&self) -> Result<Arc<dyn WebViewEngine>, String>

Create an independent document in the same runtime/profile. Read more
§

fn set_modifiers(&self, modifiers: KeyModifiers)

Keep pointer modifiers current even when no key event reaches the page.
§

fn set_visible(&self, visible: bool)

Suspend painting without discarding the document or its session history.
§

fn take_new_tab_requests(&self) -> Vec<(String, bool)>

Native new-window intents, delivered to browser chrome as tab requests.
§

fn accept_popups(&self)

Have the page’s popup windows (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)

Have the page’s own questions (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.
§

fn share_clipboard(&self)

Have what the page copies sent as 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>

The popups the page opened since the last call.
§

fn adopt_popup(&self, popup: u32) -> Result<Arc<dyn WebViewEngine>, String>

The engine of a popup Self::take_popups listed, to show it. Dropping it closes the popup. Read more
§

fn supports_native_filtering(&self) -> bool

Whether this backend accepts source rules instead of WebKit JSON.
§

fn send(&self, command: WebViewCommand)

Enqueue a command. Must never block on engine work.
§

fn frames(&self) -> Arc<Mutex<Option<Frame>>> ⓘ

§

fn drain_events(&self) -> Vec<WebViewEvent>

Take all pending events, oldest first.
§

fn request_close(&self) -> bool

Request native close admission. True allows immediate local close; false completes asynchronously through TabClosed, TabDetached or TabCloseBlocked.
§

fn drain_download_events(&self) -> Vec<WebViewEvent>

Runtime-owned download events, independent of a tab lifetime.
§

fn set_waker(&self, waker: Box<dyn Fn() + Send + Sync>)

Invoked (from any thread) whenever a new frame or event is ready — typically wired to the winit event loop proxy so idle apps repaint on engine activity. Synchronous engines don’t need one.
§

fn paint_seq(&self) -> u64

The sequence number of the display list this engine paints (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)

A view drew this engine’s page just now. Engines that stop painting pages nobody draws (see paint::PaintEngine) resume here.
§

fn wrapped(&self) -> Option<&Arc<dyn WebViewEngine>>

The engine this one wraps, for what only a backend can answer.
§

fn paint_frame(&self) -> Option<Arc<Frame>>

The page as a display list. An engine that has one is drawn from it instead of frames (see paint).
§

fn paint_blob(&self, _hash: &[u8; 32]) -> Option<Arc<Vec<u8>>>

Encoded bytes of an image a paint_frame references.
§

fn take_paint_stream(&self, _keyframe: bool) -> Vec<Payload>

The page as a stream for a session to share: a whole frame when 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,