File tree Expand file tree Collapse file tree 8 files changed +55
-6
lines changed
Expand file tree Collapse file tree 8 files changed +55
-6
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ members = [
110110[workspace .dependencies ]
111111embassy-futures = { version = " 0.1.2" , default-features = false }
112112embassy-sync = { version = " 0.7" , default-features = false }
113- embassy-time = { version = " 0.4 " , default-features = false }
114- embedded-io-async = { version = " 0.6 " , default-features = false }
113+ embassy-time = { version = " 0.5 " , default-features = false }
114+ embedded-io-async = { version = " 0.7 " , default-features = false }
115115embedded-svc = { version = " 0.28" , default-features = false }
116116heapless = { version = " 0.8" , default-features = false }
117117domain = { version = " 0.10" , default-features = false , features = [" heapless" ] }
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ impl<E> From<UpgradeError> for Error<E> {
8282 }
8383}
8484
85+ impl < E : embedded_io_async:: Error > core:: error:: Error for Error < E > { }
86+
8587impl < E > embedded_io_async:: Error for Error < E >
8688where
8789 E : embedded_io_async:: Error ,
Original file line number Diff line number Diff line change @@ -584,10 +584,15 @@ where
584584 }
585585}
586586
587+ impl < C : Debug + embedded_io_async:: Error , E : Debug + Display > core:: error:: Error
588+ for HandleRequestError < C , E >
589+ {
590+ }
591+
587592impl < C , E > embedded_io_async:: Error for HandleRequestError < C , E >
588593where
589594 C : Debug + embedded_io_async:: Error ,
590- E : Debug ,
595+ E : Debug + Display ,
591596{
592597 fn kind ( & self ) -> embedded_io_async:: ErrorKind {
593598 match self {
Original file line number Diff line number Diff line change 1+ use core:: fmt;
12use core:: net:: IpAddr ;
23
34use edge_nal:: AddrType ;
@@ -65,6 +66,14 @@ impl From<Error> for DnsError {
6566 }
6667}
6768
69+ impl fmt:: Display for DnsError {
70+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
71+ write ! ( f, "{:?}" , self . 0 )
72+ }
73+ }
74+
75+ impl core:: error:: Error for DnsError { }
76+
6877impl embedded_io_async:: Error for DnsError {
6978 fn kind ( & self ) -> ErrorKind {
7079 ErrorKind :: Other
Original file line number Diff line number Diff line change 1+ use core:: fmt;
12use core:: net:: SocketAddr ;
23use core:: pin:: pin;
34use core:: ptr:: NonNull ;
@@ -327,6 +328,20 @@ impl From<AcceptError> for TcpError {
327328 }
328329}
329330
331+ impl fmt:: Display for TcpError {
332+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
333+ match self {
334+ Self :: General ( e) => write ! ( f, "General: {:?}" , e) ,
335+ Self :: Connect ( e) => write ! ( f, "Connect: {:?}" , e) ,
336+ Self :: Accept ( e) => write ! ( f, "Accept: {:?}" , e) ,
337+ Self :: NoBuffers => write ! ( f, "No buffers" ) ,
338+ Self :: UnsupportedProto => write ! ( f, "Unsupported protocol" ) ,
339+ }
340+ }
341+ }
342+
343+ impl core:: error:: Error for TcpError { }
344+
330345impl embedded_io_async:: Error for TcpError {
331346 fn kind ( & self ) -> ErrorKind {
332347 match self {
Original file line number Diff line number Diff line change 1+ use core:: fmt;
12use core:: net:: { Ipv4Addr , Ipv6Addr , SocketAddr } ;
23use core:: ptr:: NonNull ;
34
@@ -340,6 +341,22 @@ impl From<embassy_net::MulticastError> for UdpError {
340341 }
341342}
342343
344+ impl fmt:: Display for UdpError {
345+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
346+ match self {
347+ Self :: Recv ( e) => write ! ( f, "Receiver: {:?}" , e) ,
348+ Self :: Send ( e) => write ! ( f, "Sender: {:?}" , e) ,
349+ Self :: Bind ( e) => write ! ( f, "Binder: {:?}" , e) ,
350+ Self :: MulticastGroupTableFull => write ! ( f, "Multicast group table full" ) ,
351+ Self :: MulticastUnaddressable => write ! ( f, "Multicast unaddressable" ) ,
352+ Self :: NoBuffers => write ! ( f, "No buffers" ) ,
353+ Self :: UnsupportedProto => write ! ( f, "Unsupported protocol" ) ,
354+ }
355+ }
356+ }
357+
358+ impl core:: error:: Error for UdpError { }
359+
343360impl embedded_io_async:: Error for UdpError {
344361 fn kind ( & self ) -> ErrorKind {
345362 match self {
Original file line number Diff line number Diff line change 4545 }
4646}
4747
48+ impl < E : embedded_io_async:: Error > core:: error:: Error for WithTimeoutError < E > { }
49+
4850impl < E > embedded_io_async:: Error for WithTimeoutError < E >
4951where
5052 E : embedded_io_async:: Error ,
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ impl<E> From<raw::Error> for Error<E> {
2222 }
2323}
2424
25+ impl < E : embedded_io_async:: Error > core:: error:: Error for Error < E > { }
26+
2527impl < E > embedded_io_async:: Error for Error < E >
2628where
2729 E : embedded_io_async:: Error ,
6264 }
6365}
6466
65- #[ cfg( feature = "std" ) ]
66- impl < E > std:: error:: Error for Error < E > where E : std:: error:: Error { }
67-
6867/// A utility struct allowing to send and receive UDP packets over a raw socket.
6968///
7069/// The major difference between this struct and a regular `UdpSend` and `UdpReceive` pair of UDP socket halves
You can’t perform that action at this time.
0 commit comments