pub struct Alert {Show 14 fields
pub active_period: Vec<TimeRange>,
pub informed_entity: Vec<EntitySelector>,
pub cause: Option<i32>,
pub effect: Option<i32>,
pub url: Option<TranslatedString>,
pub header_text: Option<TranslatedString>,
pub description_text: Option<TranslatedString>,
pub tts_header_text: Option<TranslatedString>,
pub tts_description_text: Option<TranslatedString>,
pub severity_level: Option<i32>,
pub image: Option<TranslatedImage>,
pub image_alternative_text: Option<TranslatedString>,
pub cause_detail: Option<TranslatedString>,
pub effect_detail: Option<TranslatedString>,
}
Expand description
An alert, indicating some sort of incident in the public transit network.
Fields§
§active_period: Vec<TimeRange>
Time when the alert should be shown to the user. If missing, the alert will be shown as long as it appears in the feed. If multiple ranges are given, the alert will be shown during all of them.
informed_entity: Vec<EntitySelector>
Entities whose users we should notify of this alert.
cause: Option<i32>
§effect: Option<i32>
§url: Option<TranslatedString>
The URL which provides additional information about the alert.
header_text: Option<TranslatedString>
Alert header. Contains a short summary of the alert text as plain-text.
description_text: Option<TranslatedString>
Full description for the alert as plain-text. The information in the description should add to the information of the header.
tts_header_text: Option<TranslatedString>
Text for alert header to be used in text-to-speech implementations. This field is the text-to-speech version of header_text.
tts_description_text: Option<TranslatedString>
Text for full description for the alert to be used in text-to-speech implementations. This field is the text-to-speech version of description_text.
severity_level: Option<i32>
§image: Option<TranslatedImage>
TranslatedImage to be displayed along the alert text. Used to explain visually the alert effect of a detour, station closure, etc. The image must enhance the understanding of the alert. Any essential information communicated within the image must also be contained in the alert text. The following types of images are discouraged : image containing mainly text, marketing or branded images that add no additional information. NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
image_alternative_text: Option<TranslatedString>
Text describing the appearance of the linked image in the image
field (e.g., in case the image can’t be displayed
or the user can’t see the image for accessibility reasons). See the HTML spec for alt image text - https://html.spec.whatwg.org/#alt.
NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
cause_detail: Option<TranslatedString>
Description of the cause of the alert that allows for agency-specific language; more specific than the Cause. If cause_detail is included, then Cause must also be included. NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
effect_detail: Option<TranslatedString>
Description of the effect of the alert that allows for agency-specific language; more specific than the Effect. If effect_detail is included, then Effect must also be included. NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
Implementations§
source§impl Alert
impl Alert
sourcepub fn cause(&self) -> Cause
pub fn cause(&self) -> Cause
Returns the enum value of cause
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn effect(&self) -> Effect
pub fn effect(&self) -> Effect
Returns the enum value of effect
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_effect(&mut self, value: Effect)
pub fn set_effect(&mut self, value: Effect)
Sets effect
to the provided enum value.
sourcepub fn severity_level(&self) -> SeverityLevel
pub fn severity_level(&self) -> SeverityLevel
Returns the enum value of severity_level
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_severity_level(&mut self, value: SeverityLevel)
pub fn set_severity_level(&mut self, value: SeverityLevel)
Sets severity_level
to the provided enum value.
Trait Implementations§
source§impl Message for Alert
impl Message for Alert
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.