pub unsafe fn from_data_unchecked(data: &[u8]) -> Result<(Self, &[u8]), ModbusSerializationError> {
        let (addr, data) = util::read_u16_unchecked(data);
        let (state, data) = util::read_u16_unchecked(data);
        let state = BitState::try_from(state)?;

        Ok((Self::new(addr, state), data))
    }
/// Parse this request from the given modbus data without bounds checks.
///
/// The data should only consist out of the address and quantity as the slave id function
/// will be already read through other means.
///
/// # Safety
/// This function causes undefined behavior if the len of data is smaller than 4
Parse this request from the given modbus data without bounds checks.
The data should only consist out of the address and quantity as the slave id function
will be already read through other means.
Parse this request from the given modbus data without bounds checks . The data should only consist out of the address and quantity as the slave id function will be already read through other means .
pub unsafe fn from_data_unchecked(data: &[u8]) -> Result<(Self, &[u8]), ModbusSerializationError> {
        let (addr, data) = util::read_u16_unchecked(data);
        let (state, data) = util::read_u16_unchecked(data);
        let state = BitState::try_from(state)?;
        Ok((Self::new(addr, state), data))
    }
pub unsafe fn from_data_unchecked ( data : & [ u8 ] ) -> Result < ( Self , & [ u8 ] ) , ModbusSerializationError > { let ( addr , data ) = util :: read_u16_unchecked ( data ) ; let ( state , data ) = util :: read_u16_unchecked ( data ) ; let state = BitState :: try_from ( state ) ? ; Ok ( ( Self :: new ( addr , state ) , data ) ) }
Parse this request from the given modbus data without bounds checks.
Parse this request from the given modbus data without bounds checks .
data
&[u8]
data
&[u8]
safety
This function causes undefined behavior if the len of data is smaller than 4
This function causes undefined behavior if the len of data is smaller than 4