fn from_bytes(slice: &[u8]) -> Result<ArrowMessageHeader> {
        assert_eq!(slice.len(), mem::size_of::<ArrowMessageHeader>());
        let ptr    = slice.as_ptr() as *const ArrowMessageHeader;
        let header = unsafe { &*ptr };
        
        let res = ArrowMessageHeader {
            version: header.version,
            service: u16::from_be(header.service),
            session: u32::from_be(header.session) & ((1 << 24) - 1),
            size:    u32::from_be(header.size)
        };
        
        if res.version == ARROW_PROTOCOL_VERSION {
            Ok(res)
        } else {
            Err(ArrowError::unsupported_protocol_version("unsupported Arrow Protocol version"))
        }
    }
/// Deserialize an Arrow Message header.
Deserialize an Arrow Message header.
Deserialize an Arrow Message header .
fn from_bytes(slice: &[u8]) -> Result<ArrowMessageHeader> {
        assert_eq!(slice.len(), mem::size_of::<ArrowMessageHeader>());
        let ptr    = slice.as_ptr() as *const ArrowMessageHeader;
        let header = unsafe { &*ptr };
        let res = ArrowMessageHeader {
            version: header.version,
            service: u16::from_be(header.service),
            session: u32::from_be(header.session) & ((1 << 24) - 1),
            size:    u32::from_be(header.size)
        };
        if res.version == ARROW_PROTOCOL_VERSION {
            Ok(res)
        } else {
            Err(ArrowError::unsupported_protocol_version("unsupported Arrow Protocol version"))
        }
    }
fn from_bytes ( slice : & [ u8 ] ) -> Result < ArrowMessageHeader > { assert_eq ! ( slice len ( ) mem size_of ArrowMessageHeader ( ) ) ; let ptr = slice . as_ptr ( ) as * const ArrowMessageHeader ; let header = unsafe { & * ptr } ; let res = ArrowMessageHeader { version : header . version , service : u16 :: from_be ( header . service ) , session : u32 :: from_be ( header . session ) & ( ( 1 << 24 ) - 1 ) , size : u32 :: from_be ( header . size ) } ; if res . version == ARROW_PROTOCOL_VERSION { Ok ( res ) } else { Err ( ArrowError :: unsupported_protocol_version ( " " ) ) } }
Deserialize an Arrow Message header.
Deserialize an Arrow Message header .
slice
&[u8]
slice
&[u8]