memcached-network-types 0.1.4

Provides types for memcached protocol entities used for sending requests and responses over the network.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Contains types related to memcached [UDP protocol](https://github.com/memcached/memcached/blob/b1aefcdf8a265f8a5126e8aa107a50988fa1ec35/doc/protocol.txt#L1861).

use zerocopy::network_endian::U16;
use zerocopy_derive::{AsBytes, FromBytes, FromZeroes};

#[derive(FromBytes, FromZeroes, AsBytes)]
#[repr(C)]
pub struct MemcachedUdpHeader {
    pub request_id: U16,
    pub seq_num: U16,
    pub num_dgram: U16,
    pub unused: U16,
}