pub trait ConnectionLike: Send + Sync {
// Required methods
fn send_message(
&self,
guid: &str,
method: &str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>;
fn register_object(
&self,
guid: Arc<str>,
object: Arc<dyn ChannelOwner>,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
fn unregister_object(
&self,
guid: &str,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
fn get_object(
&self,
guid: &str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ChannelOwner>>> + Send + '_>>;
}Expand description
Trait defining the interface that ChannelOwner needs from a Connection
This trait allows ChannelOwner to work with Connection without needing to know the generic parameters W and R. The Connection struct implements this trait.
Required Methods§
Sourcefn send_message(
&self,
guid: &str,
method: &str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>
fn send_message( &self, guid: &str, method: &str, params: Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>
Send a message to the Playwright server and await response
Sourcefn register_object(
&self,
guid: Arc<str>,
object: Arc<dyn ChannelOwner>,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
fn register_object( &self, guid: Arc<str>, object: Arc<dyn ChannelOwner>, ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
Register an object in the connection’s registry
Sourcefn unregister_object(
&self,
guid: &str,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
fn unregister_object( &self, guid: &str, ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
Unregister an object from the connection’s registry
Sourcefn get_object(
&self,
guid: &str,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ChannelOwner>>> + Send + '_>>
fn get_object( &self, guid: &str, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ChannelOwner>>> + Send + '_>>
Get an object by GUID