pub fn from_bytes(bytes: &[u8]) -> Tuple {
        Tuple {
            buffer: Vec::from(bytes)
        }
    }
/// Create a new tuple from an existing byte array
///
/// This can be used with `as_segments` to parse an existing tuple into a list of segments
///
/// # Examples
/// ```
/// use binary_tuples::{Tuple, segment::Segment};
///
/// let binary = vec![2, 117, 115, 101, 114, 115, 0, 21, 1];
///
/// let tuple = Tuple::from_bytes(&binary)
///     .as_segments()
///     .unwrap();
///
/// assert_eq!(tuple, vec![Segment::String(String::from("users")), Segment::Integer(1)]);
/// ```
Create a new tuple from an existing byte array
This can be used with `as_segments` to parse an existing tuple into a list of segments
Create a new tuple from an existing byte array This can be used with ` as_segments ` to parse an existing tuple into a list of segments
pub fn from_bytes(bytes: &[u8]) -> Tuple {
        Tuple {
            buffer: Vec::from(bytes)
        }
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Tuple { Tuple { buffer : Vec :: from ( bytes ) } }
Create a new tuple from an existing byte array
This can be used with `as_segments` to parse an existing tuple into a list of segments
Create a new tuple from an existing byte array This can be used with ` as_segments ` to parse an existing tuple into a list of segments
bytes
&[u8]
bytes
&[u8]
examples
```
use binary_tuples::{Tuple, segment::Segment}.



let tuple = Tuple::from_bytes(&binary)
.as_segments()
.unwrap().

assert_eq!(tuple, vec![Segment::String(String::from("users")), Segment::Integer(1)]);
```
` ` ` use binary_tuples :: { Tuple segment :: Segment } . let tuple = Tuple :: from_bytes ( &binary ) . as_segments () . unwrap () . assert_eq! ( tuple vec! [ Segment :: String ( String :: from ( " users " )) Segment :: Integer ( 1 ) ] ) ; ` ` `