Skip to main content

WpeBackend

Struct WpeBackend 

Source
pub struct WpeBackend { /* private fields */ }
Expand description

Real WebKitGTK 6 backend. Construct on the GTK main thread; all subsequent calls must come from the same thread.

Implementations§

Source§

impl WpeBackend

Source

pub fn new() -> Self

Build a backend. Caller must already have initialized GTK on this thread (via gtk4::init()); production wiring lives in vs-cli::serve on Linux. Constructing on a non-GTK thread will panic the first time a WebView operation runs.

Source

pub fn with_capture_dir(self, dir: impl Into<PathBuf>) -> Self

Pin the directory where capture writes PNGs. Defaults to a system temp subdirectory.

Trait Implementations§

Source§

impl Default for WpeBackend

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Engine for WpeBackend

Source§

fn open(&mut self, url: &str) -> EngineResult<PageHandle>

Open a fresh page navigated to url.
Source§

fn close(&mut self, page: PageHandle) -> EngineResult<()>

Close a page. Idempotent — closing a closed page is a no-op.
Source§

fn snapshot(&mut self, page: PageHandle) -> EngineResult<Tree>

Snapshot the a11y tree at page.
Source§

fn act( &mut self, page: PageHandle, target: ActTarget, action: Action, ) -> EngineResult<()>

Perform action on target at page.
Source§

fn wait( &mut self, page: PageHandle, cond: WaitCondition, budget: Duration, ) -> EngineResult<()>

Wait for cond at page until satisfied or budget elapses.
Source§

fn layout( &mut self, page: PageHandle, refs: &[Ref], ) -> EngineResult<Vec<LayoutBox>>

Compute layout boxes for refs at page.
Source§

fn set_viewport( &mut self, page: PageHandle, viewport: Viewport, ) -> EngineResult<()>

Set the viewport at page. Triggers a re-baseline for the next snapshot.
Source§

fn capture( &mut self, page: PageHandle, _scope: CaptureScope, ) -> EngineResult<PathBuf>

Take a screenshot. Returns the path on disk where the image was written.
Source§

fn save_auth(&mut self, page: PageHandle) -> EngineResult<AuthBlob>

Snapshot cookies/storage for page as an opaque AuthBlob.
Source§

fn load_auth(&mut self, page: PageHandle, blob: &AuthBlob) -> EngineResult<()>

Apply a previously saved AuthBlob to page.
Source§

fn console_entries( &mut self, page: PageHandle, ) -> EngineResult<Vec<ConsoleEntry>>

Snapshot the always-captured console ring buffer for page. Default impl returns empty (engines without console capture).
Source§

fn network_entries( &mut self, page: PageHandle, ) -> EngineResult<Vec<NetworkEntry>>

Snapshot the always-captured network ring buffer for page. Default impl returns empty (engines without network capture).
Source§

fn request_detail( &mut self, page: PageHandle, seq: u64, ) -> EngineResult<Option<RequestDetail>>

Look up the full detail (headers + bodies) for a single captured network request. Returns None if the seq isn’t in the buffer. Default impl returns None.
Source§

fn eval_js(&mut self, page: PageHandle, expr: &str) -> EngineResult<EvalResult>

Evaluate expr in main world. Default impl returns EvalResult::Thrown { kind: "NotImplemented", ... }.
Source§

fn storage( &mut self, page: PageHandle, scope: StorageScope, ) -> EngineResult<Vec<StorageEntry>>

List storage entries for the requested scope.
Source§

fn scripts(&mut self, page: PageHandle) -> EngineResult<Vec<ScriptEntry>>

List scripts loaded by the page.
Source§

fn script_source( &mut self, page: PageHandle, seq: u64, ) -> EngineResult<Option<ScriptSource>>

Source of one script by seq. Returns None if the seq isn’t in the script registry.
Source§

fn dom( &mut self, page: PageHandle, r: Ref, extra_props: &[String], ) -> EngineResult<Option<DomDetail>>

Outer HTML + computed styles for a ref. Caller-requested computed properties land in extra_props; the engine merges them with its default property set. Returns None for unknown refs.
Source§

fn performance(&mut self, page: PageHandle) -> EngineResult<PerformanceMetrics>

Web Vitals + heap + DOM stats. Returns zero-filled defaults if the engine can’t measure them.
Source§

fn cookie_events(&mut self, page: PageHandle) -> EngineResult<Vec<CookieEvent>>

List cookie store ADD/REMOVE events observed since the page opened. Engines without a cookie-changed observer (Windows, the stub) return an empty vec or ENGINE_UNSUPPORTED via their capability flag.
Source§

fn capabilities(&self) -> EngineCapabilities

Capabilities the daemon should advertise for this engine.

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.