arms/core/mod.rs
1//! # Core Domain
2//!
3//! Pure math, no I/O. The foundation of ARMS.
4//!
5//! This module contains the fundamental types and operations:
6//! - `Point` - A position in dimensional space
7//! - `Id` - Unique identifier for placed points
8//! - `Blob` - Raw payload data
9//! - `Proximity` - Trait for measuring relatedness
10//! - `Merge` - Trait for composing points
11//!
12//! ## Design Principles
13//!
14//! - All functions are pure (deterministic, no side effects)
15//! - No I/O operations
16//! - No external dependencies beyond std
17//! - Fully testable in isolation
18
19mod point;
20mod id;
21mod blob;
22pub mod proximity;
23pub mod merge;
24pub mod config;
25
26// Re-exports
27pub use point::Point;
28pub use id::Id;
29pub use blob::Blob;
30
31/// A point that has been placed in the space
32#[derive(Clone)]
33pub struct PlacedPoint {
34 /// Unique identifier
35 pub id: Id,
36 /// Position in dimensional space
37 pub point: Point,
38 /// Attached payload
39 pub blob: Blob,
40}
41
42impl PlacedPoint {
43 /// Create a new placed point
44 pub fn new(id: Id, point: Point, blob: Blob) -> Self {
45 Self { id, point, blob }
46 }
47}
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn test_placed_point_creation() {
55 let id = Id::now();
56 let point = Point::new(vec![1.0, 2.0, 3.0]);
57 let blob = Blob::new(vec![1, 2, 3]);
58
59 let placed = PlacedPoint::new(id, point.clone(), blob);
60
61 assert_eq!(placed.point.dimensionality(), 3);
62 assert_eq!(placed.blob.size(), 3);
63 }
64}