bebytes_derive 2.10.1

A macro to generate/parse binary representation of messages with custom bit fields
Documentation
#[cfg(feature = "std")]
use std::vec::Vec;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

type AttributeData = (
    Option<usize>,
    Option<Vec<proc_macro2::Ident>>,
    Option<crate::size_expr::SizeExpression>,
    Option<u8>, // until_marker
    Option<u8>, // after_marker
);

pub fn parse_attributes_with_expressions(
    attributes: &[syn::Attribute],
    bits_attribute_present: &mut bool,
    errors: &mut Vec<proc_macro2::TokenStream>,
) -> AttributeData {
    match crate::functional::functional_attrs::parse_attributes_functional(attributes) {
        Ok(attr_data) => {
            *bits_attribute_present = attr_data.is_bits_attribute;
            (
                attr_data.size,
                attr_data.field,
                attr_data.size_expression,
                attr_data.until_marker,
                attr_data.after_marker,
            )
        }
        Err(errs) => {
            for e in errs {
                errors.push(e.to_compile_error());
            }
            (None, None, None, None, None)
        }
    }
}