asdf_core/lib.rs
1//! The ASDF engine: file layout, binary blocks, and the tree.
2//!
3//! This crate holds all the behaviour. The C ABI shim (`libasdf-rs`) and the
4//! idiomatic Rust API (`asdf`) are both thin projections of it, so the two
5//! public faces cannot drift apart in semantics. Nothing here knows about C.
6
7// The engine is safe Rust with exactly one exception: memory-mapping a file
8// for reading, which no safe API can express. `deny` rather than `forbid` so
9// that one use can be allowed explicitly and reviewed on sight; every
10// `#[allow(unsafe_code)]` in this crate must carry a justification.
11#![deny(unsafe_code)]
12
13// Named so `alloc::` paths can be written directly. The crate links `std`,
14// but spelling each item at the narrowest layer that defines it keeps a
15// future `no_std` build a small step away.
16extern crate alloc;
17
18pub mod block;
19pub mod compression;
20pub mod core;
21pub mod error;
22pub mod events;
23pub mod info;
24pub mod layout;
25pub mod reader;
26pub mod version;
27pub mod writer;
28
29/// The ASDF YAML layer: document model, parser and emitter.
30///
31/// Re-exported so that crates layered on the engine -- the C ABI shim and the
32/// idiomatic API -- have a single dependency edge rather than needing to
33/// track `asdf-yaml`'s version themselves.
34pub use asdf_yaml as yaml;
35
36pub use error::{Error, ErrorCode, Result};
37pub use layout::{Layout, scan};
38pub use reader::{ChecksumStatus, Reader};
39pub use version::Version;
40pub use writer::{PendingBlock, WriteOptions, Writer};