substrait-extensions 0.87.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`]).
//! - [`extensions`] — the embedded extension YAML files and an [`extensions::EXTENSIONS`]
//!   lookup map.
//! - [`testcases`] — the embedded function test case files.

/// Types generated from the Substrait text-based JSON schemas.
#[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");
}