libspecr/
lib.rs

1//! `libspecr` is the standard library of specr lang.
2
3#![warn(missing_docs)]
4
5// We need nightly features since we want to imbue `NdResult` with `?` behavior,
6// and we want to be able to call `Result`-returning functions from inside
7// `NdResult` seamlessly.
8#![feature(try_trait_v2)]
9#![feature(try_trait_v2_yeet)]
10#![feature(try_trait_v2_residual)]
11#![feature(decl_macro)]
12#![feature(iterator_try_collect)]
13#![feature(step_trait)]
14
15// Re-export the derive macro so reverse dependencies can use it
16// without directly depending on gccompat_derive.
17pub use gccompat_derive::GcCompat;
18
19mod int;
20pub use int::*;
21
22mod option;
23
24mod ndresult;
25pub use ndresult::*;
26
27mod ret;
28pub use ret::*;
29
30mod size;
31pub use size::*;
32
33mod align;
34pub use align::*;
35
36mod list;
37pub use list::*;
38
39mod set;
40pub use set::*;
41
42mod map;
43pub use map::*;
44
45mod write;
46pub use write::*;
47
48mod string;
49pub use string::*;
50
51mod name;
52pub use name::*;
53
54mod nondet;
55pub use nondet::*;
56
57mod distribution;
58pub use distribution::*;
59
60mod endianness;
61
62mod mutability;
63
64mod signedness;
65use signedness::*;
66
67mod gc;
68use gc::*;
69
70mod obj;
71use obj::*;
72
73#[doc(hidden)]
74pub mod hidden {
75    pub use crate::obj::*;
76    pub use crate::gc::{GcCow, GcCompat, mark_and_sweep, clear};
77}
78
79/// The items from this module are automatically imported.
80pub mod prelude {
81    pub use crate::ret;
82    pub use crate::Align;
83    pub use crate::Size;
84    pub use crate::Int;
85    pub use crate::list::*;
86    pub use crate::set::*;
87    pub use crate::map::*;
88    pub use crate::write::*;
89    pub use crate::endianness::*;
90    pub use crate::mutability::*;
91    pub use crate::signedness::*;
92    pub use crate::string::{String, format};
93    pub use crate::nondet::{pick, predict};
94    pub use crate::option::*;
95}
96
97// This exists so that `gccompat-derive` can use `libspecr::hidden::GcCompat` to address GcCompat,
98// whether it's used within libspecr or not.
99pub(crate) use crate as libspecr;