/// Tries to create a `OperationalDatasetTlvs` instance from the given byte slice.
Tries to create a `OperationalDatasetTlvs` instance from the given byte slice.
Tries to create a ` OperationalDatasetTlvs ` instance from the given byte slice .
pub fn try_from_slice(slice: &[u8]) -> Result<Self, ot::WrongSize> {
        let mut ret = Self::default();
        let len = slice.len();
        if len > OT_OPERATIONAL_DATASET_MAX_LENGTH as usize {
            return Err(ot::WrongSize);
        }
        ret.0.mLength = len.try_into().unwrap();
        ret.0.mTlvs[0..len].clone_from_slice(slice);
        Ok(ret)
    }
pub fn try_from_slice ( slice : & [ u8 ] ) -> Result < Self , ot :: WrongSize > { let mut ret = Self :: default ( ) ; let len = slice . len ( ) ; if len > OT_OPERATIONAL_DATASET_MAX_LENGTH as usize { return Err ( ot :: WrongSize ) ; } ret . 0 . mLength = len . try_into ( ) . unwrap ( ) ; ret . 0 . mTlvs [ 0 .. len ] . clone_from_slice ( slice ) ; Ok ( ret ) }
Tries to create a `OperationalDatasetTlvs` instance from the given byte slice.
Tries to create a ` OperationalDatasetTlvs ` instance from the given byte slice .
slice
&[u8]