Struct TcpClient
pub struct TcpClient<'d, const N: usize, const TX_SZ: usize = 1024, const RX_SZ: usize = 1024> { /* private fields */ }Available on crate feature
tcp only.Expand description
TCP client connection pool compatible with embedded-nal-async traits.
The pool is capable of managing up to N concurrent connections with tx and rx buffers according to TX_SZ and RX_SZ.
Implementations§
§impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> TcpClient<'d, N, TX_SZ, RX_SZ>
pub fn new(
stack: Stack<'d>,
state: &'d TcpClientState<N, TX_SZ, RX_SZ>,
) -> TcpClient<'d, N, TX_SZ, RX_SZ>
pub fn new( stack: Stack<'d>, state: &'d TcpClientState<N, TX_SZ, RX_SZ>, ) -> TcpClient<'d, N, TX_SZ, RX_SZ>
Create a new TcpClient.
pub fn set_timeout(&mut self, timeout: Option<Duration>)
pub fn set_timeout(&mut self, timeout: Option<Duration>)
Set the timeout for each socket created by this TcpClient.
If the timeout is set, the socket will be closed if no data is received for the specified duration.
Trait Implementations§
§impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> TcpConnect for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> TcpConnect for TcpClient<'d, N, TX_SZ, RX_SZ>
§type Connection<'m> = TcpConnection<'m, N, TX_SZ, RX_SZ>
where
TcpClient<'d, N, TX_SZ, RX_SZ>: 'm
type Connection<'m> = TcpConnection<'m, N, TX_SZ, RX_SZ> where TcpClient<'d, N, TX_SZ, RX_SZ>: 'm
Type holding state of a TCP connection. Should close the connection when dropped.
Auto Trait Implementations§
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> Freeze for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize = 1024, const RX_SZ: usize = 1024> !RefUnwindSafe for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize = 1024, const RX_SZ: usize = 1024> !Send for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize = 1024, const RX_SZ: usize = 1024> !Sync for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize> Unpin for TcpClient<'d, N, TX_SZ, RX_SZ>
impl<'d, const N: usize, const TX_SZ: usize = 1024, const RX_SZ: usize = 1024> !UnwindSafe for TcpClient<'d, N, TX_SZ, RX_SZ>
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