pub enum Originator {
Unknown,
PrimaryEntryPoint,
CivilAuthority,
NationalWeatherService,
EnvironmentCanada,
BroadcastStation,
}Expand description
SAME message originator code
See MessageHeader::originator().
Originator codes may be also parsed from the SAME
org code and callsign:
use sameplace::Originator;
let orig = Originator::from_org_and_call("WXR", "KLOX/NWS");
assert_eq!(Originator::NationalWeatherService, orig);
// other originators
assert_eq!(Originator::Unknown, Originator::from_org_and_call("HUH", ""));
assert_eq!("CIV", Originator::CivilAuthority.as_code_str());Originators Display a human-readable string:
assert_eq!("National Weather Service", orig.as_display_str());
assert_eq!("National Weather Service", &format!("{}", orig));
assert_eq!("WXR", orig.as_ref());
assert_eq!("WXR", &format!("{:#}", orig));The callsign is required to reliably detect the National Weather Service and/or Environment Canada:
assert_eq!(Originator::EnvironmentCanada,
Originator::from_org_and_call("WXR", "EC/GC/CA"));
assert_eq!("WXR", Originator::EnvironmentCanada.as_code_str());Variants§
Unknown
An unknown (and probably invalid) Originator code
Per NWSI 10-172, receivers should accept any originator code.
PrimaryEntryPoint
Primary Entry Point station for national activations
Nation-wide activations are authorized by the President of the United States. Takes priority over all other messages/station programming.
CivilAuthority
Civil authorities
NationalWeatherService
National Weather Service
EnvironmentCanada
Environment Canada
In Canada, SAME is only transmitted on the Weatheradio Canada radio network to alert weather radios. SAME signals are not transmitted on broadcast AM/FM or cable systems.
This enum variant will only be selected if the sending station’s callsign matches the format of Environment Canada stations.
BroadcastStation
EAS participant (usu. broadcast station)
Implementations§
Source§impl Originator
impl Originator
Sourcepub fn from_org_and_call<S1, S2>(org: S1, call: S2) -> Self
pub fn from_org_and_call<S1, S2>(org: S1, call: S2) -> Self
Construct from originator string and station callsign
Sourcepub fn as_display_str(&self) -> &'static str
pub fn as_display_str(&self) -> &'static str
Human-readable string representation
Converts to a human-readable string, like “Civil authorities.”
Sourcepub fn as_code_str(&self) -> &'static str
pub fn as_code_str(&self) -> &'static str
SAME string representation
Returns the SAME code for this Originator.
Originator::Unknown returns the empty string.
Trait Implementations§
Source§impl AsRef<str> for Originator
impl AsRef<str> for Originator
Source§impl Clone for Originator
impl Clone for Originator
Source§fn clone(&self) -> Originator
fn clone(&self) -> Originator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more