substrait-extensions 0.98.0-alpha

Packaged Substrait Extension Files
Documentation
// SPDX-License-Identifier: Apache-2.0

//! Packaged Substrait extension files.
//!
//! This crate bundles the Substrait specification's extension YAML files, the
//! text-based JSON schemas, and the function test cases, alongside Rust types
//! generated from the schemas with [`typify`](https://docs.rs/typify).
//!
//! Versions of this crate correspond to Substrait
//! [releases](https://github.com/substrait-io/substrait/releases).
//!
//! - [`text`] — types generated from the text schemas (e.g.
//!   [`text::simple_extensions::SimpleExtensions`]), plus the raw schema
//!   sources as consts (e.g. `text::SIMPLE_EXTENSIONS_SCHEMA`) for consumers
//!   that validate raw YAML against the JSON schema.
//! - [`extensions`] — the embedded extension YAML files, the
//!   [`extensions::EXTENSIONS`] map (keyed by file stem to the parsed
//!   extension), and the [`extensions::SIMPLE_EXTENSIONS`] slice (keyed by URN
//!   to the raw YAML source).
//! - [`testcases`] — the embedded function test case files.

/// Types generated from the Substrait text-based JSON schemas, plus the raw
/// schema sources as `&str` consts (e.g. `SIMPLE_EXTENSIONS_SCHEMA`).
#[allow(
    unused_variables,
    clippy::clone_on_copy,
    clippy::derivable_impls,
    clippy::needless_borrow,
    clippy::explicit_auto_deref,
    clippy::to_string_trait_impl,
    clippy::uninlined_format_args
)]
pub mod text {
    include!(concat!(env!("OUT_DIR"), "/substrait_text.rs"));
}

/// The embedded Substrait core extension YAML files.
///
/// The contents of this module are auto-generated by `build.rs` and kept in
/// sync with the packaged extension files.
pub mod extensions {
    include!(concat!(env!("OUT_DIR"), "/extensions.in"));
}

/// The embedded Substrait function test case files.
pub mod testcases {
    use include_dir::{include_dir, Dir};

    /// The directory tree of `.test` function test case files.
    pub static TESTCASES: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/testcases");
}