11//! Contains the parsing methods for the errors of the current transports.
22use std:: { io, net:: AddrParseError } ;
33
4- #[ cfg( feature = "quic" ) ]
5- use quinn:: { ConnectError , ConnectionError , WriteError } ;
6- #[ cfg( feature = "websockets" ) ]
7- use tokio_tungstenite:: tungstenite;
8-
94use super :: TransportError ;
105
116impl From < io:: Error > for TransportError {
@@ -14,41 +9,8 @@ impl From<io::Error> for TransportError {
149 }
1510}
1611
17- #[ cfg( feature = "quic" ) ]
18- impl From < ConnectError > for TransportError {
19- fn from ( value : ConnectError ) -> Self {
20- TransportError :: Internal ( Box :: new ( value) )
21- }
22- }
23-
24- #[ cfg( feature = "quic" ) ]
25- impl From < ConnectionError > for TransportError {
26- fn from ( value : ConnectionError ) -> Self {
27- TransportError :: Internal ( Box :: new ( value) )
28- }
29- }
30-
3112impl From < AddrParseError > for TransportError {
3213 fn from ( value : AddrParseError ) -> Self {
3314 TransportError :: Internal ( Box :: new ( value) )
3415 }
3516}
36-
37- #[ cfg( feature = "quic" ) ]
38- impl From < WriteError > for TransportError {
39- fn from ( value : WriteError ) -> Self {
40- match value {
41- WriteError :: ZeroRttRejected => {
42- TransportError :: Internal ( Box :: new ( WriteError :: ZeroRttRejected ) )
43- }
44- _ => TransportError :: Closed ,
45- }
46- }
47- }
48-
49- #[ cfg( feature = "websockets" ) ]
50- impl From < tungstenite:: Error > for TransportError {
51- fn from ( value : tungstenite:: Error ) -> Self {
52- TransportError :: Internal ( Box :: new ( value) )
53- }
54- }
0 commit comments