pub struct TcpClient<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB: TcpClientCallBack> { /* private fields */ }Expand description
tcp client
Implementations§
Source§impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB: TcpClientCallBack> TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
custom method
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB: TcpClientCallBack> TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
custom method
Sourcepub fn new(
stack: Stack<'d>,
ip: Ipv4Addr,
port: u16,
cb: CB,
state: &'d SocketState<N, TX_SZ, RX_SZ, BUF_SIZE>,
) -> Self
pub fn new( stack: Stack<'d>, ip: Ipv4Addr, port: u16, cb: CB, state: &'d SocketState<N, TX_SZ, RX_SZ, BUF_SIZE>, ) -> Self
create tcp client
Sourcepub fn socket_timeout(&mut self, timeout: Option<Duration>)
pub fn socket_timeout(&mut self, timeout: Option<Duration>)
set socket timeout
connection timeout and etc.
tt is recommended not to set or set to None
Sourcepub fn read_timeout(&mut self, timeout: Duration)
pub fn read_timeout(&mut self, timeout: Duration)
set read timeout
Sourcepub async fn run<const CH_N: usize>(&self, wch: &WriteChannel<'_, CH_N>)
pub async fn run<const CH_N: usize>(&self, wch: &WriteChannel<'_, CH_N>)
run tcp client
calling this method causes tcp to maintain a long connection and send data asynchronously over WriteChannel
Auto Trait Implementations§
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> Freeze for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>where
CB: Freeze,
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> !RefUnwindSafe for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> !Send for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> !Sync for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> Unpin for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>where
CB: Unpin,
impl<'d, const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize, CB> !UnwindSafe for TcpClient<'d, N, TX_SZ, RX_SZ, BUF_SIZE, CB>
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