clickhouse-arrow-derive 0.2.1

Procedural macros for the clickhouse-arrow crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ast::Container;
use crate::ctxt::Ctxt;

/// Cross-cutting checks that require looking at more than a single attrs
/// object. Simpler checks should happen when parsing and building the attrs.
pub fn check(cx: &Ctxt, cont: &mut Container) { check_from_and_try_from(cx, cont); }

fn check_from_and_try_from(cx: &Ctxt, cont: &mut Container) {
    if cont.attrs.type_from().is_some() && cont.attrs.type_try_from().is_some() {
        cx.error_spanned_by(
            cont.original,
            "#[clickhouse_arrow(from = \"...\")] and #[clickhouse_arrow(try_from = \"...\")] \
             conflict with each other",
        );
    }
}