[−][src]Struct ethox::nic::loopback::Loopback
A software loop-back device.
Maintains a ring buffer of packet buffers in flight.
Methods
impl<'r, C: PayloadMut> Loopback<'r, C>
[src]
pub fn new(buffer: Slice<'r, C>) -> Self
[src]
Create a loop-back device with mtu.
It will divide the packet buffer into chunks of the provided mtu and keep track of free and used buffers
pub fn set_current_time(&mut self, instant: Instant)
[src]
Update the timestamp on all future received packets.
Trait Implementations
impl<'a, C: PayloadMut> Device for Loopback<'a, C>
[src]
type Handle = Handle
The control handle type also providing packet meta information.
type Payload = C
The payload buffer type of this device. Read more
fn personality(&self) -> Personality
[src]
fn tx(
&mut self,
max: usize,
sender: impl Send<Self::Handle, Self::Payload>
) -> Result<usize>
[src]
&mut self,
max: usize,
sender: impl Send<Self::Handle, Self::Payload>
) -> Result<usize>
fn rx(
&mut self,
max: usize,
receptor: impl Recv<Self::Handle, Self::Payload>
) -> Result<usize>
[src]
&mut self,
max: usize,
receptor: impl Recv<Self::Handle, Self::Payload>
) -> Result<usize>
Auto Trait Implementations
impl<'r, C> Send for Loopback<'r, C> where
C: Send,
C: Send,
impl<'r, C> Sync for Loopback<'r, C> where
C: Sync,
C: Sync,
impl<'r, C> Unpin for Loopback<'r, C> where
C: Unpin,
C: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,