Skip to main content

zu_common/
lib.rs

1//! Shared identifiers, errors, and constants used by every zu crate.
2//!
3//! The id layout is format-stable and documented in `docs/03-data-model.md`.
4
5pub mod bytes;
6pub mod decimal;
7mod error;
8pub mod gqlstatus;
9mod id;
10pub mod ids;
11mod interrupt;
12pub mod keywords;
13mod order;
14pub mod temporal;
15pub mod types;
16pub mod unicode;
17
18pub use decimal::Decimal;
19pub use error::ZuError;
20pub use gqlstatus::{DiagnosticRecord, GqlStatus, Position, Severity};
21pub use id::{Epoch, GROUP_ROWS, NodeGroupId, NodeId, NodeOffset, RelId, TableId};
22pub use ids::{IdMap, IdSet};
23pub use interrupt::Interrupt;
24pub use order::int_key;
25pub use temporal::{Clock, IntervalField, IntervalQualifier, Temporal};
26pub use types::{
27    DurationKind, Field, FloatBits, IntBits, LogicalType, PathType, PhysicalType, RecordType,
28    type_by_name,
29};
30
31/// Result alias used across the workspace.
32pub type Result<T> = std::result::Result<T, ZuError>;
33
34/// The revision of the C ABI this workspace publishes (dx/02 ยง8).
35///
36/// Here rather than in `zu-capi` because the two things that report it
37/// are the header, which is the ABI's specification, and `zu version`,
38/// which is how a binding asks a build on the PATH what it is. Neither
39/// should have to depend on the other to say one number, and a CLI that
40/// linked the C ABI to read a string would export the whole of it.
41/// `cargo xtask package` holds `ZU_ABI_VERSION` in the header to this.
42pub const C_ABI_VERSION: &str = "0.15";