pub fn from_data(data: &[u8]) -> Result<(Self, &[u8]), ModbusSerializationError> {
        if data.len() < 4 {
            Err(ModbusSerializationError::UnexpectedEOF {
                expected: 4,
                got: data.len(),
            })
        } else {
            unsafe { Self::from_data_unchecked(data) }
        }
    }
/// Parse this request from the given modbus data
///
/// 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
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 The data should only consist out of the address and quantity as the slave id function will be already read through other means .
pub fn from_data(data: &[u8]) -> Result<(Self, &[u8]), ModbusSerializationError> {
        if data.len() < 4 {
            Err(ModbusSerializationError::UnexpectedEOF {
                expected: 4,
                got: data.len(),
            })
        } else {
            unsafe { Self::from_data_unchecked(data) }
        }
    }
pub fn from_data ( data : & [ u8 ] ) -> Result < ( Self , & [ u8 ] ) , ModbusSerializationError > { if data . len ( ) < 4 { Err ( ModbusSerializationError :: UnexpectedEOF { expected : 4 , got : data . len ( ) , } ) } else { unsafe { Self :: from_data_unchecked ( data ) } } }
Parse this request from the given modbus data
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 The data should only consist out of the address and quantity as the slave id function will be already read through other means .
data
&[u8]
data
&[u8]