pub struct CaptureDevice { /* private fields */ }Expand description
Network device capable of injecting and extracting packets
Implementations§
Source§impl CaptureDevice
impl CaptureDevice
pub fn tap(mtu: usize) -> Self
pub fn tun(mtu: usize) -> Self
pub fn pcap_tap<S>(mtu: usize, pcap: S) -> Selfwhere
S: PcapSink + 'static,
pub fn pcap_tun<S>(mtu: usize, pcap: S) -> Selfwhere
S: PcapSink + 'static,
pub fn is_tun(&self) -> bool
pub fn metrics(&self) -> ChannelMetrics
pub fn phy_rx(&mut self, data: impl Into<Payload>)
pub fn next_phy_tx(&mut self) -> Option<Vec<u8>>
Trait Implementations§
Source§impl Default for CaptureDevice
impl Default for CaptureDevice
Source§impl Device for CaptureDevice
impl Device for CaptureDevice
type RxToken<'a> = RxToken<'a> where Self: 'a
type TxToken<'a> = TxToken<'a> where Self: 'a
Source§fn receive(
&mut self,
timestamp: Instant,
) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
fn receive( &mut self, timestamp: Instant, ) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
Construct a token pair consisting of one receive token and one transmit token. Read more
Source§fn transmit(&mut self, timestamp: Instant) -> Option<Self::TxToken<'_>>
fn transmit(&mut self, timestamp: Instant) -> Option<Self::TxToken<'_>>
Construct a transmit token. Read more
Source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.
Auto Trait Implementations§
impl !Freeze for CaptureDevice
impl !RefUnwindSafe for CaptureDevice
impl !Send for CaptureDevice
impl !Sync for CaptureDevice
impl Unpin for CaptureDevice
impl !UnwindSafe for CaptureDevice
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