pub struct BrowserService { /* private fields */ }Expand description
Cloneable command handle for the one authoritative browser worker.
Implementations§
Source§impl BrowserService
impl BrowserService
Sourcepub fn new(root: impl AsRef<Path>) -> DevelopmentResult<Self>
pub fn new(root: impl AsRef<Path>) -> DevelopmentResult<Self>
Create a resident browser worker with the development policy.
Sourcepub fn new_with_policy(
root: impl AsRef<Path>,
policy_preset: PolicyPreset,
) -> DevelopmentResult<Self>
pub fn new_with_policy( root: impl AsRef<Path>, policy_preset: PolicyPreset, ) -> DevelopmentResult<Self>
Create a resident browser worker with an explicit authorization preset.
Sourcepub fn start(&self, config: BrowserStartConfig) -> DevelopmentResult<Value>
pub fn start(&self, config: BrowserStartConfig) -> DevelopmentResult<Value>
Start a browser session; fails if one is already connected.
Sourcepub fn stop(&self) -> DevelopmentResult<Value>
pub fn stop(&self) -> DevelopmentResult<Value>
Stop the session and revoke any remote view.
Sourcepub fn reconnect(&self) -> DevelopmentResult<Value>
pub fn reconnect(&self) -> DevelopmentResult<Value>
Restart using the most recent start configuration.
Sourcepub fn state(&self) -> DevelopmentResult<Value>
pub fn state(&self) -> DevelopmentResult<Value>
Return connection, workflow, and latest revision state.
Sourcepub fn observe(&self) -> DevelopmentResult<Value>
pub fn observe(&self) -> DevelopmentResult<Value>
Capture a fresh observation and advance the worker’s known revision.
Sourcepub fn snapshot(&self) -> DevelopmentResult<Value>
pub fn snapshot(&self) -> DevelopmentResult<Value>
Capture the session’s current snapshot without forcing a fresh observe.
Sourcepub fn semantic(
&self,
level: SemanticObservationLevel,
) -> DevelopmentResult<Value>
pub fn semantic( &self, level: SemanticObservationLevel, ) -> DevelopmentResult<Value>
Capture semantic observations at the requested level.
Sourcepub fn web_ir(&self) -> DevelopmentResult<Value>
pub fn web_ir(&self) -> DevelopmentResult<Value>
Extract the current page into a bounded Web IR inspection summary.
Sourcepub fn diff(&self) -> DevelopmentResult<Value>
pub fn diff(&self) -> DevelopmentResult<Value>
Return the observation delta since the session’s previous revision.
Sourcepub fn targets(&self) -> DevelopmentResult<Value>
pub fn targets(&self) -> DevelopmentResult<Value>
List browser targets.
Sourcepub fn select_target(&self, target: String) -> DevelopmentResult<Value>
pub fn select_target(&self, target: String) -> DevelopmentResult<Value>
Select a target and return a fresh observation for it.
Navigate if expected_revision still matches; timeout bounds navigation.
Sourcepub fn back(&self, expected_revision: u64) -> DevelopmentResult<Value>
pub fn back(&self, expected_revision: u64) -> DevelopmentResult<Value>
Go back if the supplied observation revision is current.
Sourcepub fn forward(&self, expected_revision: u64) -> DevelopmentResult<Value>
pub fn forward(&self, expected_revision: u64) -> DevelopmentResult<Value>
Go forward if the supplied observation revision is current.
Sourcepub fn reload(&self, expected_revision: u64) -> DevelopmentResult<Value>
pub fn reload(&self, expected_revision: u64) -> DevelopmentResult<Value>
Reload if the supplied observation revision is current.
Sourcepub fn stop_loading(&self, expected_revision: u64) -> DevelopmentResult<Value>
pub fn stop_loading(&self, expected_revision: u64) -> DevelopmentResult<Value>
Stop loading if the supplied observation revision is current.
Sourcepub fn highlight(
&self,
target: String,
expected_revision: u64,
) -> DevelopmentResult<Value>
pub fn highlight( &self, target: String, expected_revision: u64, ) -> DevelopmentResult<Value>
Highlight a target if the supplied observation revision is current.
Sourcepub fn click(
&self,
target: String,
expected_revision: u64,
) -> DevelopmentResult<Value>
pub fn click( &self, target: String, expected_revision: u64, ) -> DevelopmentResult<Value>
Click a target if the supplied observation revision is current.
Sourcepub fn type_text(
&self,
text: String,
target: Option<String>,
expected_revision: u64,
) -> DevelopmentResult<Value>
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.
Sourcepub fn scroll(
&self,
dx: f64,
dy: f64,
expected_revision: u64,
) -> DevelopmentResult<Value>
pub fn scroll( &self, dx: f64, dy: f64, expected_revision: u64, ) -> DevelopmentResult<Value>
Scroll by the requested delta at the current observation revision.
Sourcepub fn screenshot(&self) -> DevelopmentResult<Value>
pub fn screenshot(&self) -> DevelopmentResult<Value>
Capture a screenshot of the connected browser.
Sourcepub fn run_workflow(
&self,
definition: Value,
inputs: BTreeMap<String, Value>,
) -> DevelopmentResult<Value>
pub fn run_workflow( &self, definition: Value, inputs: BTreeMap<String, Value>, ) -> DevelopmentResult<Value>
Start a workflow from its JSON definition and named inputs.
Sourcepub fn pause_workflow(&self) -> DevelopmentResult<Value>
pub fn pause_workflow(&self) -> DevelopmentResult<Value>
Pause the active workflow and retain its checkpoint.
Sourcepub fn resume_workflow(
&self,
definition: Value,
inputs: BTreeMap<String, Value>,
checkpoint: Value,
) -> DevelopmentResult<Value>
pub fn resume_workflow( &self, definition: Value, inputs: BTreeMap<String, Value>, checkpoint: Value, ) -> DevelopmentResult<Value>
Resume a workflow from a caller-provided checkpoint.
Sourcepub fn list_workflows(&self) -> DevelopmentResult<Value>
pub fn list_workflows(&self) -> DevelopmentResult<Value>
List workflow definitions known to the connected session.
Sourcepub fn cancel_workflow(&self) -> DevelopmentResult<Value>
pub fn cancel_workflow(&self) -> DevelopmentResult<Value>
Cancel the active workflow.
Sourcepub fn verify_workflow(&self) -> DevelopmentResult<Value>
pub fn verify_workflow(&self) -> DevelopmentResult<Value>
Verify the active workflow’s completion conditions.
Sourcepub fn verify_predicate(
&self,
predicate: VerificationPredicate,
timeout: Duration,
) -> DevelopmentResult<Value>
pub fn verify_predicate( &self, predicate: VerificationPredicate, timeout: Duration, ) -> DevelopmentResult<Value>
Evaluate a causal verification predicate against the live page.
Sourcepub fn open_remote_view(&self) -> DevelopmentResult<Value>
pub fn open_remote_view(&self) -> DevelopmentResult<Value>
Open a remote-view capability for the connected browser.
Sourcepub fn remote_view_status(&self) -> DevelopmentResult<Value>
pub fn remote_view_status(&self) -> DevelopmentResult<Value>
Return remote-view status and current capability state.
Sourcepub fn revoke_remote_view(&self) -> DevelopmentResult<Value>
pub fn revoke_remote_view(&self) -> DevelopmentResult<Value>
Revoke the remote-view capability.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BrowserService
impl RefUnwindSafe for BrowserService
impl Send for BrowserService
impl Sync for BrowserService
impl Unpin for BrowserService
impl UnsafeUnpin for BrowserService
impl UnwindSafe for BrowserService
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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