pub struct RemoteHandle { /* private fields */ }Expand description
A Puppeteer object that lives in the server, such as a Page.
Handles are cheap to clone; every clone names the same object. The generated wrappers hold one each.
Implementations§
Source§impl RemoteHandle
impl RemoteHandle
Sourcepub fn client(&self) -> &BridgeClient
pub fn client(&self) -> &BridgeClient
The bridge the object lives in.
Sourcepub async fn call<T: FromWire>(
&self,
method: &str,
args: Vec<Option<Value>>,
) -> Result<T, BridgeError>
pub async fn call<T: FromWire>( &self, method: &str, args: Vec<Option<Value>>, ) -> Result<T, BridgeError>
handle.call: call a method. None arguments are sent as
undefined; trailing ones are left out, as JavaScript does.
Sourcepub async fn get<T: FromWire>(&self, property: &str) -> Result<T, BridgeError>
pub async fn get<T: FromWire>(&self, property: &str) -> Result<T, BridgeError>
handle.get: read a property (awaited when it is a promise).
Sourcepub async fn describe(&self) -> Result<Value, BridgeError>
pub async fn describe(&self) -> Result<Value, BridgeError>
handle.describe: the object’s type and member names.
Sourcepub async fn release(&self) -> Result<(), BridgeError>
pub async fn release(&self) -> Result<(), BridgeError>
handle.dispose: forget the handle on the server. The object itself
stays alive; dispose a JS handle with its own dispose() method.
Sourcepub async fn subscribe(&self, event: &str) -> Result<Subscription, BridgeError>
pub async fn subscribe(&self, event: &str) -> Result<Subscription, BridgeError>
events.subscribe: receive the arguments of every event the object
emits until the Subscription is closed or dropped.
Trait Implementations§
Source§impl Clone for RemoteHandle
impl Clone for RemoteHandle
Source§impl Debug for RemoteHandle
impl Debug for RemoteHandle
Source§impl FromWire for RemoteHandle
impl FromWire for RemoteHandle
Source§fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
Convert, failing with
BridgeError::Decode on a type mismatch.Auto Trait Implementations§
impl !RefUnwindSafe for RemoteHandle
impl !UnwindSafe for RemoteHandle
impl Freeze for RemoteHandle
impl Send for RemoteHandle
impl Sync for RemoteHandle
impl Unpin for RemoteHandle
impl UnsafeUnpin for RemoteHandle
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
Mutably borrows from an owned value. Read more
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>
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>
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)
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)
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
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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 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> ⓘ
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