pub struct EitEvent<'a> {
pub event_id: u16,
pub running_status: RunningStatus,
pub free_ca_mode: bool,
pub descriptors: DescriptorLoop<'a>,
/* private fields */
}Expand description
One event in the EIT.
Fields§
§event_id: u1616-bit event_id.
running_status: RunningStatus3-bit running_status (EN 300 468 Table 6).
free_ca_mode: boolfree_CA_mode flag.
descriptors: DescriptorLoop<'a>Descriptor loop for this event. Serializes as the typed descriptor
sequence; .raw() yields the wire bytes.
Implementations§
Source§impl<'a> EitEvent<'a>
impl<'a> EitEvent<'a>
Sourcepub fn start_time(&self) -> Option<MjdBcdDateTime>
pub fn start_time(&self) -> Option<MjdBcdDateTime>
Decode the 40-bit start_time (16-bit MJD + 24-bit BCD UTC) to a plain
date-time struct.
Returns None if the date/time fields are out of range. MJD→calendar
conversion per ETSI EN 300 468 Annex C. Available without the chrono
feature.
Sourcepub fn set_start_time_decoded(&mut self, dt: MjdBcdDateTime) -> Result<()>
pub fn set_start_time_decoded(&mut self, dt: MjdBcdDateTime) -> Result<()>
Set the event start time, encoding it into the 40-bit start_time field.
§Errors
ValueOutOfRange if the date is
outside the representable 16-bit MJD range.
Sourcepub fn duration(&self) -> Option<Duration>
pub fn duration(&self) -> Option<Duration>
Decode the 24-bit BCD duration (HHMMSS) to a core::time::Duration.
Returns None if the BCD nibbles are out of range. Available without the
chrono feature — a duration is a plain elapsed-seconds value.
Sourcepub fn set_duration(&mut self, duration: Duration) -> Result<()>
pub fn set_duration(&mut self, duration: Duration) -> Result<()>
Set the event duration, encoding it into the 24-bit BCD duration field.
§Errors
ValueOutOfRange if the duration
is 100 hours or longer (the HH field holds only two BCD digits).
Sourcepub fn start_time_raw(&self) -> [u8; 5]
pub fn start_time_raw(&self) -> [u8; 5]
Raw 5-byte start_time field (for serialization and round-trip).
Sourcepub fn duration_raw(&self) -> [u8; 3]
pub fn duration_raw(&self) -> [u8; 3]
Raw 3-byte duration field (for serialization and round-trip).
Sourcepub fn new(
event_id: u16,
start_time_raw: [u8; 5],
duration_raw: [u8; 3],
running_status: RunningStatus,
free_ca_mode: bool,
descriptors: DescriptorLoop<'a>,
) -> Self
pub fn new( event_id: u16, start_time_raw: [u8; 5], duration_raw: [u8; 3], running_status: RunningStatus, free_ca_mode: bool, descriptors: DescriptorLoop<'a>, ) -> Self
Construct an EitEvent from raw wire fields.
This is the stable public constructor — the start_time_raw and
duration_raw fields are pub(crate) for in-crate parse/serialize
only.
Source§impl EitEvent<'_>
impl EitEvent<'_>
Sourcepub fn start_time_chrono(&self) -> Option<DateTime<Utc>>
pub fn start_time_chrono(&self) -> Option<DateTime<Utc>>
Decode start_time_raw (16-bit MJD + 24-bit BCD UTC) to a UTC datetime.
Returns None if the date/time fields are out of range. MJD→calendar
conversion per ETSI EN 300 468 Annex C.
Sourcepub fn set_start_time(&mut self, start_time: DateTime<Utc>) -> Result<()>
pub fn set_start_time(&mut self, start_time: DateTime<Utc>) -> Result<()>
Set the event start time, encoding it into the 40-bit start_time field.
§Errors
ValueOutOfRange if the date is
outside the representable 16-bit MJD range.
Trait Implementations§
impl<'a> Eq for EitEvent<'a>
Source§impl<'a> PartialEq for EitEvent<'a>
impl<'a> PartialEq for EitEvent<'a>
impl<'a> StructuralPartialEq for EitEvent<'a>
Source§impl<'a> Yokeable<'a> for EitEvent<'static>
impl<'a> Yokeable<'a> for EitEvent<'static>
Source§type Output = EitEvent<'a>
type Output = EitEvent<'a>
Self with the 'static replaced with 'a, i.e. Self<'a>