# inlean-runtime
Runtime support for the Rust code that [inlean](https://github.com/shergin/inlean) generates
from Lean. Generated code calls into this crate for every primitive that Lean implements in its
C runtime: reference-counted objects, arbitrary-precision `Nat` and `Int`, strings, arrays and
closures. Each such function is a port of the function of the same name in Lean's `lean.h`.
The crate also holds the conversions that move values between Lean and Rust, the Rust values
of opaque and foreign types and of the library's collections, and the Rust functions behind
the operations of `Vec`, `VecDeque`, `HashMap` and `HashSet` in a block.
This crate is an implementation detail of inlean. Its API follows Lean's runtime, not Rust
conventions, and changes with the pinned Lean release: depend on `inlean`, which re-exports
the types user code needs (`Generic`, `Int`, `Nat`, `ParseIntError`, `ParseNatError`, `Pass`,
`Primitive`, `TooLarge`). See the
[guide](https://github.com/shergin/inlean/blob/main/docs/guide/README.md).
## License
MIT OR Apache-2.0. The functions ported from Lean 4's `lean.h` are under the Apache License
2.0; see [NOTICE](https://github.com/shergin/inlean/blob/main/crates/inlean-runtime/NOTICE).