Skip to main content

get_attribute_arg

Function get_attribute_arg 

Source
pub fn get_attribute_arg(
    needle: &str,
    arg: &str,
    attributes: &[Attribute],
) -> Option<String>
Expand description

Get the value matching an attribute and argument combination

For #[serde(tag = “type”)], get_attribute_arg(“serde”, “tag”, attributes) will return Some(“type”) For #[derive(Serialize_repr)], get_attribute_arg(“derive”, “Serialize_repr”, attributes) will return Some(“Serialize_repr”)