Skip to main content

vest_lib/
lib.rs

1//! # `vest_lib`
2//!
3//! `vest_lib` is Vest's format combinator
4//! library verified in [Verus](https://github.com/verus-lang/verus).
5//! A format in Vest is organized in three layers:
6//!
7//! - pure parsing, serialization, byte-length, and consistency specifications
8//!   in [`core::spec`];
9//! - executable parsing and serialization APIs in [`core::exec`]; and
10//! - correctness and security theorems in [`core::proof`].
11//!
12//! ## Where to start
13//!
14//! - [`core`] includes Vest's core specs as well as the runtime API and buffer abstractions.
15//! - [`combinators`] documents all the primitive and higher-order formats.
16//! - [`asn1`] contains modular DER and BER formats.
17//! - [`cbor`] provides generic CBOR formats for both general and deterministic profiles.
18//! - [`primitives`] contains reusable variable-width integer formats.
19//!
20//! See the [Vest guide](https://secure-foundations.github.io/vest/guide/) for more background and
21//! gentle introductions.
22//!
23#![cfg_attr(not(feature = "std"), no_std)]
24#![cfg_attr(verus_only, feature(never_type))]
25#![allow(unused_imports)]
26#![allow(dead_code)]
27// Enable once proof-internal helper items are hidden from the public rustdoc surface.
28// #![warn(missing_docs)]
29
30#[cfg(feature = "alloc")]
31extern crate alloc;
32
33// Unit tests run on a host with `std` even when checking the library's core-only feature set.
34// Import its macros so allocation-free APIs can still be exercised by ordinary test fixtures.
35#[cfg(all(test, not(feature = "std")))]
36#[macro_use]
37extern crate std;
38
39/// An uninhabitable type used to represent impossible values (e.g., in [`combinators::Void`]).
40pub type Never = combinators::marker::exec::ExecNever;
41
42pub mod asn1;
43#[cfg(feature = "alloc")]
44pub mod cbor;
45pub mod combinators;
46pub mod core;
47pub mod macros;
48pub mod primitives;