| 1 | //! An internal crate for `postgres-types`. |
| 2 | |
| 3 | #![recursion_limit = "256"] |
| 4 | extern crate proc_macrorust-analyzer cargo postgres-derive 0.4.9 proc_macro/; |
| 5 | |
| 6 | use proc_macrorust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro crate/::TokenStreamrust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro TokenStream#; |
| 7 | use synrust-analyzer cargo syn 2.0.117 crate/::parse_macro_inputrust-analyzer cargo syn 2.0.117 parse_macro_input/; |
| 8 | |
| 9 | mod acceptsrust-analyzer cargo postgres-derive 0.4.9 accepts/; |
| 10 | mod caserust-analyzer cargo postgres-derive 0.4.9 case/; |
| 11 | mod compositesrust-analyzer cargo postgres-derive 0.4.9 composites/; |
| 12 | mod enumsrust-analyzer cargo postgres-derive 0.4.9 enums/; |
| 13 | mod fromsqlrust-analyzer cargo postgres-derive 0.4.9 fromsql/; |
| 14 | mod overridesrust-analyzer cargo postgres-derive 0.4.9 overrides/; |
| 15 | mod tosqlrust-analyzer cargo postgres-derive 0.4.9 tosql/; |
| 16 | |
| 17 | #[proc_macro_derive(ToSql, attributes(postgres))] |
| 18 | pub fn derive_tosqlrust-analyzer cargo postgres-derive 0.4.9 ToSql:(input: TokenStreamrust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro TokenStream#) -> TokenStreamrust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro TokenStream# { |
| 19 | let input = parse_macro_inputrust-analyzer cargo syn 2.0.117 parse_macro_input/parse_macro_input!!(input); |
| 20 | |
| 21 | tosqlrust-analyzer cargo postgres-derive 0.4.9 tosql/::expand_derive_tosqlrust-analyzer cargo postgres-derive 0.4.9 tosql/expand_derive_tosql().(input) |
| 22 | .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|e| e.to_compile_errorrust-analyzer cargo syn 2.0.117 error/impl#[Error]to_compile_error().()) |
| 23 | .intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 24 | } |
| 25 | |
| 26 | #[proc_macro_derive(FromSql, attributes(postgres))] |
| 27 | pub fn derive_fromsqlrust-analyzer cargo postgres-derive 0.4.9 FromSql:(input: TokenStreamrust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro TokenStream#) -> TokenStreamrust-analyzer cargo proc_macro https://github.com/rust-lang/rust/library/proc_macro TokenStream# { |
| 28 | let input = parse_macro_inputrust-analyzer cargo syn 2.0.117 parse_macro_input/parse_macro_input!!(input); |
| 29 | |
| 30 | fromsqlrust-analyzer cargo postgres-derive 0.4.9 fromsql/::expand_derive_fromsqlrust-analyzer cargo postgres-derive 0.4.9 fromsql/expand_derive_fromsql().(input) |
| 31 | .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|e| e.to_compile_errorrust-analyzer cargo syn 2.0.117 error/impl#[Error]to_compile_error().()) |
| 32 | .intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 33 | } |