df-derive-macros 0.4.0

Procedural derive macro implementation for df-derive.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum NestedNamePolicy {
    Field,
    Flatten,
    Prefix(String),
}

impl NestedNamePolicy {
    pub const fn requires_unique_name_validation(&self) -> bool {
        !matches!(self, Self::Field)
    }
}

pub fn column_name_for_ident(ident: &syn::Ident) -> String {
    let name = ident.to_string();
    name.strip_prefix("r#").unwrap_or(&name).to_owned()
}