tank-macros 0.19.0

Procedural macros for Tank: the Rust data layer. Not intended to be used directly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::decode_column::ColumnMetadata;
use proc_macro2::TokenStream;
use quote::quote;

pub fn encode_column_ref(metadata: &ColumnMetadata, table: String, schema: String) -> TokenStream {
    let name = &metadata.name;
    quote! {
        ::tank::ColumnRef {
            name: ::std::borrow::Cow::Borrowed(#name),
            table: ::std::borrow::Cow::Borrowed(#table),
            schema: ::std::borrow::Cow::Borrowed(#schema),
        }
    }
}