@@ -76,7 +76,7 @@ use rw_stream_sink::RwStreamSink;
7676/// # #[async_std::main]
7777/// # async fn main() {
7878///
79- /// let mut transport = websocket::WsConfig ::new(
79+ /// let mut transport = websocket::Config ::new(
8080/// dns::async_std::Transport::system(tcp::async_io::Transport::new(tcp::Config::default()))
8181/// .await
8282/// .unwrap(),
@@ -117,7 +117,7 @@ use rw_stream_sink::RwStreamSink;
117117/// # async fn main() {
118118///
119119/// let mut transport =
120- /// websocket::WsConfig ::new(tcp::async_io::Transport::new(tcp::Config::default()));
120+ /// websocket::Config ::new(tcp::async_io::Transport::new(tcp::Config::default()));
121121///
122122/// let id = transport
123123/// .listen_on(
@@ -134,16 +134,19 @@ use rw_stream_sink::RwStreamSink;
134134///
135135/// # }
136136/// ```
137+ #[ deprecated = "Use `Config` instead" ]
138+ pub type WsConfig < Transport > = Config < Transport > ;
139+
137140#[ derive( Debug ) ]
138- pub struct WsConfig < T : Transport >
141+ pub struct Config < T : Transport >
139142where
140143 T : Transport ,
141144 T :: Output : AsyncRead + AsyncWrite + Send + Unpin + ' static ,
142145{
143- transport : libp2p_core:: transport:: map:: Map < framed:: WsConfig < T > , WrapperFn < T :: Output > > ,
146+ transport : libp2p_core:: transport:: map:: Map < framed:: Config < T > , WrapperFn < T :: Output > > ,
144147}
145148
146- impl < T : Transport > WsConfig < T >
149+ impl < T : Transport > Config < T >
147150where
148151 T : Transport + Send + Unpin + ' static ,
149152 T :: Error : Send + ' static ,
@@ -161,8 +164,7 @@ where
161164 /// > the inner transport.
162165 pub fn new ( transport : T ) -> Self {
163166 Self {
164- transport : framed:: WsConfig :: new ( transport)
165- . map ( wrap_connection as WrapperFn < T :: Output > ) ,
167+ transport : framed:: Config :: new ( transport) . map ( wrap_connection as WrapperFn < T :: Output > ) ,
166168 }
167169 }
168170
@@ -195,7 +197,7 @@ where
195197 }
196198}
197199
198- impl < T > Transport for WsConfig < T >
200+ impl < T > Transport for Config < T >
199201where
200202 T : Transport + Send + Unpin + ' static ,
201203 T :: Error : Send + ' static ,
@@ -236,7 +238,7 @@ where
236238 }
237239}
238240
239- /// Type alias corresponding to `framed::WsConfig ::Dial` and `framed::WsConfig ::ListenerUpgrade`.
241+ /// Type alias corresponding to `framed::Config ::Dial` and `framed::Config ::ListenerUpgrade`.
240242pub type InnerFuture < T , E > = BoxFuture < ' static , Result < Connection < T > , Error < E > > > ;
241243
242244/// Function type that wraps a websocket connection (see. `wrap_connection`).
@@ -310,7 +312,7 @@ mod tests {
310312 use libp2p_identity:: PeerId ;
311313 use libp2p_tcp as tcp;
312314
313- use super :: WsConfig ;
315+ use super :: Config ;
314316
315317 #[ test]
316318 fn dialer_connects_to_listener_ipv4 ( ) {
@@ -324,8 +326,8 @@ mod tests {
324326 futures:: executor:: block_on ( connect ( a) )
325327 }
326328
327- fn new_ws_config ( ) -> WsConfig < tcp:: async_io:: Transport > {
328- WsConfig :: new ( tcp:: async_io:: Transport :: new ( tcp:: Config :: default ( ) ) )
329+ fn new_ws_config ( ) -> Config < tcp:: async_io:: Transport > {
330+ Config :: new ( tcp:: async_io:: Transport :: new ( tcp:: Config :: default ( ) ) )
329331 }
330332
331333 async fn connect ( listen_addr : Multiaddr ) {
0 commit comments