Skip to main content

PageRequest

Enum PageRequest 

pub enum PageRequest {
Show 20 variants Outline { frame: Option<FrameId>, }, Click { element: String, frame: Option<FrameId>, }, Hover { element: Option<String>, point: Option<(f64, f64)>, }, Drag { from: Option<String>, from_point: Option<(f64, f64)>, to: Option<String>, to_point: Option<(f64, f64)>, steps: u8, }, Path { element: Option<String>, points: Vec<(f64, f64)>, }, Fill { element: String, text: String, secret: bool, frame: Option<FrameId>, }, Select { element: String, values: Vec<String>, frame: Option<FrameId>, }, FillFiles { element: String, paths: Vec<String>, frame: Option<FrameId>, }, Press { element: Option<String>, key: PageKey, frame: Option<FrameId>, }, Submit { element: String, cross_origin: bool, frame: Option<FrameId>, }, Changes { frame: Option<FrameId>, }, At { x: f64, y: f64, frame: Option<FrameId>, }, Settle { quiet_ms: u32, timeout_ms: u32, frame: Option<FrameId>, }, Console { since: u64, }, Network { since: u64, }, Reader { enabled: bool, }, Capture { element: Option<String>, max_width: Option<u32>, frame: Option<FrameId>, }, Find { role: Option<String>, name: Option<String>, nth: Option<u32>, frame: Option<FrameId>, }, Pointer { steps: Vec<PointerStep>, button: PointerButton, }, Scroll { element: Option<String>, to: Option<ScrollTarget>, by: Option<i32>, into_view: Option<String>, frame: Option<FrameId>, },
}

Variants§

§

Outline

A compact accessibility outline of the document. Interactive elements carry the refs every other request addresses, and a frame carries the id that addresses its own document.

Fields

§

Click

A trusted pointer click at the element’s visible centre.

Fields

§element: String
§

Hover

A trusted pointer move to the element’s visible centre, or to the viewport point (x, y) when no element is named: moving the pointer alone, with no button, so the page’s hover styles apply.

Fields

§element: Option<String>
§point: Option<(f64, f64)>
§

Drag

A trusted press, move and release on the element’s visible centre, or on the viewport point when no element is named: the drag and drop gesture of a person holding the pointer down and moving it.

Fields

§from_point: Option<(f64, f64)>
§to_point: Option<(f64, f64)>
§steps: u8
§

Path

A trusted contact path: press at the first point, move through the rest and release at the last, for drawing on canvases and other surfaces that read pointer contact. Points are viewport CSS pixels when the element is named and are measured from its padding box, otherwise from the viewport’s top left.

Fields

§element: Option<String>
§points: Vec<(f64, f64)>
§

Fill

Replace an editable element’s contents with text. A password or card field is refused unless secret says the caller means it, and then the text is a secret the caller keeps out of logs.

Fields

§element: String
§text: String
§secret: bool
§

Select

Choose <select> options by value or visible label.

Fields

§element: String
§values: Vec<String>
§

FillFiles

Choose the files of an <input type=file>, by absolute path.

The caller has already checked each path is a regular file it may read; the engine hands those files to the page as a person’s own picker would, dispatching input and change. A path that names no readable regular file, or one the element’s accept refuses, is refused rather than silently dropped.

Fields

§element: String
§paths: Vec<String>
§

Press

A trusted key press, after focusing element when one is named.

Fields

§element: Option<String>
§

Submit

Submit the element’s form through the page’s own validation. A form that sends its data to another site than the page’s is refused unless cross_origin says the caller means it.

Fields

§element: String
§cross_origin: bool
§

Changes

What changed in the outline since this tab’s last read or changes: lines added (+) and removed (-), or the whole outline when the document is new.

Fields

§

At

The element a click at viewport point (x, y) in CSS pixels would hit, and the nearest interactive element holding it.

Fields

§

Settle

Wait until the document has stopped changing for quiet_ms and has loaded, or timeout_ms passed.

Fields

§quiet_ms: u32
§timeout_ms: u32
§

Console

Console messages and uncaught errors after sequence number since.

Fields

§since: u64
§

Network

Network requests after sequence number since: method, URL, type, status and failure, never headers, bodies or cookies.

Fields

§since: u64
§

Reader

Show the document’s article alone in a reading layout (enabled), or put the page back as it was. A page without an article is refused.

Fields

§enabled: bool
§

Capture

A picture of the page as it is shown: the box of element when one is named, the viewport otherwise, at most max_width pixels wide. A page can say things no outline reaches, and this is how they are seen. Captured by the engine itself, so the page cannot see or answer it. What the picture shows is page content: never trusted as instructions.

Fields

§element: Option<String>
§max_width: Option<u32>
§

Find

The element a stable description names: the same role and name a person reads on it, wherever the document sits in its history.

Every other request addresses an element by the ref one outline printed, and a ref belongs to one document. This one reads the page it is asked of, so a description recorded once is answered with the ref of the page as it is now: what a step replaying a person’s work needs.

Fields

§

Pointer

Move the pointer over the page as a hand does: steps in order, a press and release of button where the page asks for one. A step naming element is placed in that element’s box, every other step is a viewport position in CSS pixels. All of it is real input to the page, so hover, drag and drop and drawing see what a person’s hand would have done, and the reply reports what changed.

Fields

§

Scroll

Turn the page’s wheel as a hand does: by CSS pixels down (or up, when negative) at the element’s visible centre, or at the viewport’s when no element is named. to names an end of the page instead, and into_view an element to bring into view. The wheel is real input, so the page’s scroll listeners, lazy loading and intersection observers run as they do for a person, and the reply reports what changed.

Fields

§element: Option<String>
§into_view: Option<String>

Implementations§

§

impl PageRequest

pub const fn action(&self) -> &'static str

pub const fn enters_text(&self) -> bool

Whether the request writes text into the page’s focused field: a fill, or keys pressed. Which field that is, and so whether what it wrote is a credential, is the field’s type, read as it settles.

pub const fn only_observes(&self) -> bool

Whether the request only looks at the page, as any visitor can: it reads the document, its picture, its messages or its requests, or waits for it, and the page sees none of it. Everything else acts on the page: it moves the pointer, types, scrolls, submits or changes how the page is shown.

pub fn described(&self) -> String

What the request does, in the words an answer that a dialog it opened cut short repeats: Clicked element d1e5, Submitted form d1e7.

pub fn element(&self) -> Option<&str>

pub fn frame(&self) -> Option<&FrameId>

The frame’s document this request runs in, or the main document’s.

pub fn main_frame(self) -> PageRequest

The same request run in the main document again.

pub fn frame_valid(&self) -> bool

Whether this request names a frame the page outline could have printed. A caller that makes one up is refused, never silently run against the main document instead.

pub fn valid(&self) -> bool

Whether every field is within the bounds an engine accepts.

Trait Implementations§

§

impl Clone for PageRequest

§

fn clone(&self) -> PageRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PageRequest

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for PageRequest

§

fn eq(&self, other: &PageRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for PageRequest

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> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

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

§

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> CommonTraits for T
where T: AsAny + Any + Debug + WasmNotSendSync,

§

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,