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§
Required Associated Types§
Sourcetype Initializer: DeserializeOwned
type Initializer: DeserializeOwned
The initializer the driver sends in __create__.
Sourcetype Event: ProtocolEvent
type Event: ProtocolEvent
The events the interface can emit.
Required Methods§
Sourcefn accepts(interface: &str) -> bool
fn accepts(interface: &str) -> bool
Whether an object of interface can be used as this type (an
ElementHandle is also a JSHandle).
Sourcefn from_channel(channel: Channel) -> Self
fn from_channel(channel: Channel) -> Self
Wrap a channel.
Provided Methods§
Sourcefn initializer(&self) -> Result<Self::Initializer, ProtocolError>
fn initializer(&self) -> Result<Self::Initializer, ProtocolError>
The typed initializer the driver created this object with.
Sourcefn events(&self) -> EventStream<Self::Event>
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".