Skip to main content

ChannelType

Trait ChannelType 

Source
pub trait ChannelType:
    Sized
    + Clone
    + Send
    + Sync
    + 'static {
    type Initializer: DeserializeOwned;
    type Event: ProtocolEvent;

    const INTERFACE: &'static str;

    // Required methods
    fn accepts(interface: &str) -> bool;
    fn from_channel(channel: Channel) -> Self;
    fn channel(&self) -> &Channel;

    // Provided methods
    fn guid(&self) -> &str { ... }
    fn initializer(&self) -> Result<Self::Initializer, ProtocolError> { ... }
    fn events(&self) -> EventStream<Self::Event> { ... }
}
Expand description

A generated channel type (one per protocol interface).

Required Associated Constants§

Source

const INTERFACE: &'static str

Interface name in the spec.

Required Associated Types§

Source

type Initializer: DeserializeOwned

The initializer the driver sends in __create__.

Source

type Event: ProtocolEvent

The events the interface can emit.

Required Methods§

Source

fn accepts(interface: &str) -> bool

Whether an object of interface can be used as this type (an ElementHandle is also a JSHandle).

Source

fn from_channel(channel: Channel) -> Self

Wrap a channel.

Source

fn channel(&self) -> &Channel

The underlying channel.

Provided Methods§

Source

fn guid(&self) -> &str

The object’s guid.

Source

fn initializer(&self) -> Result<Self::Initializer, ProtocolError>

The typed initializer the driver created this object with.

Source

fn events(&self) -> EventStream<Self::Event>

Subscribe to this object’s events from now on.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ChannelType for APIRequestContext

Source§

impl ChannelType for Android

Source§

impl ChannelType for AndroidDevice

Source§

impl ChannelType for AndroidSocket

Source§

impl ChannelType for Artifact

Source§

impl ChannelType for BindingCall

Source§

impl ChannelType for Browser

Source§

impl ChannelType for BrowserContext

Source§

impl ChannelType for BrowserType

Source§

impl ChannelType for CDPSession

Source§

impl ChannelType for DebugController

Source§

impl ChannelType for Debugger

Source§

impl ChannelType for Dialog

Source§

impl ChannelType for Disposable

Source§

impl ChannelType for Electron

Source§

impl ChannelType for ElectronApplication

Source§

impl ChannelType for ElementHandle

Source§

impl ChannelType for Frame

Source§

impl ChannelType for JSHandle

Source§

impl ChannelType for JsonPipe

Source§

impl ChannelType for LocalUtils

Source§

impl ChannelType for Page

Source§

impl ChannelType for Playwright

Source§

impl ChannelType for Request

Source§

impl ChannelType for Response

Source§

impl ChannelType for Root

Source§

impl ChannelType for Route

Source§

impl ChannelType for SocksSupport

Source§

impl ChannelType for Stream

Source§

impl ChannelType for Tracing

Source§

impl ChannelType for WebSocket

Source§

impl ChannelType for WebSocketRoute

Source§

impl ChannelType for Worker

Source§

impl ChannelType for WritableStream