pub struct WebSocketConnector { /* private fields */ }Expand description
WebSocket transport for outgoing connections using the browser’s WebSocket API.
This transport is packet-based.
Implementations§
Source§impl WebSocketConnector
impl WebSocketConnector
Sourcepub async fn new(
urls: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<Self>
pub async fn new( urls: impl IntoIterator<Item = impl AsRef<str>>, ) -> Result<Self>
Create a new WebSocket transport for outgoing connections.
urls contains one or more WebSocket URLs of the target.
Name resolution and certificate validation is handled by the browser.
Sourcepub fn set_cfg(
&mut self,
cfg_fn: impl Fn(&mut WebSocketBuilder) + Send + Sync + 'static,
)
pub fn set_cfg( &mut self, cfg_fn: impl Fn(&mut WebSocketBuilder) + Send + Sync + 'static, )
Sets the configuration function that is applied to each WebSocket builder before it is connected.
Trait Implementations§
Source§impl Clone for WebSocketConnector
impl Clone for WebSocketConnector
Source§fn clone(&self) -> WebSocketConnector
fn clone(&self) -> WebSocketConnector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConnectingTransport for WebSocketConnector
impl ConnectingTransport for WebSocketConnector
Discovers link tags for connecting. Read more
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 dyn LinkTag,
) -> Pin<Box<dyn Future<Output = Result<StreamBox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 dyn LinkTag,
) -> Pin<Box<dyn Future<Output = Result<StreamBox>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Connects a link tag.
Source§fn link_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_new: &'life1 Link<Box<dyn LinkTag>>,
_existing: &'life2 [Link<Box<dyn LinkTag>>],
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn link_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_new: &'life1 Link<Box<dyn LinkTag>>,
_existing: &'life2 [Link<Box<dyn LinkTag>>],
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Checks whether a new link can be added given existing links.
Source§fn connected_links<'life0, 'life1, 'async_trait>(
&'life0 self,
_links: &'life1 [Link<Box<dyn LinkTag>>],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn connected_links<'life0, 'life1, 'async_trait>(
&'life0 self,
_links: &'life1 [Link<Box<dyn LinkTag>>],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Notifies the transport of all currently connected links of the connection. Read more
Source§impl Debug for WebSocketConnector
impl Debug for WebSocketConnector
Auto Trait Implementations§
impl Freeze for WebSocketConnector
impl !RefUnwindSafe for WebSocketConnector
impl Send for WebSocketConnector
impl Sync for WebSocketConnector
impl Unpin for WebSocketConnector
impl !UnwindSafe for WebSocketConnector
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