pub struct AcceptedTcpState<X: Dependencies>(/* private fields */);
Expand description
An accept()ed TCP state. This is used to ensure that the caller uses
finalize
to update the state’s Dependencies
since the state is no longer
owned by the listening socket.
Implementations§
source§impl<X: Dependencies> AcceptedTcpState<X>
impl<X: Dependencies> AcceptedTcpState<X>
sourcepub fn finalize(self, f: impl FnOnce(&mut X)) -> TcpState<X>
pub fn finalize(self, f: impl FnOnce(&mut X)) -> TcpState<X>
This allows the caller to update the state’s Dependencies
.
This must be called immediately after TcpState::accept
, otherwise the accept()ed socket
may miss some of its timer events.
pub fn local_addr(&self) -> SocketAddrV4
pub fn remote_addr(&self) -> SocketAddrV4
Auto Trait Implementations§
impl<X> Freeze for AcceptedTcpState<X>
impl<X> RefUnwindSafe for AcceptedTcpState<X>
impl<X> Send for AcceptedTcpState<X>
impl<X> Sync for AcceptedTcpState<X>
impl<X> Unpin for AcceptedTcpState<X>
impl<X> UnwindSafe for AcceptedTcpState<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