pub struct TcpState<X: Dependencies>(/* private fields */);
Implementations§
source§impl<X: Dependencies> TcpState<X>
impl<X: Dependencies> TcpState<X>
pub fn new(deps: X, config: TcpConfig) -> Self
pub fn close(&mut self) -> Result<(), CloseError>
pub fn shutdown(&mut self, how: Shutdown) -> Result<(), ShutdownError>
pub fn listen<T, E>( &mut self, backlog: u32, associate_fn: impl FnOnce() -> Result<T, E>, ) -> Result<T, ListenError<E>>
pub fn connect<T, E>( &mut self, addr: SocketAddrV4, associate_fn: impl FnOnce() -> Result<(SocketAddrV4, T), E>, ) -> Result<T, ConnectError<E>>
pub fn accept(&mut self) -> Result<AcceptedTcpState<X>, AcceptError>
pub fn send( &mut self, reader: impl Read, len: usize, ) -> Result<usize, SendError>
pub fn recv( &mut self, writer: impl Write, len: usize, ) -> Result<usize, RecvError>
pub fn push_packet( &mut self, header: &TcpHeader, payload: Payload, ) -> Result<u32, PushPacketError>
pub fn pop_packet(&mut self) -> Result<(TcpHeader, Payload), PopPacketError>
pub fn clear_error(&mut self) -> Option<TcpError>
pub fn poll(&self) -> PollState
pub fn wants_to_send(&self) -> bool
pub fn local_remote_addrs(&self) -> Option<(SocketAddrV4, SocketAddrV4)>
Trait Implementations§
Auto Trait Implementations§
impl<X> Freeze for TcpState<X>
impl<X> RefUnwindSafe for TcpState<X>
impl<X> Send for TcpState<X>
impl<X> Sync for TcpState<X>
impl<X> Unpin for TcpState<X>
impl<X> UnwindSafe for TcpState<X>
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