1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Core traits for working with DBN records.
//!
//! - [`Record`]: read-only access to any record's header, size, timestamps, and raw bytes.
//! - [`RecordMut`]: mutable access to the record header.
//! - [`HasRType`]: implemented by concrete record types (e.g. [`MboMsg`](crate::MboMsg)),
//! associates a static `rtype` used for downcasting via [`RecordRef`](crate::RecordRef).
use ts_to_dt;
use crate::;
/// Used for polymorphism around types all beginning with a [`RecordHeader`] where
/// `rtype` is the discriminant used for indicating the type of record.
///
/// All record types are plain old data held in sequential memory, and therefore
/// implement `AsRef<[u8]>` for simple serialization to bytes.
///
/// [`RecordRef`](crate::RecordRef) acts similar to a `&dyn Record`.
/// Used for polymorphism around mutable types beginning with a [`RecordHeader`].
/// An extension of the [`Record`] trait for types with a static [`RType`]. Used for
/// determining if a rtype matches a type.
///
/// Because of the static function requirement, this trait is implemented by all concrete record
/// types like [`MboMsg`](crate::MboMsg), but not by [`RecordRef`](crate::RecordRef), which can reference a record of
/// dynamic type.
///
/// While not _dyn compatible_, [`RecordRef`](crate::RecordRef) acts like a `&dyn HasRType`.