Skip to main content

axsys_noun/
lib.rs

1//! This library provides a batteries-included [noun] implementation, [Urbit]'s native data
2//! structure.
3//!
4//! # Thread Safety
5//!
6//! By default, this library uses [`std::rc::Rc`] as its reference-counting pointer, which is not
7//! thread-safe. To use this library in a multi-threaded context, enable the `thread-safe` feature,
8//! which will use [`std::sync::Arc`], a thread-safe reference-counting pointer, instead of
9//! [`std::rc::Rc`].
10//!
11//! [Urbit]: https://urbit.org
12//! [noun]: https://urbit.org/docs/glossary/noun
13
14#[doc(hidden)]
15pub mod atom;
16#[doc(hidden)]
17pub mod cell;
18pub mod convert;
19pub mod marker;
20#[doc(hidden)]
21pub mod noun;
22pub mod serdes;
23
24#[doc(hidden)]
25#[cfg(feature = "hoon")]
26pub mod hoon;
27
28pub mod sept;
29
30#[doc(inline)]
31pub use crate::atom::{Atom, Builder as AtomBuilder, Iter as AtomIter};
32#[doc(inline)]
33pub use crate::cell::*;
34#[doc(inline)]
35pub use crate::noun::*;
36
37/// A reference-counting pointer.
38///
39/// Alias for [`std::rc::Rc`] when `thread-safe` feature is disabled.
40#[cfg(not(feature = "thread-safe"))]
41pub type Rc<T> = std::rc::Rc<T>;
42
43/// A reference-counting pointer.
44///
45/// Alias for [`std::sync::Arc`] when `thread-safe` feature is enabled.
46#[cfg(feature = "thread-safe")]
47pub type Rc<T> = std::sync::Arc<T>;