Skip to main content

BrowserService

Struct BrowserService 

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

Cloneable command handle for the one authoritative browser worker.

Implementations§

Source§

impl BrowserService

Source

pub fn new(root: impl AsRef<Path>) -> DevelopmentResult<Self>

Create a resident browser worker with the development policy.

Source

pub fn new_with_policy( root: impl AsRef<Path>, policy_preset: PolicyPreset, ) -> DevelopmentResult<Self>

Create a resident browser worker with an explicit authorization preset.

Source

pub fn start(&self, config: BrowserStartConfig) -> DevelopmentResult<Value>

Start a browser session; fails if one is already connected.

Source

pub fn stop(&self) -> DevelopmentResult<Value>

Stop the session and revoke any remote view.

Source

pub fn reconnect(&self) -> DevelopmentResult<Value>

Restart using the most recent start configuration.

Source

pub fn state(&self) -> DevelopmentResult<Value>

Return connection, workflow, and latest revision state.

Source

pub fn observe(&self) -> DevelopmentResult<Value>

Capture a fresh observation and advance the worker’s known revision.

Source

pub fn snapshot(&self) -> DevelopmentResult<Value>

Capture the session’s current snapshot without forcing a fresh observe.

Source

pub fn semantic( &self, level: SemanticObservationLevel, ) -> DevelopmentResult<Value>

Capture semantic observations at the requested level.

Source

pub fn web_ir(&self) -> DevelopmentResult<Value>

Extract the current page into a bounded Web IR inspection summary.

Source

pub fn diff(&self) -> DevelopmentResult<Value>

Return the observation delta since the session’s previous revision.

Source

pub fn targets(&self) -> DevelopmentResult<Value>

List browser targets.

Source

pub fn select_target(&self, target: String) -> DevelopmentResult<Value>

Select a target and return a fresh observation for it.

Source

pub fn navigate( &self, url: String, expected_revision: u64, timeout: Duration, ) -> DevelopmentResult<Value>

Navigate if expected_revision still matches; timeout bounds navigation.

Source

pub fn back(&self, expected_revision: u64) -> DevelopmentResult<Value>

Go back if the supplied observation revision is current.

Source

pub fn forward(&self, expected_revision: u64) -> DevelopmentResult<Value>

Go forward if the supplied observation revision is current.

Source

pub fn reload(&self, expected_revision: u64) -> DevelopmentResult<Value>

Reload if the supplied observation revision is current.

Source

pub fn stop_loading(&self, expected_revision: u64) -> DevelopmentResult<Value>

Stop loading if the supplied observation revision is current.

Source

pub fn highlight( &self, target: String, expected_revision: u64, ) -> DevelopmentResult<Value>

Highlight a target if the supplied observation revision is current.

Source

pub fn click( &self, target: String, expected_revision: u64, ) -> DevelopmentResult<Value>

Click a target if the supplied observation revision is current.

Source

pub fn type_text( &self, text: String, target: Option<String>, expected_revision: u64, ) -> DevelopmentResult<Value>

Type text into the selected or explicit target at the current revision.

Source

pub fn scroll( &self, dx: f64, dy: f64, expected_revision: u64, ) -> DevelopmentResult<Value>

Scroll by the requested delta at the current observation revision.

Source

pub fn screenshot(&self) -> DevelopmentResult<Value>

Capture a screenshot of the connected browser.

Source

pub fn run_workflow( &self, definition: Value, inputs: BTreeMap<String, Value>, ) -> DevelopmentResult<Value>

Start a workflow from its JSON definition and named inputs.

Source

pub fn pause_workflow(&self) -> DevelopmentResult<Value>

Pause the active workflow and retain its checkpoint.

Source

pub fn resume_workflow( &self, definition: Value, inputs: BTreeMap<String, Value>, checkpoint: Value, ) -> DevelopmentResult<Value>

Resume a workflow from a caller-provided checkpoint.

Source

pub fn list_workflows(&self) -> DevelopmentResult<Value>

List workflow definitions known to the connected session.

Source

pub fn cancel_workflow(&self) -> DevelopmentResult<Value>

Cancel the active workflow.

Source

pub fn verify_workflow(&self) -> DevelopmentResult<Value>

Verify the active workflow’s completion conditions.

Source

pub fn verify_predicate( &self, predicate: VerificationPredicate, timeout: Duration, ) -> DevelopmentResult<Value>

Evaluate a causal verification predicate against the live page.

Source

pub fn open_remote_view(&self) -> DevelopmentResult<Value>

Open a remote-view capability for the connected browser.

Source

pub fn remote_view_status(&self) -> DevelopmentResult<Value>

Return remote-view status and current capability state.

Source

pub fn revoke_remote_view(&self) -> DevelopmentResult<Value>

Revoke the remote-view capability.

Trait Implementations§

Source§

impl Clone for BrowserService

Source§

fn clone(&self) -> Self

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

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

Source§

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

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

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

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

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

Source§

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further 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.

Source§

impl<T> Instrument for T

Source§

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

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

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

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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