sheave_core/messages/headers.rs
1//! # The Chunk Headers
2//!
3//! Every chunk has following headers:
4//!
5//! 1. [The Basic Header]
6//! 2. [The Message Header]
7//! 3. [Extended Timestamp]
8//!
9//! ## [The Basic Header]
10//!
11//! This indicates:
12//!
13//! * A pattern of followed message header.
14//! * Which the chunk stream are we in.
15//!
16//! ## [The Message Header]
17//!
18//! This indicates:
19//!
20//! * A timestamp which has passed from its stream started.
21//! * A pattern of followed chunk data.
22//! * Which the message stream are we in.
23//!
24//! This must be depended its format on a value in the basic header.
25//! That is, the message header has following correspondence with the basic header:
26//!
27//! |Number|Expected Format|
28//! | -: | -: |
29//! |`0`|11 bytes|
30//! |`1`|7 bytes|
31//! |`2`|3 bytes|
32//! |`3`|0 bytes|
33//!
34//! ## Extended Timestamp
35//!
36//! This is added when a timestamp in its message header exceeded the 3 bytes range.
37//! In that case, note its field must be filled with `0xFFFFFF (16777215)`.
38//!
39//! [The Basic Header]: BasicHeader
40//! [The Message Header]: MessageHeader
41
42mod basic;
43mod message;
44
45pub use self::{
46 basic::{
47 BasicHeader,
48 MessageFormat
49 },
50 message::{
51 MessageType,
52 MessageHeader,
53 New,
54 SameSource,
55 TimerChange
56 }
57};