pub struct Receive<'a> {
pub source: SocketAddr,
pub destination: SocketAddr,
pub contents: DatagramRecv<'a>,
}
Expand description
Received incoming data.
Fields§
§source: SocketAddr
The socket this received data originated from.
destination: SocketAddr
The destination ip of the datagram.
contents: DatagramRecv<'a>
Parsed contents of the datagram.
Implementations§
source§impl<'a> Receive<'a>
impl<'a> Receive<'a>
sourcepub fn new(
source: SocketAddr,
destination: SocketAddr,
buf: &'a [u8]
) -> Result<Self, NetError>
pub fn new(
source: SocketAddr,
destination: SocketAddr,
buf: &'a [u8]
) -> Result<Self, NetError>
Creates a new instance by trying to parse the contents of buf
.