pub struct JsHandle { /* private fields */ }Expand description
A handle to a JavaScript object in the page context.
Handles are useful for referencing complex objects that cannot be serialized (like DOM elements). Remember to dispose of handles when done.
Implementations§
Source§impl JsHandle
impl JsHandle
Sourcepub async fn json_value<T: DeserializeOwned>(&self) -> Result<T, PageError>
pub async fn json_value<T: DeserializeOwned>(&self) -> Result<T, PageError>
Get the JSON value of this handle.
§Errors
Returns an error if the object cannot be serialized to JSON.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsHandle
impl !RefUnwindSafe for JsHandle
impl Send for JsHandle
impl Sync for JsHandle
impl Unpin for JsHandle
impl !UnwindSafe for JsHandle
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