pub struct CdpSession {
ws: WebSocketStream<MaybeTlsStream<TcpStream>>,
next_id: u64,
}Fields§
§ws: WebSocketStream<MaybeTlsStream<TcpStream>>§next_id: u64Implementations§
Source§impl CdpSession
impl CdpSession
Sourcepub async fn connect(ws_url: &str) -> Result<Self, String>
pub async fn connect(ws_url: &str) -> Result<Self, String>
Open a CDP session against ws://127.0.0.1:<port>/devtools/page/<target>.
Sourcepub async fn call(
&mut self,
method: &str,
params: Value,
) -> Result<Value, String>
pub async fn call( &mut self, method: &str, params: Value, ) -> Result<Value, String>
Send {id, method, params} and wait for the reply with the
same id. Events (no id) and unrelated replies are silently
discarded — v1 doesn’t multiplex.
pub async fn close(self)
Auto Trait Implementations§
impl !Freeze for CdpSession
impl !RefUnwindSafe for CdpSession
impl Send for CdpSession
impl Sync for CdpSession
impl Unpin for CdpSession
impl !UnwindSafe for CdpSession
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<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.