lightyear_core/lib.rs
1//! # Lightyear Core
2//!
3//! This crate provides fundamental types and utilities shared across the Lightyear networking library.
4//! It includes core concepts such as:
5//! - Ticking and time management (`tick`, `time`, `timeline`).
6//! - Network identifiers and abstractions (`network`, `id`).
7//! - History buffers for state management (`history_buffer`).
8//! - Core plugin structures (`plugin`).
9
10#![cfg_attr(not(feature = "test_utils"), no_std)]
11
12extern crate alloc;
13extern crate core;
14#[cfg(test)]
15extern crate std;
16
17/// Defines the `Tick` type and related systems for managing discrete time steps.
18pub mod tick;
19
20/// Provides core network-related types and traits.
21pub mod network;
22
23/// Provides `HistoryBuffer` for storing and managing historical state.
24pub mod history_buffer;
25/// Provides types for network identifiers, such as `PeerId` and `NetId`.
26pub mod id;
27/// Defines core plugin structures and related utilities.
28pub mod plugin;
29/// Utilities for time management, including interpolation and synchronization.
30pub mod time;
31/// Defines [`Timeline`](timeline::Timeline) for managing different views of time (local, network).
32pub mod timeline;
33
34pub mod interpolation;
35
36pub mod prediction;
37
38#[cfg(feature = "test_utils")]
39pub mod test;
40
41/// Commonly used items from the `lightyear_core` crate.
42pub mod prelude {
43 pub use crate::interpolation::Interpolated;
44
45 pub use crate::prediction::Predicted;
46
47 pub use crate::id::{LocalId, PeerId, RemoteId};
48 pub use crate::tick::Tick;
49 pub use crate::timeline::{
50 LocalTimeline, NetworkTimeline, NetworkTimelinePlugin, Rollback, SyncEvent, Timeline,
51 is_in_rollback,
52 };
53}