-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to core::net, implement embedded-io-async and release as 0.6.0
- Loading branch information
1 parent
7fa055f
commit 8b98ef6
Showing
13 changed files
with
173 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
macro_rules! impl_error_trait { | ||
($name:path, $error:path, <$($generics:lifetime),*>) => { | ||
impl<$($generics),*> embedded_io_async::ErrorType for $name { | ||
type Error = $error; | ||
} | ||
}; | ||
} | ||
|
||
macro_rules! impl_write_trait { | ||
($name:path, <$($generics:lifetime),*>) => { | ||
impl<$($generics),*> embedded_io_async::Write for $name { | ||
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> { | ||
Self::write(self, buf).await?; | ||
Ok(buf.len()) | ||
} | ||
} | ||
}; | ||
} | ||
|
||
macro_rules! impl_read_trait { | ||
($name:path, <$($generics:lifetime),*>) => { | ||
impl<$($generics),*> embedded_io_async::Read for $name { | ||
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> { | ||
let read = self.receive(buf).await?; | ||
Ok(read.len()) | ||
} | ||
} | ||
}; | ||
} | ||
|
||
pub(crate) use impl_error_trait; | ||
pub(crate) use impl_read_trait; | ||
pub(crate) use impl_write_trait; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.