Macro h2::frame::unpack_octets_4

source ·
macro_rules! unpack_octets_4 {
    ($buf:expr, $offset:expr, $tip:ty) => { ... };
}
Expand description

A helper macro that unpacks a sequence of 4 bytes found in the buffer with the given identifier, starting at the given offset, into the given integer type. Obviously, the integer type should be able to support at least 4 bytes.

Examples

let buf: [u8; 4] = [0, 0, 0, 1];
assert_eq!(1u32, unpack_octets_4!(buf, 0, u32));