Struct TcpConnection
pub struct TcpConnection<'a, 's> { /* private fields */ }
Expand description
Active TCP connection for reading and writing data.
Implements async I/O operations through embedded_io_async
traits.
The connection is automatically closed when dropped.
On drop, the remote endpoint may or may not be informed about the connection terminating.
To cleanly close a connection, use veecle_osal_api::net::tcp::TcpConnection::close
.
Trait Implementations§
§impl<'a, 's> Debug for TcpConnection<'a, 's>
impl<'a, 's> Debug for TcpConnection<'a, 's>
§impl Drop for TcpConnection<'_, '_>
impl Drop for TcpConnection<'_, '_>
§impl<'a, 's> ErrorType for TcpConnection<'a, 's>
impl<'a, 's> ErrorType for TcpConnection<'a, 's>
§impl<'a, 's> Read for TcpConnection<'a, 's>
impl<'a, 's> Read for TcpConnection<'a, 's>
§async fn read(
&mut self,
buffer: &mut [u8],
) -> Result<usize, <TcpConnection<'a, 's> as ErrorType>::Error>
async fn read( &mut self, buffer: &mut [u8], ) -> Result<usize, <TcpConnection<'a, 's> as ErrorType>::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read more§impl<'a, 's> TcpConnection for TcpConnection<'a, 's>
impl<'a, 's> TcpConnection for TcpConnection<'a, 's>
§impl<'a, 's> Write for TcpConnection<'a, 's>
impl<'a, 's> Write for TcpConnection<'a, 's>
§async fn write(
&mut self,
buffer: &[u8],
) -> Result<usize, <TcpConnection<'a, 's> as ErrorType>::Error>
async fn write( &mut self, buffer: &[u8], ) -> Result<usize, <TcpConnection<'a, 's> as ErrorType>::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Auto Trait Implementations§
impl<'a, 's> Freeze for TcpConnection<'a, 's>
impl<'a, 's> !RefUnwindSafe for TcpConnection<'a, 's>
impl<'a, 's> !Send for TcpConnection<'a, 's>
impl<'a, 's> !Sync for TcpConnection<'a, 's>
impl<'a, 's> Unpin for TcpConnection<'a, 's>
impl<'a, 's> !UnwindSafe for TcpConnection<'a, 's>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more