pub struct CdpSession { /* private fields */ }Expand description
A CDP session bound to a specific target (tab).
Sessions share the parent client’s WebSocket connection but route
commands and events through a sessionId.
Implementations§
Source§impl CdpSession
impl CdpSession
Sourcepub async fn send_command(
&self,
method: &str,
params: Option<Value>,
) -> Result<Value, CdpError>
pub async fn send_command( &self, method: &str, params: Option<Value>, ) -> Result<Value, CdpError>
Send a command within this session’s context.
§Errors
Returns the same errors as CdpClient::send_command.
Sourcepub async fn subscribe(
&self,
method: &str,
) -> Result<Receiver<CdpEvent>, CdpError>
pub async fn subscribe( &self, method: &str, ) -> Result<Receiver<CdpEvent>, CdpError>
Subscribe to events within this session.
§Errors
Returns CdpError::Internal if the transport task has exited.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Get the session ID.
Trait Implementations§
Source§impl Clone for CdpSession
impl Clone for CdpSession
Source§fn clone(&self) -> CdpSession
fn clone(&self) -> CdpSession
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CdpSession
impl RefUnwindSafe for CdpSession
impl Send for CdpSession
impl Sync for CdpSession
impl Unpin for CdpSession
impl UnsafeUnpin 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