INNER CODE UNIT · Rust

derive_to_glue_row

gluesql/gluesql · macros/src/lib.rs:63

pub fn derive_to_glue_row(input: TokenStream) -> TokenStream {
    let input = parse_macro_input!(input as DeriveInput);
    match to_glue_row::expand_to_glue_row(input) {
        Ok(ts) => TokenStream::from(ts),
        Err(e) => e.to_compile_error().into(),
    }
}

fn parse_glue_rename(attr: &Attribute) -> Option<Result<Option<String>, syn::Error>> {
    if !attr.path().is_ident("glue") {
        return None;
    }
    match attr.parse_args::<MetaNameValue>() {
        Ok(MetaNameValue { path, value, .. }) if path.is_ident("rename") => match value {
            Expr::Lit(ExprLit {
                lit: Lit::Str(s), ..
            }) => Some(Ok(Some(s.value()))),
            other => Some(Err(syn::Error::new(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…