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#[allow(deprecated)]
49pub use pack::VerbDef;
50pub use pack::{
51    EdgeEndpointRule, EndpointKind, HandlerDef, NoteKindSpec, NoteLifecycleSpec, Pack,
52    PackSchemaPlan, ParamDef, VerbCategory, VerbPresentationPolicy, Visibility,
53};
54pub use substrate::{SubstrateKind, SUBSTRATE_COUNT};
55pub use timestamp::Timestamp;
56pub use vector::DistanceMetric;