Struct cdns_rs::sync::network::NetworkTap
source · pub struct NetworkTap<T: AsRawFd> { /* private fields */ }
Expand description
An instance of the socket/stream.
Trait Implementations§
source§impl SocketTap for NetworkTap<TcpStream>
impl SocketTap for NetworkTap<TcpStream>
source§fn connect(&mut self, timeout: Option<Duration>) -> CDnsResult<()>
fn connect(&mut self, timeout: Option<Duration>) -> CDnsResult<()>
Connects to the remote host.
If timeout is not set, the socket is initialized in non blocking mode and [PollFd] is created to use with
If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
If timeout is not set, the socket is initialized in non blocking mode and [PollFd] is created to use with
poll(2)
.If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
source§fn is_conncected(&self) -> bool
fn is_conncected(&self) -> bool
Tells if socket/stream is connected to remote host
source§fn get_fd(&self) -> Option<BorrowedFd<'_>>
fn get_fd(&self) -> Option<BorrowedFd<'_>>
Returns the raw fd of the socket.
source§fn get_remote_addr(&self) -> &SocketAddr
fn get_remote_addr(&self) -> &SocketAddr
Returns the remote host Ip and port.
source§impl SocketTap for NetworkTap<UdpSocket>
impl SocketTap for NetworkTap<UdpSocket>
source§fn connect(&mut self, timeout: Option<Duration>) -> CDnsResult<()>
fn connect(&mut self, timeout: Option<Duration>) -> CDnsResult<()>
Connects to the remote host.
If timeout is not set, the socket is initialized in non blocking mode and [PollFd] is created to use with
If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
If timeout is not set, the socket is initialized in non blocking mode and [PollFd] is created to use with
poll(2)
.If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
source§fn is_conncected(&self) -> bool
fn is_conncected(&self) -> bool
Tells if socket/stream is connected to remote host
source§fn get_fd(&self) -> Option<BorrowedFd<'_>>
fn get_fd(&self) -> Option<BorrowedFd<'_>>
Returns the raw fd of the socket.
source§fn get_remote_addr(&self) -> &SocketAddr
fn get_remote_addr(&self) -> &SocketAddr
Returns the remote host Ip and port.
Auto Trait Implementations§
impl<T> Freeze for NetworkTap<T>where
T: Freeze,
impl<T> RefUnwindSafe for NetworkTap<T>where
T: RefUnwindSafe,
impl<T> Send for NetworkTap<T>where
T: Send,
impl<T> Sync for NetworkTap<T>where
T: Sync,
impl<T> Unpin for NetworkTap<T>where
T: Unpin,
impl<T> UnwindSafe for NetworkTap<T>where
T: UnwindSafe,
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