pub fn receive_frame<B: BufferMut, D: BufferDispatcher<B>>(
    ctx: &mut Ctx<D>,
    device: DeviceId,
    buffer: B,
) -> Result<(), NotSupportedError> {
    // `device` must be initialized.
    assert!(is_device_initialized(&ctx.state, device));

    match device.inner() {
        DeviceIdInner::Ethernet(id) => Ok(self::ethernet::receive_frame(ctx, id, buffer)),
        DeviceIdInner::Loopback => Err(NotSupportedError),
    }
}
/// Receive a device layer frame from the network.
///
/// # Panics
///
/// Panics if `device` is not initialized.
Receive a device layer frame from the network.
Receive a device layer frame from the network .
pub fn receive_frame<B: BufferMut, D: BufferDispatcher<B>>(
    ctx: &mut Ctx<D>,
    device: DeviceId,
    buffer: B,
) -> Result<(), NotSupportedError> {
    // `device` must be initialized.
    assert!(is_device_initialized(&ctx.state, device));
    match device.inner() {
        DeviceIdInner::Ethernet(id) => Ok(self::ethernet::receive_frame(ctx, id, buffer)),
        DeviceIdInner::Loopback => Err(NotSupportedError),
    }
}
pub fn receive_frame < B : BufferMut , D : BufferDispatcher < B > > ( ctx : & mut Ctx < D > , device : DeviceId , buffer : B , ) -> Result < ( ) , NotSupportedError > { // `device` must be initialized. assert ! ( is_device_initialized ( ctx state device ) ) ; match device . inner ( ) { DeviceIdInner :: Ethernet ( id ) => Ok ( self :: ethernet :: receive_frame ( ctx , id , buffer ) ) , DeviceIdInner :: Loopback => Err ( NotSupportedError ) , } }
Receive a device layer frame from the network.
Receive a device layer frame from the network .
ctx
&mut Ctx<D>
device
DeviceId
buffer
B
ctx
&mut Ctx<D>
device
DeviceId
buffer
B
panics
Panics if `device` is not initialized.
Panics if ` device ` is not initialized .