pub struct ProtocolAdapter { /* private fields */ }Expand description
Unified protocol interface wrapping CDPSession or BiDiSession.
Implementations§
Source§impl ProtocolAdapter
impl ProtocolAdapter
pub fn new( send_tx: UnboundedSender<String>, emitter: SpiderEventEmitter, browser: &str, opts: Option<ProtocolAdapterOptions>, ) -> Self
pub fn protocol_type(&self) -> ProtocolType
Sourcepub fn route_message(&self, data: &str)
pub fn route_message(&self, data: &str)
Route incoming WebSocket messages to the right session.
pub async fn get_html(&self) -> Result<String>
pub async fn evaluate(&self, expression: &str) -> Result<Value>
pub async fn capture_screenshot(&self) -> Result<String>
pub async fn click_point(&self, x: f64, y: f64) -> Result<()>
pub async fn right_click_point(&self, x: f64, y: f64) -> Result<()>
pub async fn double_click_point(&self, x: f64, y: f64) -> Result<()>
pub async fn click_hold_point(&self, x: f64, y: f64, hold_ms: u64) -> Result<()>
pub async fn hover_point(&self, x: f64, y: f64) -> Result<()>
pub async fn drag_point( &self, from_x: f64, from_y: f64, to_x: f64, to_y: f64, ) -> Result<()>
pub async fn insert_text(&self, text: &str) -> Result<()>
pub async fn press_key(&self, key_name: &str) -> Result<()>
pub async fn key_down(&self, key_name: &str) -> Result<()>
pub async fn key_up(&self, key_name: &str) -> Result<()>
pub async fn set_viewport( &self, width: u32, height: u32, dpr: f64, mobile: bool, ) -> Result<()>
pub fn on_protocol_event( &self, method: &str, handler: Arc<dyn Fn(Value) + Send + Sync>, )
pub fn destroy(&self)
Auto Trait Implementations§
impl !Freeze for ProtocolAdapter
impl !RefUnwindSafe for ProtocolAdapter
impl Send for ProtocolAdapter
impl Sync for ProtocolAdapter
impl Unpin for ProtocolAdapter
impl UnsafeUnpin for ProtocolAdapter
impl !UnwindSafe for ProtocolAdapter
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