Struct libits_client::reception::exchange::decentralized_environmental_notification_message::DecentralizedEnvironmentalNotificationMessage
source · [−]pub struct DecentralizedEnvironmentalNotificationMessage {
pub protocol_version: u8,
pub station_id: u32,
pub management_container: ManagementContainer,
pub situation_container: Option<SituationContainer>,
pub location_container: Option<LocationContainer>,
pub alacarte_container: Option<AlacarteContainer>,
}Fields
protocol_version: u8station_id: u32management_container: ManagementContainersituation_container: Option<SituationContainer>location_container: Option<LocationContainer>alacarte_container: Option<AlacarteContainer>Implementations
sourceimpl DecentralizedEnvironmentalNotificationMessage
impl DecentralizedEnvironmentalNotificationMessage
sourcepub fn new_stationary_vehicle(
station_id: u32,
originating_station_id: u32,
event_position: ReferencePosition,
sequence_number: u16,
etsi_timestamp: u128,
event_position_heading: Option<u16>
) -> Self
pub fn new_stationary_vehicle(
station_id: u32,
originating_station_id: u32,
event_position: ReferencePosition,
sequence_number: u16,
etsi_timestamp: u128,
event_position_heading: Option<u16>
) -> Self
Create a new DecentralizedEnvironmentalNotificationMessage of cause 94 (Stationary Vehicle).
Arguments
station_id: the station idoriginating_station_id: the originating station idevent_position: the reference position of the eventsequence_number: the sequence numberetsi_timestamp: the timestamp on ETSI formatevent_position_heading: the heading of the reference position of he event
returns: DecentralizedEnvironmentalNotificationMessage The Stationary Vehicle DENM built using the provided elements.
Examples
use crate::reception::exchange::reference_position::ReferencePosition; let reference_timestamp = now() as u64; let denm = DecentralizedEnvironmentalNotificationMessage::new_stationary_vehicle(
pub fn new_traffic_condition(
station_id: u32,
originating_station_id: u32,
event_position: ReferencePosition,
sequence_number: u16,
etsi_timestamp: u128,
subcause: Option<u8>,
relevance_distance: Option<u8>,
relevance_traffic_direction: Option<u8>,
event_speed: Option<u16>,
event_position_heading: Option<u16>
) -> Self
pub fn is_stationary_vehicle(&self) -> bool
pub fn is_traffic_condition(&self) -> bool
Trait Implementations
sourceimpl Clone for DecentralizedEnvironmentalNotificationMessage
impl Clone for DecentralizedEnvironmentalNotificationMessage
sourcefn clone(&self) -> DecentralizedEnvironmentalNotificationMessage
fn clone(&self) -> DecentralizedEnvironmentalNotificationMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Default for DecentralizedEnvironmentalNotificationMessage
impl Default for DecentralizedEnvironmentalNotificationMessage
sourcefn default() -> DecentralizedEnvironmentalNotificationMessage
fn default() -> DecentralizedEnvironmentalNotificationMessage
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for DecentralizedEnvironmentalNotificationMessage
impl<'de> Deserialize<'de> for DecentralizedEnvironmentalNotificationMessage
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Mobile for DecentralizedEnvironmentalNotificationMessage
impl Mobile for DecentralizedEnvironmentalNotificationMessage
fn mobile_id(&self) -> u32
fn position(&self) -> &ReferencePosition
fn speed(&self) -> Option<u16>
fn heading(&self) -> Option<u16>
fn stopped(&self) -> bool
fn heading_in_degrees(&self) -> Option<f64>
fn speed_in_meter_per_second(&self) -> Option<f64>
fn speed_in_kilometer_per_hour(&self) -> Option<f64>
sourceimpl PartialEq<DecentralizedEnvironmentalNotificationMessage> for DecentralizedEnvironmentalNotificationMessage
impl PartialEq<DecentralizedEnvironmentalNotificationMessage> for DecentralizedEnvironmentalNotificationMessage
impl Eq for DecentralizedEnvironmentalNotificationMessage
Auto Trait Implementations
impl RefUnwindSafe for DecentralizedEnvironmentalNotificationMessage
impl Send for DecentralizedEnvironmentalNotificationMessage
impl Sync for DecentralizedEnvironmentalNotificationMessage
impl Unpin for DecentralizedEnvironmentalNotificationMessage
impl UnwindSafe for DecentralizedEnvironmentalNotificationMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more