Skip to main content

katra_core/
lib.rs

1//! katra-core — the shared vocabulary of Katra3D.
2//!
3//! Every other crate builds on the types defined here so that the semantic
4//! request graph, the trace format, the profiler, the reporters, and the
5//! runtime subsystems can cooperate directly without FFI boundaries.
6//!
7//! This crate intentionally contains **no unsafe code** and **no I/O**.
8//! It is the vocabulary, the error model, and the policy types.
9//!
10//! # Format stability discipline
11//!
12//! Several types here are serialized into the Katra trace format
13//! (`katra-trace`). Enum layouts are serialized by variant index, therefore:
14//!
15//! * **Append-only evolution**: new enum variants must be appended at the end.
16//! * Any layout-affecting change must bump the trace format version and/or the
17//!   schema hash (see `katra-trace::header`).
18
19#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21
22pub mod config;
23pub mod deadline;
24pub mod error;
25pub mod event;
26pub mod hash;
27pub mod ids;
28pub mod kind;
29pub mod payload;
30pub mod scope;
31pub mod subsystem;
32pub mod time;
33pub mod version;
34
35pub use config::{CaptureOptions, HardwareProfile};
36pub use deadline::DeadlineClass;
37pub use error::{ErrorCategory, KatraError, Result};
38pub use event::{EmitOpts, TraceEvent};
39pub use hash::{fnv1a, fnv1a_combine, fnv1a_parts, fnv1a_str};
40pub use ids::{AllocId, ArenaId, Epoch, FileKey, OpId, RequestId, ResourceRef, Seq, SpanId};
41pub use kind::{D3d12Call, EventKind, Phase, VulkanCall};
42pub use payload::{
43    CachePayload, D3d12Payload, DecompressPayload, FilePayload, GpuPayload, IoPayload,
44    KatraPayload, MemPayload, Payload, PresentPayload, RawPayload, ShaderPayload, SyncPayload,
45    ThreadPayload, VulkanPayload,
46};
47pub use scope::Scope;
48pub use subsystem::{PromotionState, Subsystem};
49pub use time::{monotonic_now_ns, wall_now_ns};
50pub use version::KATRA_VERSION;