fn try_from(data: Vec<u32>) -> Result<Self> {
        if data.len() < 2 {
            return Err(Error::InvalidTLV);
        }

        if data[Self::LEN_OFFSET] % size_of::<u32>() as u32 != 0 {
            return Err(Error::InvalidTLV);
        }

        if data[Self::LEN_OFFSET] / size_of::<u32>() as u32
            > data[Self::VALUE_OFFSET..].len() as u32
        {
            return Err(Error::InvalidTLV);
        }

        Ok(Self { data })
    }
/// Constructs a TLV from a vector with the following alsa tlv header validation:
///  1 . tlv_buf[Self::LEN_OFFSET] should be multiple of size_of::<u32>
///  2 . tlv_buf[Self::LEN_OFFSET] is the length of tlv value in byte and
///      should be less than the buffer length * size_of::<u32>.
Constructs a TLV from a vector with the following alsa tlv header validation:
1 .
Constructs a TLV from a vector with the following alsa tlv header validation : 1 .
fn try_from(data: Vec<u32>) -> Result<Self> {
        if data.len() < 2 {
            return Err(Error::InvalidTLV);
        }
        if data[Self::LEN_OFFSET] % size_of::<u32>() as u32 != 0 {
            return Err(Error::InvalidTLV);
        }
        if data[Self::LEN_OFFSET] / size_of::<u32>() as u32
            > data[Self::VALUE_OFFSET..].len() as u32
        {
            return Err(Error::InvalidTLV);
        }
        Ok(Self { data })
    }
fn try_from ( data : Vec < u32 > ) -> Result < Self > { if data . len ( ) < 2 { return Err ( Error :: InvalidTLV ) ; } if data [ Self :: LEN_OFFSET ] % size_of :: < u32 > ( ) as u32 != 0 { return Err ( Error :: InvalidTLV ) ; } if data [ Self :: LEN_OFFSET ] / size_of :: < u32 > ( ) as u32 > data [ Self :: VALUE_OFFSET .. ] . len ( ) as u32 { return Err ( Error :: InvalidTLV ) ; } Ok ( Self { data } ) }
Constructs a TLV from a vector with the following alsa tlv header validation:
1 .
Constructs a TLV from a vector with the following alsa tlv header validation : 1 .
data
Vec<u32>
data
Vec<u32>