pub fn new(raw: &Vec<u8>) -> Self {
        match raw.get(Header::LENGTH_OFFSET) {
            Some(&header_length) => UndefinedStruct {
                header: Header::new(raw[..Header::SIZE].try_into().expect("4 bytes")),
                fields: raw.get(..(header_length as usize)).unwrap_or(&[]).to_vec(),
                strings: {
                    Strings::new(
                        raw.get((header_length as usize)..raw.len() - 2)
                            .unwrap_or(&[])
                            .to_vec(),
                    )
                },
            },
            None => UndefinedStruct {
                ..Default::default()
            },
        }
    }
/// Creates a structure instance of the given byte array slice
Creates a structure instance of the given byte array slice
Creates a structure instance of the given byte array slice
pub fn new(raw: &Vec<u8>) -> Self {
        match raw.get(Header::LENGTH_OFFSET) {
            Some(&header_length) => UndefinedStruct {
                header: Header::new(raw[..Header::SIZE].try_into().expect("4 bytes")),
                fields: raw.get(..(header_length as usize)).unwrap_or(&[]).to_vec(),
                strings: {
                    Strings::new(
                        raw.get((header_length as usize)..raw.len() - 2)
                            .unwrap_or(&[])
                            .to_vec(),
                    )
                },
            },
            None => UndefinedStruct {
                ..Default::default()
            },
        }
    }
pub fn new ( raw : & Vec < u8 > ) -> Self { match raw . get ( Header :: LENGTH_OFFSET ) { Some ( & header_length ) => UndefinedStruct { header : Header :: new ( raw [ .. Header :: SIZE ] . try_into ( ) . expect ( " " ) ) , fields : raw . get ( .. ( header_length as usize ) ) . unwrap_or ( & [ ] ) . to_vec ( ) , strings : { Strings :: new ( raw . get ( ( header_length as usize ) .. raw . len ( ) - 2 ) . unwrap_or ( & [ ] ) . to_vec ( ) , ) } , } , None => UndefinedStruct { .. Default :: default ( ) } , } }
Creates a structure instance of the given byte array slice
Creates a structure instance of the given byte array slice
raw
&Vec<u8>
raw
&Vec<u8>