Trait smoltcp::phy::RxToken

source ·
pub trait RxToken {
    fn consume<R, F>(self, timestamp: Instant, f: F) -> Result<R>
    where
        F: FnOnce(&[u8]) -> Result<R>
; }
Expand description

A token to receive a single network packet.

Required Methods§

Consumes the token to receive a single network packet.

This method receives a packet and then calls the given closure f with the raw packet bytes as argument.

The timestamp must be a number of milliseconds, monotonically increasing since an arbitrary moment in time, such as system startup.

Implementors§