pub fn parse_record(buf: &[u8]) -> ParseResult<'_, Record> {
    let (after_header, header) = parse_header(buf)?;

    if header.raw_type() != crate::TRACING_FORMAT_LOG_RECORD_TYPE {
        return Err(nom::Err::Failure(StreamError::ValueOutOfValidRange));
    }

    let (var_len, timestamp) = le_i64(after_header)?;

    // Remove two word lengths for header and timestamp.
    let remaining_record_len = if header.size_words() >= 2 {
        (header.size_words() - 2) as usize * 8
    } else {
        return Err(nom::Err::Failure(StreamError::ValueOutOfValidRange));
    };

    let (after_record, args_buf) = take(remaining_record_len)(var_len)?;
    let (_, arguments) = many0(parse_argument)(args_buf)?;

    Ok((after_record, Record { timestamp, arguments }))
}
/// Attempt to parse a diagnostic record from the head of this buffer.
Attempt to parse a diagnostic record from the head of this buffer.
Attempt to parse a diagnostic record from the head of this buffer .
pub fn parse_record(buf: &[u8]) -> ParseResult<'_, Record> {
    let (after_header, header) = parse_header(buf)?;
    if header.raw_type() != crate::TRACING_FORMAT_LOG_RECORD_TYPE {
        return Err(nom::Err::Failure(StreamError::ValueOutOfValidRange));
    }
    let (var_len, timestamp) = le_i64(after_header)?;
    // Remove two word lengths for header and timestamp.
    let remaining_record_len = if header.size_words() >= 2 {
        (header.size_words() - 2) as usize * 8
    } else {
        return Err(nom::Err::Failure(StreamError::ValueOutOfValidRange));
    };
    let (after_record, args_buf) = take(remaining_record_len)(var_len)?;
    let (_, arguments) = many0(parse_argument)(args_buf)?;
    Ok((after_record, Record { timestamp, arguments }))
}
pub fn parse_record ( buf : & [ u8 ] ) -> ParseResult < ' _ , Record > { let ( after_header , header ) = parse_header ( buf ) ? ; if header . raw_type ( ) != crate :: TRACING_FORMAT_LOG_RECORD_TYPE { return Err ( nom :: Err :: Failure ( StreamError :: ValueOutOfValidRange ) ) ; } let ( var_len , timestamp ) = le_i64 ( after_header ) ? ; // Remove two word lengths for header and timestamp. let remaining_record_len = if header . size_words ( ) >= 2 { ( header . size_words ( ) - 2 ) as usize * 8 } else { return Err ( nom :: Err :: Failure ( StreamError :: ValueOutOfValidRange ) ) ; } ; let ( after_record , args_buf ) = take ( remaining_record_len ) ( var_len ) ? ; let ( _ , arguments ) = many0 ( parse_argument ) ( args_buf ) ? ; Ok ( ( after_record , Record { timestamp , arguments } ) ) }
Attempt to parse a diagnostic record from the head of this buffer.
Attempt to parse a diagnostic record from the head of this buffer .
buf
&[u8]
buf
&[u8]