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
//! The trait that marks a type as streamable.
use crateError;
use crateXml;
/// What the stream needs to know about a record type. Implemented by generated code only.
/// A type that [`stream`](super::stream) can deliver one at a time.
///
/// These are the types the standard holds as repeated objects under a publication, directly or
/// inside up to two containers: a [`Situation`](super::situation::Situation) or a
/// [`SituationRecord`](super::situation::SituationRecord) of a situation publication, a
/// [`MeasurementSite`](super::road_traffic_data::MeasurementSite) of a site table, the
/// [`SiteMeasurements`](super::road_traffic_data::SiteMeasurements) of measured data, a
/// [`VmsController`](super::vms::VmsController), an
/// [`EnergyInfrastructureSite`](super::energy_infrastructure::EnergyInfrastructureSite), and so on.
/// [`Publication`](super::Publication) is a record too: streaming it delivers the payloads of a
/// message container one by one. The full list is under "Implementors" below.
///
/// A type that is not held as a repeated record cannot be streamed; the program does not compile:
///
/// ```compile_fail
/// let xml: &[u8] = b"";
/// // A validity is part of a record, never a record of its own.
/// let _ = datex2::v3::stream::<datex2::v3::common::Validity>(xml);
/// ```
///
/// The trait cannot be implemented outside this crate.