Function parse_message_generic

Source
pub fn parse_message_generic<T>(buffer: &[u8]) -> Option<&T>
where T: Copy,
Expand description

Parse a message from a buffer for types that can’t implement Pod

This is needed for types with const generic parameters like ZeroCopyOrderBookUpdate where bytemuck can’t verify padding requirements at compile time.

§Safety

The caller must ensure the buffer contains valid data for type T. This function validates both size and alignment requirements.