diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-08-07 13:43:09 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-07 13:43:09 +0200 |
| commit | 5d5cd2371504915a531e669dce3558485a51a2e1 (patch) | |
| tree | 5d0093e9e5005d3a946e92686a9dc79565c3043f /embassy-net/src | |
| parent | 77844e2055319e1af7dd50fdb2e39ef88c6a5010 (diff) | |
Update to embedded-io 0.5 (#1752)
Diffstat (limited to 'embassy-net/src')
| -rw-r--r-- | embassy-net/src/dns.rs | 2 | ||||
| -rw-r--r-- | embassy-net/src/tcp.rs | 34 |
2 files changed, 18 insertions, 18 deletions
diff --git a/embassy-net/src/dns.rs b/embassy-net/src/dns.rs index 94f75f108..fdd45b314 100644 --- a/embassy-net/src/dns.rs +++ b/embassy-net/src/dns.rs | |||
| @@ -68,7 +68,7 @@ where | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 71 | #[cfg(feature = "nightly")] |
| 72 | impl<'a, D> embedded_nal_async::Dns for DnsSocket<'a, D> | 72 | impl<'a, D> embedded_nal_async::Dns for DnsSocket<'a, D> |
| 73 | where | 73 | where |
| 74 | D: Driver + 'static, | 74 | D: Driver + 'static, |
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs index 367675b13..c903fb245 100644 --- a/embassy-net/src/tcp.rs +++ b/embassy-net/src/tcp.rs | |||
| @@ -382,29 +382,29 @@ impl<'d> TcpIo<'d> { | |||
| 382 | mod embedded_io_impls { | 382 | mod embedded_io_impls { |
| 383 | use super::*; | 383 | use super::*; |
| 384 | 384 | ||
| 385 | impl embedded_io::Error for ConnectError { | 385 | impl embedded_io_async::Error for ConnectError { |
| 386 | fn kind(&self) -> embedded_io::ErrorKind { | 386 | fn kind(&self) -> embedded_io_async::ErrorKind { |
| 387 | embedded_io::ErrorKind::Other | 387 | embedded_io_async::ErrorKind::Other |
| 388 | } | 388 | } |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | impl embedded_io::Error for Error { | 391 | impl embedded_io_async::Error for Error { |
| 392 | fn kind(&self) -> embedded_io::ErrorKind { | 392 | fn kind(&self) -> embedded_io_async::ErrorKind { |
| 393 | embedded_io::ErrorKind::Other | 393 | embedded_io_async::ErrorKind::Other |
| 394 | } | 394 | } |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | impl<'d> embedded_io::Io for TcpSocket<'d> { | 397 | impl<'d> embedded_io_async::ErrorType for TcpSocket<'d> { |
| 398 | type Error = Error; | 398 | type Error = Error; |
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | impl<'d> embedded_io::asynch::Read for TcpSocket<'d> { | 401 | impl<'d> embedded_io_async::Read for TcpSocket<'d> { |
| 402 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 402 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 403 | self.io.read(buf).await | 403 | self.io.read(buf).await |
| 404 | } | 404 | } |
| 405 | } | 405 | } |
| 406 | 406 | ||
| 407 | impl<'d> embedded_io::asynch::Write for TcpSocket<'d> { | 407 | impl<'d> embedded_io_async::Write for TcpSocket<'d> { |
| 408 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 408 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 409 | self.io.write(buf).await | 409 | self.io.write(buf).await |
| 410 | } | 410 | } |
| @@ -414,21 +414,21 @@ mod embedded_io_impls { | |||
| 414 | } | 414 | } |
| 415 | } | 415 | } |
| 416 | 416 | ||
| 417 | impl<'d> embedded_io::Io for TcpReader<'d> { | 417 | impl<'d> embedded_io_async::ErrorType for TcpReader<'d> { |
| 418 | type Error = Error; | 418 | type Error = Error; |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | impl<'d> embedded_io::asynch::Read for TcpReader<'d> { | 421 | impl<'d> embedded_io_async::Read for TcpReader<'d> { |
| 422 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 422 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| 423 | self.io.read(buf).await | 423 | self.io.read(buf).await |
| 424 | } | 424 | } |
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | impl<'d> embedded_io::Io for TcpWriter<'d> { | 427 | impl<'d> embedded_io_async::ErrorType for TcpWriter<'d> { |
| 428 | type Error = Error; | 428 | type Error = Error; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | impl<'d> embedded_io::asynch::Write for TcpWriter<'d> { | 431 | impl<'d> embedded_io_async::Write for TcpWriter<'d> { |
| 432 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 432 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
| 433 | self.io.write(buf).await | 433 | self.io.write(buf).await |
| 434 | } | 434 | } |
| @@ -440,7 +440,7 @@ mod embedded_io_impls { | |||
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | /// TCP client compatible with `embedded-nal-async` traits. | 442 | /// TCP client compatible with `embedded-nal-async` traits. |
| 443 | #[cfg(all(feature = "unstable-traits", feature = "nightly"))] | 443 | #[cfg(feature = "nightly")] |
| 444 | pub mod client { | 444 | pub mod client { |
| 445 | use core::cell::UnsafeCell; | 445 | use core::cell::UnsafeCell; |
| 446 | use core::mem::MaybeUninit; | 446 | use core::mem::MaybeUninit; |
| @@ -527,13 +527,13 @@ pub mod client { | |||
| 527 | } | 527 | } |
| 528 | } | 528 | } |
| 529 | 529 | ||
| 530 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io::Io | 530 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io_async::ErrorType |
| 531 | for TcpConnection<'d, N, TX_SZ, RX_SZ> | 531 | for TcpConnection<'d, N, TX_SZ, RX_SZ> |
| 532 | { | 532 | { |
| 533 | type Error = Error; | 533 | type Error = Error; |
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io::asynch::Read | 536 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io_async::Read |
| 537 | for TcpConnection<'d, N, TX_SZ, RX_SZ> | 537 | for TcpConnection<'d, N, TX_SZ, RX_SZ> |
| 538 | { | 538 | { |
| 539 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | 539 | async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { |
| @@ -541,7 +541,7 @@ pub mod client { | |||
| 541 | } | 541 | } |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io::asynch::Write | 544 | impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> embedded_io_async::Write |
| 545 | for TcpConnection<'d, N, TX_SZ, RX_SZ> | 545 | for TcpConnection<'d, N, TX_SZ, RX_SZ> |
| 546 | { | 546 | { |
| 547 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | 547 | async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { |
