pub fn parse_byte<R: io::Read>(reader: &mut R) -> Result<Self, Error> {
    let mut buffer = [0; 1];
    reader.read_exact(&mut buffer)?;
    Ok(Self::Byte(u8::from_be_bytes(buffer)))
  }
/// Reads one byte from the reader and attempts to convert the byte to DataType::Byte (u8).
///
/// [1.5.1 Bits](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901007)
///
/// Bits in a byte are labelled 7 to 0. Bit number 7 is the most significant
/// bit, the least significant bit is assigned bit number 0.
///
/// # Examples
///
/// ```rust
/// use mqtt_packet::DataType;
/// use std::io;
///
/// let data: Vec<u8> = vec![0xFF, 0x02];
/// let mut reader = io::BufReader::new(&data[..]);
/// let byte = DataType::parse_byte(&mut reader).unwrap();
/// assert_eq!(byte, DataType::Byte(255));
/// ```
Reads one byte from the reader and attempts to convert the byte to DataType::Byte (u8).

Bits in a byte are labelled 7 to 0. Bit number 7 is the most significant
bit, the least significant bit is assigned bit number 0.
Reads one byte from the reader and attempts to convert the byte to DataType :: Byte ( u8 ) . Bits in a byte are labelled 7 to 0 . Bit number 7 is the most significant bit the least significant bit is assigned bit number 0 .
pub fn parse_byte<R: io::Read>(reader: &mut R) -> Result<Self, Error> {
    let mut buffer = [0; 1];
    reader.read_exact(&mut buffer)?;
    Ok(Self::Byte(u8::from_be_bytes(buffer)))
  }
pub fn parse_byte < R : io :: Read > ( reader : & mut R ) -> Result < Self , Error > { let mut buffer = [ 0 ; 1 ] ; reader . read_exact ( & mut buffer ) ? ; Ok ( Self :: Byte ( u8 :: from_be_bytes ( buffer ) ) ) }
Reads one byte from the reader and attempts to convert the byte to DataType::Byte (u8).
Reads one byte from the reader and attempts to convert the byte to DataType :: Byte ( u8 ) .
reader
&mut R
reader
&mut R
examples
```rust
use mqtt_packet::DataType;
use std::io.

let data: Vec = vec![0xFF, 0x02];
let mut reader = io::BufReader::new(&data[..]);
let byte = DataType::parse_byte(&mut reader).unwrap();
assert_eq!(byte, DataType::Byte(255));
```
` ` ` rust use mqtt_packet :: DataType ; use std :: io . let data : Vec = vec! [ 0xFF 0x02 ] ; let mut reader = io :: BufReader :: new ( &data [ .. ] ) ; let byte = DataType :: parse_byte ( &mut reader ) . unwrap () ; assert_eq! ( byte DataType :: Byte ( 255 )) ; ` ` `