Struct ya_relay_stack::device::CaptureDevice
source · 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<'a> Device<'a> for CaptureDevice
impl<'a> Device<'a> for CaptureDevice
type RxToken = RxToken<'a>
type TxToken = TxToken<'a>
source§fn receive(&'a mut self) -> Option<(Self::RxToken, Self::TxToken)>
fn receive(&'a mut self) -> Option<(Self::RxToken, Self::TxToken)>
Construct a token pair consisting of one receive token and one transmit token. Read more
source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.
Auto Trait Implementations§
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