eshanized_polaris_core/
lib.rs

1//! # Polaris Core
2//!
3//! Core runtime and implementation for the Polaris distributed compute framework.
4//!
5//! This crate provides the fundamental building blocks for distributed task execution:
6//! - Task model and lifecycle management
7//! - Node discovery and registration
8//! - Pluggable schedulers
9//! - Network transport (QUIC/TLS/gRPC)
10//! - State replication
11//! - Observability and metrics
12//!
13//! ## Architecture
14//!
15//! ```text
16//! ┌─────────────────────────────────────────────────────────┐
17//! │                    Cluster API                          │
18//! ├─────────────────────────────────────────────────────────┤
19//! │  Scheduler  │  Task Manager  │  Node Registry           │
20//! ├─────────────────────────────────────────────────────────┤
21//! │         Network Layer (QUIC/TLS/gRPC)                   │
22//! ├─────────────────────────────────────────────────────────┤
23//! │    Storage (In-Memory / RocksDB / Sled)                 │
24//! └─────────────────────────────────────────────────────────┘
25//! ```
26//!
27//! ## Example
28//!
29//! ```rust,no_run
30//! use polaris_core::prelude::*;
31//!
32//! # async fn example() -> PolarisResult<()> {
33//! // Create a cluster
34//! let cluster = Cluster::builder()
35//!     .with_local_node()
36//!     .build()
37//!     .await?;
38//!
39//! // Submit a task
40//! let result = cluster.submit(my_task).await?;
41//! # Ok(())
42//! # }
43//! # async fn my_task() -> PolarisResult<()> { Ok(()) }
44//! ```
45
46#![forbid(unsafe_code)]
47#![warn(
48    missing_docs,
49    rust_2018_idioms,
50    unreachable_pub,
51    missing_debug_implementations
52)]
53#![cfg_attr(docsrs, feature(doc_cfg))]
54
55pub mod cluster;
56pub mod config;
57pub mod dag;
58pub mod errors;
59pub mod executor;
60pub mod net;
61pub mod node;
62pub mod observability;
63pub mod scheduler;
64pub mod security;
65pub mod serialization;
66pub mod storage;
67pub mod task;
68
69pub mod prelude {
70    //! Convenient re-exports for common types and traits.
71
72    pub use crate::cluster::{Cluster, ClusterBuilder};
73    pub use crate::config::{ClusterConfig, NodeConfig};
74    pub use crate::errors::{PolarisError, PolarisResult};
75    pub use crate::executor::Executor;
76    pub use crate::node::{Node, NodeId, NodeInfo, NodeStatus};
77    pub use crate::scheduler::{LoadAwareScheduler, RoundRobinScheduler, Scheduler};
78    pub use crate::task::{Task, TaskHandle, TaskId, TaskStatus};
79}
80
81// Re-export common types at crate root
82pub use errors::{PolarisError, PolarisResult};
83pub use prelude::*;