Struct NetworkTap

Source
pub struct NetworkTap<T> { /* private fields */ }
Expand description

An instance of the socket/stream.

Trait Implementations§

Source§

impl<T: Debug> Debug for NetworkTap<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SocketTap for NetworkTap<TcpStream>

Source§

fn connect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = CDnsResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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 poll(2).
If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
Source§

fn is_tcp(&self) -> bool

Tells if current instance is TcpStream if true, or UdpSocket if false
Source§

fn is_conncected<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tells if socket/stream is connected to remote host
Source§

fn get_remote_addr(&self) -> &SocketAddr

Returns the remote host Ip and port.
Source§

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, sndbuf: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CDnsResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends data over wire.
Source§

fn recv<'life0, 'life1, 'async_trait>( &'life0 mut self, rcvbuf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = CDnsResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receives data transmitted from remote host. In nonblocking mode it should be called only after the event was polled In blocking mode it will block until received or timeout.
Source§

impl SocketTap for NetworkTap<UdpSocket>

Source§

fn connect<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = CDnsResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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 poll(2).
If timeout is set, then the socket is initialized in blocking mode with timeout. Tht [PollFd] is not generated!
Source§

fn is_tcp(&self) -> bool

Tells if current instance is TcpStream if true, or UdpSocket if false
Source§

fn is_conncected<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tells if socket/stream is connected to remote host
Source§

fn get_remote_addr(&self) -> &SocketAddr

Returns the remote host Ip and port.
Source§

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, sndbuf: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = CDnsResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends data over wire.
Source§

fn recv<'life0, 'life1, 'async_trait>( &'life0 mut self, rcvbuf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = CDnsResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receives data transmitted from remote host. In nonblocking mode it should be called only after the event was polled In blocking mode it will block until received or timeout.
Source§

impl<T> Send for NetworkTap<T>

Source§

impl<T> Sync for NetworkTap<T>

Auto Trait Implementations§

§

impl<T> Freeze for NetworkTap<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for NetworkTap<T>
where T: RefUnwindSafe,

§

impl<T> Unpin for NetworkTap<T>
where T: Unpin,

§

impl<T> UnwindSafe for NetworkTap<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V