queryweave-codegen 0.1.0

The code generation behind queryweave's derives, for proc-macro crates with their own naming conventions and integrations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// What the code generated for a `RawValue` value object links to: the runtime crate.
#[derive(Debug, PartialEq, Eq)]
pub struct MappingPaths {
    /// The path of the core runtime crate.
    pub runtime: syn::Path,
}

/// The core runtime crate: the one given by `#[queryweave(crate = path)]`, or
/// the conventions' `C::core_crate()`.
#[must_use]
pub fn generate_paths<C: crate::conventions::Conventions>(
    runtime_crate: Option<syn::Path>,
) -> MappingPaths {
    MappingPaths {
        runtime: runtime_crate.unwrap_or_else(C::core_crate),
    }
}