pub enum Message {
StartOfMessage(MessageHeader),
EndOfMessage,
}Expand description
A fully-decoded SAME/EAS message
In order to automatically disseminate alerts, SAME/EAS wraps a
voice message in digital data. The digital data demarcates the
StartOfMessage and the
EndOfMessage. Again, the digital data
is not the message. The “message” in EAS is the voice message
that is intended for a human listener.
With that said, the digital headers provide a good deal of information about the message.
-
The
StartOfMessagecontains digital codes and timestamps which summarize the audio message to follow. Some messages are intended for either silent or audible tests. Others report actual emergencies; these either may or must interrupt normal broadcast programming. -
The voice message immediately follows. The voice message may be up to two minutes long and is intended for streaming playback. This datatype does not represent the audio.
-
The
EndOfMessagedemarcates the end of the audio message.
Message implements Display and efficient conversion to
&str. These methods output the wireline text representation,
such as “ZCZC-...” for StartOfMessage and NNNN for
EndOfMessage.
More information on the SAME/EAS standard may be found in,
- “NOAA Weather Radio (NWR) All Hazards Specific Area Message Encoding (SAME),” NWSI 10-172, 3 Oct. 2011, https://www.nws.noaa.gov/directives/sym/pd01017012curr.pdf
Variants§
StartOfMessage(MessageHeader)
Indicates start of audio message
A StartOfMessage indicates that a SAME/EAS audio
message immediately follows. The message
header contains the event
type, affected areas, time extents, and originator
information.
For broadcast stations, the in-band audio which immediately
follows the StartOfMessage may break station
programming and be aired directly to listeners.
EndOfMessage
Indicates end of audio message
An EndOfMessage marks the conclusion of the SAME/EAS
audio message. For broadcast stations, it is an
indication that normal programming may resume.
Implementations§
Source§impl Message
impl Message
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Wireline Text Representation
Outputs UTF-8 string representation: i.e., ZCZC-...
for start-of-message or NNNN for end-of-message.
Sourcepub fn parity_error_count(&self) -> usize
pub fn parity_error_count(&self) -> usize
Count of parity errors
The number of bit errors which were corrected by the 2-of-3 parity correction algorithm. High parity error counts indicate a high bit error rate in the receiving system.
Parity errors are not tracked for the EndOfMessage
variant. Parity errors are only tracked within sameold
and aren’t available for Messages constructed from
string.
Sourcepub fn voting_byte_count(&self) -> usize
pub fn voting_byte_count(&self) -> usize
Number of bytes which were bit-voted
voting_byte_count is the total number of bytes which were
checked via the “two of three” bitwise voting algorithm—i.e.,
the total number of bytes for which all three SAME bursts were
available.
Voting counts are not tracked for the EndOfMessage
variant. Voting counts are only tracked within sameold
and aren’t available for Messages constructed from string.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.