pub struct BidiClient { /* private fields */ }Implementations§
Source§impl BidiClient
impl BidiClient
pub async fn connect(ws_url: &str) -> Result<Self>
pub async fn send(&self, method: &str, params: Value) -> Result<Value>
pub fn subscribe(&self) -> Receiver<BidiEvent>
Sourcepub async fn close(self)
pub async fn close(self)
Gracefully shut down the transport (flush writer, abort/join reader).
Dropping the client also aborts the tasks via WsRpc’s Drop.
pub async fn session_new(&self) -> Result<String>
pub async fn session_end(&self) -> Result<()>
Sourcepub async fn browsing_context_create(&self, url: &str) -> Result<String>
pub async fn browsing_context_create(&self, url: &str) -> Result<String>
browsingContext.create({type: "tab"}) — opens a fresh top-level
browsing context. If url is non-empty, navigates after create so
the returned context lands at the desired URL.
Sourcepub async fn browsing_context_close(&self, context: &str) -> Result<()>
pub async fn browsing_context_close(&self, context: &str) -> Result<()>
browsingContext.close({context}). Idempotent against an already-
closed context (BiDi returns an error but the caller’s intent is
satisfied).
Sourcepub async fn browsing_context_ids(&self) -> Result<HashSet<String>>
pub async fn browsing_context_ids(&self) -> Result<HashSet<String>>
browsingContext.getTree() flattened to a set of all live top-level
context ids. Used by the engine-agnostic tab registry for
sweep-on-read.
pub async fn script_evaluate( &self, context: &str, expression: &str, ) -> Result<Value>
Sourcepub async fn script_call_function(
&self,
context: &str,
function_declaration: &str,
args: Vec<Value>,
) -> Result<Value>
pub async fn script_call_function( &self, context: &str, function_declaration: &str, args: Vec<Value>, ) -> Result<Value>
script.callFunction in the context’s default realm. args are
plain JSON primitives (string / number / boolean / null) converted to
BiDi LocalValues. A {type:"exception"} result becomes an error
carrying exceptionDetails.text; otherwise the RemoteValue result
is returned.
Sourcepub async fn input_perform_actions(
&self,
context: &str,
actions: Value,
) -> Result<()>
pub async fn input_perform_actions( &self, context: &str, actions: Value, ) -> Result<()>
input.performActions with a prebuilt actions array.
Sourcepub async fn input_release_actions(&self, context: &str) -> Result<()>
pub async fn input_release_actions(&self, context: &str) -> Result<()>
input.releaseActions: release any pressed keys / buttons.
Auto Trait Implementations§
impl !Freeze for BidiClient
impl !RefUnwindSafe for BidiClient
impl !UnwindSafe for BidiClient
impl Send for BidiClient
impl Sync for BidiClient
impl Unpin for BidiClient
impl UnsafeUnpin for BidiClient
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
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