mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 14:53:03 +00:00
embassy-net/read document return value Ok(0)
This commit is contained in:
parent
423e5d7655
commit
acc26a076a
@ -79,6 +79,9 @@ impl<'a> TcpReader<'a> {
|
|||||||
///
|
///
|
||||||
/// Returns how many bytes were read, or an error. If no data is available, it waits
|
/// Returns how many bytes were read, or an error. If no data is available, it waits
|
||||||
/// until there is at least one byte available.
|
/// until there is at least one byte available.
|
||||||
|
///
|
||||||
|
/// A return value of Ok(0) means that the socket was closed and is longer able to
|
||||||
|
/// accept bytes or that the buffer provided is empty.
|
||||||
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
|
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
|
||||||
self.io.read(buf).await
|
self.io.read(buf).await
|
||||||
}
|
}
|
||||||
@ -273,6 +276,9 @@ impl<'a> TcpSocket<'a> {
|
|||||||
///
|
///
|
||||||
/// Returns how many bytes were read, or an error. If no data is available, it waits
|
/// Returns how many bytes were read, or an error. If no data is available, it waits
|
||||||
/// until there is at least one byte available.
|
/// until there is at least one byte available.
|
||||||
|
///
|
||||||
|
/// A return value of Ok(0) means that the socket was closed and is longer able to
|
||||||
|
/// accept bytes or that the buffer provided is empty.
|
||||||
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
|
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
|
||||||
self.io.read(buf).await
|
self.io.read(buf).await
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user