11use embedded_io_async:: { Read , Write } ;
22use framez:: state:: { ReadState , WriteState } ;
3- use rand :: RngCore ;
3+ use rand_core :: Rng ;
44
55use crate :: {
66 ConnectionState , Frame , Message , OnFrame , WebSocketCore ,
@@ -14,10 +14,10 @@ pub struct ReadAutoCaller;
1414
1515impl ReadAutoCaller {
1616 #[ allow( clippy:: too_many_arguments) ]
17- pub async fn call < ' this , F , RW , Rng > (
17+ pub async fn call < ' this , F , RW , RNG > (
1818 & self ,
1919 auto : F ,
20- codec : & mut FramesCodec < Rng > ,
20+ codec : & mut FramesCodec < RNG > ,
2121 inner : & mut RW ,
2222 read_state : & ' this mut ReadState < ' _ > ,
2323 write_state : & mut WriteState < ' _ > ,
@@ -26,7 +26,7 @@ impl ReadAutoCaller {
2626 ) -> Option < Result < Option < Message < ' this > > , Error < RW :: Error > > >
2727 where
2828 RW : Read + Write ,
29- Rng : RngCore ,
29+ RNG : Rng ,
3030 F : FnOnce ( Frame < ' _ > ) -> Result < OnFrame < ' _ > , ProtocolError > + ' static ,
3131 {
3232 let frame = match framez:: functions:: maybe_next ( read_state, codec, inner) . await {
@@ -54,7 +54,7 @@ impl ReadAutoCaller {
5454 Err ( err) => return Some ( Err ( Error :: Read ( ReadError :: Protocol ( err) ) ) ) ,
5555 } ;
5656
57- WebSocketCore :: < RW , Rng > :: on_frame ( fragments_state, frame)
57+ WebSocketCore :: < RW , RNG > :: on_frame ( fragments_state, frame)
5858 . map ( |result| result. map_err ( Error :: from) )
5959 }
6060}
@@ -64,10 +64,10 @@ pub struct ReadCaller;
6464
6565impl ReadCaller {
6666 #[ allow( clippy:: too_many_arguments) ]
67- pub async fn call < ' this , RW , Rng > (
67+ pub async fn call < ' this , RW , RNG > (
6868 & self ,
6969 _auto : ( ) ,
70- codec : & mut FramesCodec < Rng > ,
70+ codec : & mut FramesCodec < RNG > ,
7171 inner : & mut RW ,
7272 read_state : & ' this mut ReadState < ' _ > ,
7373 _write_state : & mut WriteState < ' _ > ,
@@ -84,21 +84,21 @@ impl ReadCaller {
8484 None => return None ,
8585 } ;
8686
87- WebSocketCore :: < RW , Rng > :: on_frame ( fragments_state, frame)
87+ WebSocketCore :: < RW , RNG > :: on_frame ( fragments_state, frame)
8888 . map ( |result| result. map_err ( Error :: from) )
8989 }
9090}
9191
92- pub async fn send < RW , Rng > (
93- codec : & mut FramesCodec < Rng > ,
92+ pub async fn send < RW , RNG > (
93+ codec : & mut FramesCodec < RNG > ,
9494 inner : & mut RW ,
9595 write_state : & mut WriteState < ' _ > ,
9696 state : & mut ConnectionState ,
9797 message : Message < ' _ > ,
9898) -> Result < ( ) , Error < RW :: Error > >
9999where
100100 RW : Write ,
101- Rng : RngCore ,
101+ RNG : Rng ,
102102{
103103 if state. closed {
104104 return Err ( Error :: Write ( WriteError :: ConnectionClosed ) ) ;
@@ -113,8 +113,8 @@ where
113113 Ok ( ( ) )
114114}
115115
116- pub async fn send_fragmented < RW , Rng > (
117- codec : & mut FramesCodec < Rng > ,
116+ pub async fn send_fragmented < RW , RNG > (
117+ codec : & mut FramesCodec < RNG > ,
118118 inner : & mut RW ,
119119 write_state : & mut WriteState < ' _ > ,
120120 state : & mut ConnectionState ,
@@ -123,7 +123,7 @@ pub async fn send_fragmented<RW, Rng>(
123123) -> Result < ( ) , Error < RW :: Error > >
124124where
125125 RW : Write ,
126- Rng : RngCore ,
126+ RNG : Rng ,
127127{
128128 if state. closed {
129129 return Err ( Error :: Write ( WriteError :: ConnectionClosed ) ) ;
0 commit comments