Skip to main content

htl/
lib.rs

1//! htl — Holistic Typed Lua.
2//!
3//! Umbrella crate: everything from [`htl_core`] plus, with the default `macros`
4//! feature, the proc macros from `htl-macros`. Generated code from the macros refers
5//! to `::htl::...`, so depend on this crate (not on `htl-core` directly) when you use
6//! `include_tl!` / `include_tl_bytes!` / `#[derive(TealRecord)]` / `#[host_module]`.
7//!
8//! ```rust,ignore
9//! use htl::{Htl, TealRecord, host_module, include_tl, include_tl_bytes};
10//! ```
11//!
12//! With the `ffi` feature there is a fourth way out, for a caller that is not written in
13//! Rust: the C ABI runtime — the handle, the error slot, the panic guard — and an
14//! attribute that writes one `extern "C"` wrapper per method and the C header, from the
15//! same `impl` block `#[host_module]` reads. Off by default, so a host with no C caller
16//! compiles as it did before. The two are named and linked in the paragraph this page
17//! shows when the feature is on; without it there is nothing on this page to link to, and
18//! a link to an item that is not compiled is a broken one.
19#![cfg_attr(
20    feature = "ffi",
21    doc = "
22That way out is [`ffi`] and [`macro@c_export`]."
23)]
24//!
25//! Nearly everything documented here is defined in [`htl_core`] and re-exported by the
26//! line below, so that is where those pages are written and where a gap in them is filled.
27//! The `deny` under this paragraph holds only what this crate defines itself: `missing_docs`
28//! fires in the crate that *defines* an item, not in the one that re-exports it, so a clean
29//! run here says nothing about `htl_core`'s half of the same public surface. That half is
30//! being closed file by file, and the `deny` goes there when it reaches zero (#224).
31#![deny(missing_docs)]
32
33pub use htl_core::*;
34
35#[cfg(feature = "macros")]
36pub use htl_macros::{TealRecord, host_module, include_bundle, include_tl, include_tl_bytes};
37
38#[cfg(all(feature = "macros", feature = "ffi"))]
39pub use htl_macros::c_export;