lightyear_inputs/
lib.rs

1/*! # Lightyear IO
2
3Low-level IO primitives for the lightyear networking library.
4This crate provides abstractions for sending and receiving raw bytes over the network.
5*/
6#![no_std]
7
8extern crate alloc;
9extern crate core;
10#[cfg(feature = "std")]
11extern crate std;
12
13#[cfg(feature = "client")]
14pub mod client;
15
16pub mod config;
17pub mod input_buffer;
18pub mod input_message;
19pub mod plugin;
20#[cfg(feature = "server")]
21pub mod server;
22
23pub(crate) const HISTORY_DEPTH: u16 = 20;
24
25/// Default channel to send inputs from client to server. This is a Sequenced Unreliable channel.
26/// A marker struct for the default channel used to send inputs from client to server.
27///
28/// This channel is typically configured as a Sequenced Unreliable channel,
29/// suitable for sending frequent, time-sensitive input data where occasional loss
30/// is acceptable and out-of-order delivery is handled by sequencing.
31pub struct InputChannel;
32
33pub mod prelude {
34    pub use crate::InputChannel;
35    pub use crate::config::InputConfig;
36    pub use crate::input_buffer::InputBuffer;
37
38    #[cfg(feature = "client")]
39    pub mod client {
40        pub use crate::client::{ClientInputPlugin, InputSystems};
41    }
42    #[cfg(feature = "server")]
43    pub mod server {
44        pub use crate::server::{
45            InputRebroadcaster, InputSystems, ServerInputConfig, ServerInputPlugin,
46        };
47    }
48}