1mod baseline;
21mod delta;
22mod error;
23mod limits;
24mod scratch;
25mod session;
26mod snapshot;
27mod types;
28
29pub use baseline::{BaselineError, BaselineStore};
30pub use delta::{
31 apply_delta_snapshot, apply_delta_snapshot_from_packet, decode_delta_packet,
32 encode_delta_from_changes, encode_delta_snapshot, encode_delta_snapshot_for_client,
33 encode_delta_snapshot_for_client_session,
34 encode_delta_snapshot_for_client_session_with_scratch,
35 encode_delta_snapshot_for_client_with_scratch, encode_delta_snapshot_from_updates,
36 encode_delta_snapshot_with_scratch, select_baseline_tick, DeltaDecoded, DeltaUpdateComponent,
37 DeltaUpdateEntity, SessionEncoder,
38};
39pub use error::{CodecError, CodecResult, LimitKind, MaskKind, MaskReason, ValueReason};
40pub use limits::CodecLimits;
41pub use scratch::CodecScratch;
42pub use session::{
43 decode_session_init_packet, decode_session_packet, encode_session_init_packet,
44 CompactHeaderMode, SessionState,
45};
46pub use snapshot::{
47 decode_full_snapshot, decode_full_snapshot_from_packet, encode_full_snapshot,
48 ComponentSnapshot, EntitySnapshot, FieldValue, Snapshot,
49};
50pub use types::{EntityId, SnapshotTick};
51pub use wire::Limits as WireLimits;
52
53#[cfg(test)]
54mod tests {
55 use super::*;
56
57 #[test]
58 fn public_api_exports() {
59 let _ = SnapshotTick::new(0);
61 let _ = EntityId::new(0);
62 let _ = WireLimits::default();
63 let _ = CodecLimits::default();
64
65 let _: CodecResult<()> = Ok(());
67 }
68
69 #[test]
70 fn snapshot_tick_usage() {
71 let tick = SnapshotTick::new(100);
72 assert_eq!(tick.raw(), 100);
73 assert!(!tick.is_zero());
74 }
75
76 #[test]
77 fn entity_id_usage() {
78 let id = EntityId::new(42);
79 assert_eq!(id.raw(), 42);
80 }
81
82 #[test]
83 fn limits_reexported() {
84 let limits = WireLimits::default();
86 assert!(limits.max_packet_bytes > 0);
87 }
88}