covalence_lib_data/lib.rs
1//! Shared byte buffers and containers.
2//!
3//! An internal facade (a crate that re-exports other crates) for Covalence's
4//! own crates. Its API may change without notice.
5//!
6//! - Re-exports [`bytes`], [`hashbrown`], [`indexmap`], [`smallvec`],
7//! [`smol_str`] and [`arrayvec`], with their main types at the root.
8//! - Adds the [`Symbol`] alias.
9//! - `Bytes::copy_from_slice` establishes immutable ownership at an untrusted
10//! boundary. Clones and slices share that owned storage.
11//! - An `IndexMap` keeps insertion order. That is not canonical
12//! [CBOR](https://www.rfc-editor.org/rfc/rfc8949) wire ordering.
13//! - Serialization lives in `covalence-lib-serde`.
14#![deny(missing_docs)]
15
16pub use arrayvec::{ArrayString, ArrayVec};
17pub use bytes::{Buf, BufMut, Bytes, BytesMut};
18pub use hashbrown::HashTable;
19pub use indexmap::{IndexMap, IndexSet};
20pub use smallvec::SmallVec;
21pub use smol_str::SmolStr;
22pub use {arrayvec, bytes, hashbrown, indexmap, smallvec, smol_str};
23
24/// An owned symbol name, stored inline when short and shared when long.
25pub type Symbol = SmolStr;