bytemuck_derive

Function find_and_parse_helper_attributes

source
pub(crate) fn find_and_parse_helper_attributes<P: Parser + Copy>(
    attributes: &[Attribute],
    name: &str,
    key: &str,
    parser: P,
    example_value: &str,
    invalid_value_msg: &str,
) -> Result<Vec<P::Output>>
Expand description

Find #[name(key = "value")] helper attributes on the struct, and return their "value"s parsed with parser.

Returns an error if any attributes with the given name do not match the expected format. Returns Ok([]) if no attributes with name are found.