pub struct EventIDRecord {
pub simulation_address_record: SimulationAddressRecord,
pub event_identifier_field: u16,
}
Expand description
Event ID Record as defined in IEEE 1278.1 standard. Used to communicate the ID of an event during the simulation.
Fields§
§simulation_address_record: SimulationAddressRecord
§event_identifier_field: u16
Implementations§
Source§impl EventIDRecord
impl EventIDRecord
Sourcepub fn new(
site_identifier_field: u16,
application_identifier_field: u16,
event_identifier_field: u16,
) -> Self
pub fn new( site_identifier_field: u16, application_identifier_field: u16, event_identifier_field: u16, ) -> Self
Provides a function to create a new EventIDRecord.
§Examples
Creating a new EventIDRecord at site 1, on application 1, with event ID 1:
let event_id_record = EventIDRecord::new{
site_identifier_field: 1,
application_identifier_field: 1
event_identifier_field: 1
};
Sourcepub fn default(event_identifier: u16) -> Self
pub fn default(event_identifier: u16) -> Self
Provides a function to create a default EventIDRecord. Uses the default SimulationAddressRecord.
§Examples
Creating a default EventIDRecord with event ID 2:
let event_id_record = EventIDRecord::default(2);
Sourcepub fn serialize(&self, buf: &mut BytesMut)
pub fn serialize(&self, buf: &mut BytesMut)
Fills a BytesMut struct with a EventIDRecord serialised into binary. This buffer is then ready to be sent via UDP to the simluation network.
pub fn decode(buf: &mut BytesMut) -> EventIDRecord
Trait Implementations§
Source§impl Clone for EventIDRecord
impl Clone for EventIDRecord
Source§fn clone(&self) -> EventIDRecord
fn clone(&self) -> EventIDRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EventIDRecord
impl Debug for EventIDRecord
Source§impl Default for EventIDRecord
impl Default for EventIDRecord
Source§fn default() -> EventIDRecord
fn default() -> EventIDRecord
Returns the “default value” for a type. Read more
impl Copy for EventIDRecord
Auto Trait Implementations§
impl Freeze for EventIDRecord
impl RefUnwindSafe for EventIDRecord
impl Send for EventIDRecord
impl Sync for EventIDRecord
impl Unpin for EventIDRecord
impl UnwindSafe for EventIDRecord
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
Mutably borrows from an owned value. Read more