pub struct EntityIDRecord {
pub simulation_address_record: SimulationAddressRecord,
pub entity_identifier_field: u16,
}
Expand description
Entity ID Record as defined in IEEE 1278.1 standard. Used to communicate the ID of an entity during the simulation.
Fields§
§simulation_address_record: SimulationAddressRecord
§entity_identifier_field: u16
Implementations§
Source§impl EntityIDRecord
impl EntityIDRecord
Sourcepub fn new(
site_identifier_field: u16,
application_identifier_field: u16,
entity_identifier_field: u16,
) -> Self
pub fn new( site_identifier_field: u16, application_identifier_field: u16, entity_identifier_field: u16, ) -> Self
Provides a function to create a new EntityIDRecord. Enforces all entity IDs must be non-zero.
§Examples
Creating a new EntityIDRecord at site 1, on application 1, with entity ID 1:
let entity_id_record = EntityIDRecord::new{
site_identifier_field: 1,
application_identifier_field: 1
entity_identifier_field: 1
};
Sourcepub fn default(entity_identifier: u16) -> Self
pub fn default(entity_identifier: u16) -> Self
Provides a function to create a default EntityIDRecord. Uses the default SimulationAddressRecord. Enforces all entity IDs must be non-zero.
§Examples
Creating a default EntityIDRecord with event ID 2:
let entity_id_record = EntityIDRecord::default(2);
Sourcepub fn serialize(&self, buf: &mut BytesMut)
pub fn serialize(&self, buf: &mut BytesMut)
Fills a BytesMut struct with a EntityIDRecord serialised into binary. This buffer is then ready to be sent via UDP to the simluation network.
pub fn decode(buf: &mut BytesMut) -> EntityIDRecord
Trait Implementations§
Source§impl Clone for EntityIDRecord
impl Clone for EntityIDRecord
Source§fn clone(&self) -> EntityIDRecord
fn clone(&self) -> EntityIDRecord
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 EntityIDRecord
impl Debug for EntityIDRecord
Source§impl Default for EntityIDRecord
impl Default for EntityIDRecord
Source§fn default() -> EntityIDRecord
fn default() -> EntityIDRecord
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EntityIDRecord
impl<'de> Deserialize<'de> for EntityIDRecord
Source§fn 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
Source§impl PartialEq for EntityIDRecord
impl PartialEq for EntityIDRecord
Source§impl Serialize for EntityIDRecord
impl Serialize for EntityIDRecord
impl Copy for EntityIDRecord
impl StructuralPartialEq for EntityIDRecord
Auto Trait Implementations§
impl Freeze for EntityIDRecord
impl RefUnwindSafe for EntityIDRecord
impl Send for EntityIDRecord
impl Sync for EntityIDRecord
impl Unpin for EntityIDRecord
impl UnwindSafe for EntityIDRecord
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