Skip to main content

labstream_proto/
lib.rs

1//! The LSL protocol state machines.
2//!
3//! This crate holds no input and no output. It takes bytes and events, and it
4//! returns bytes and decisions. Every rule comes from `SPEC.md`, which cites
5//! the pinned oracle.
6//!
7//! The layering matters. liblsl parses a request inside a socket completion
8//! handler (`src/tcp_server.cpp:495-500`), so a test of that parser needs a
9//! network. Here a test calls a function with a byte slice.
10//!
11//! # Modules
12//!
13//! | Module | Holds |
14//! |---|---|
15//! | [`header`] | The header block parser and the status line |
16//! | [`negotiate`](negotiate::negotiate) | The server decision, as a pure function |
17//! | [`feed`] | The data feed state machine, client side |
18//! | [`discovery`] | The shortinfo query and answer |
19//! | [`timesync`] | The time probe and the offset estimator |
20//! | [`canon`] | The canonicalizer for transcript comparison |
21
22#![forbid(unsafe_code)]
23#![deny(missing_docs)]
24
25pub mod canon;
26pub mod discovery;
27pub mod feed;
28pub mod header;
29pub mod negotiate;
30pub mod timesync;
31
32pub use header::{Error, Headers, StatusAction, StatusLine};
33pub use negotiate::{negotiate, Accepted, FeedRequest, Outcome, ServerStream};