Struct dis_rust::common::entity_id_record::EntityIDRecord
source · [−]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
sourceimpl 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
sourceimpl Clone for EntityIDRecord
impl Clone for EntityIDRecord
sourcefn clone(&self) -> EntityIDRecord
fn clone(&self) -> EntityIDRecord
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 Debug for EntityIDRecord
impl Debug for EntityIDRecord
sourceimpl Default for EntityIDRecord
impl Default for EntityIDRecord
sourcefn default() -> EntityIDRecord
fn default() -> EntityIDRecord
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for EntityIDRecord
impl<'de> Deserialize<'de> for EntityIDRecord
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 PartialEq<EntityIDRecord> for EntityIDRecord
impl PartialEq<EntityIDRecord> for EntityIDRecord
sourcefn eq(&self, other: &EntityIDRecord) -> bool
fn eq(&self, other: &EntityIDRecord) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl Serialize for EntityIDRecord
impl Serialize for EntityIDRecord
impl Copy for EntityIDRecord
impl StructuralPartialEq for EntityIDRecord
Auto Trait Implementations
impl RefUnwindSafe for EntityIDRecord
impl Send for EntityIDRecord
impl Sync for EntityIDRecord
impl Unpin for EntityIDRecord
impl UnwindSafe for EntityIDRecord
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