Skip to main content

khive_types/
lib.rs

1//! khive-types — core primitives and substrate data types.
2//!
3//! `#![no_std]` compatible. Minimal dependencies. No ID generation, no clock
4//! access, no panics. Substrate structs (Note, Entity, Event) are merged into
5//! this crate — they are the data shape that the rest of the runtime operates on.
6
7#![no_std]
8#![forbid(unsafe_code)]
9
10extern crate alloc;
11
12#[cfg(feature = "std")]
13extern crate std;
14
15pub mod edge;
16pub mod entity;
17pub mod error;
18pub mod event;
19pub mod hash;
20pub mod header;
21pub mod id;
22pub mod khive_error;
23pub mod namespace;
24pub mod note;
25pub mod pack;
26pub mod substrate;
27pub mod timestamp;
28pub mod vector;
29
30pub use edge::{EdgeCategory, EdgeRelation};
31pub use entity::{Entity, EntityKind, Link, PropertyValue};
32pub use error::{TypeError, UnknownVariant};
33pub use event::{
34    AggregateRef, ApplyResult, Event, EventBuilder, EventKind, EventOutcome, EventPayload,
35    ProposalAppliedPayload, ProposalDecision, ProposalReviewedPayload, ProposalWithdrawnPayload,
36    RerankExecutedPayload,
37};
38#[cfg(feature = "serde")]
39pub use event::{
40    EntityDraft, NoteDraft, ProposalChangeset, ProposalCreatedPayload, ProposalEntityPatch,
41};
42pub use hash::Hash32;
43pub use header::Header;
44pub use id::{Id128, ParseIdError};
45pub use khive_error::{Details, ErrorCode, ErrorDomain, ErrorKind, KhiveError, RetryHint};
46pub use namespace::Namespace;
47pub use note::{Note, NoteStatus};
48// REASON: `VerbDef` is marked `#[deprecated]` in pack.rs but still re-exported
49// here for callers that have not yet migrated to `HandlerDef`.
50// Remove this allow once all downstream crates are migrated.
51#[allow(deprecated)]
52pub use pack::VerbDef;
53pub use pack::{
54    EdgeEndpointRule, EndpointKind, HandlerDef, NoteKindSpec, NoteLifecycleSpec, Pack,
55    PackSchemaPlan, ParamDef, VerbCategory, VerbPresentationPolicy, Visibility,
56};
57pub use substrate::{SubstrateKind, SUBSTRATE_COUNT};
58pub use timestamp::Timestamp;
59pub use vector::DistanceMetric;