drt-sc-derive 0.0.1

DharitriOne smart contract API procedural macros
Documentation
1
2
3
4
5
6
7
8
9
10
11
use super::{attr_names::ATTR_LABEL, util::is_attr_one_string_arg};

pub struct LabelAttribute {
    pub label: String,
}

impl LabelAttribute {
    pub fn parse(attr: &syn::Attribute) -> Option<Self> {
        is_attr_one_string_arg(attr, ATTR_LABEL).map(|arg_str| LabelAttribute { label: arg_str })
    }
}