pub struct CdpSession { /* private fields */ }Expand description
CDP client session. Holds a WebSocket connection and tracks enabled domains.
Implementations§
Source§impl CdpSession
impl CdpSession
pub fn new( session_id: String, target_id: String, ws: WebSocket<ReplayStream>, is_browser_session: bool, ) -> Self
pub fn session_id(&self) -> &str
pub fn target_id(&self) -> &str
pub fn state(&self) -> SessionState
pub fn is_browser_session(&self) -> bool
pub fn has_domain_enabled(&self, domain: &str) -> bool
Sourcepub fn process(
&mut self,
registry: &SharedRegistry,
event_sender: &dyn EventSender,
) -> Result<(), SessionError>
pub fn process( &mut self, registry: &SharedRegistry, event_sender: &dyn EventSender, ) -> Result<(), SessionError>
Process one incoming WebSocket message. Returns Err on disconnect.
Sourcepub fn send_text(&mut self, data: &str) -> Result<(), SessionError>
pub fn send_text(&mut self, data: &str) -> Result<(), SessionError>
Send raw text over WebSocket.
Sourcepub fn enabled_domains(&self) -> Vec<String>
pub fn enabled_domains(&self) -> Vec<String>
Get all enabled domain names (for on_session_destroyed notification).
Sourcepub fn begin_close(&mut self)
pub fn begin_close(&mut self)
Transition to Closing state.
Auto 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