pub struct AgentId {
pub id: u64,
pub instance_id: u16,
pub master_instance_id: u16,
}
Expand description
Ids for an agent.
Fields§
§id: u64
Agent id as assigned by Arc.
instance_id: u16
Instance id of the agent as appears in game at time of event.
master_instance_id: u16
If agent has a master (e.g. is minion), will be equal to instance id of master, zero otherwise.
Implementations§
source§impl AgentId
impl AgentId
sourcepub const fn new(id: u64, instance_id: u16, master_instance_id: u16) -> AgentId
pub const fn new(id: u64, instance_id: u16, master_instance_id: u16) -> AgentId
Creates new agent id information.
sourcepub const fn without_master(id: u64, instance_id: u16) -> AgentId
pub const fn without_master(id: u64, instance_id: u16) -> AgentId
Creates new agent id information without a master.
sourcepub const fn from_src(event: &Event) -> AgentId
pub const fn from_src(event: &Event) -> AgentId
Creates new agent id information from the Event
source agent.
sourcepub const fn from_dst(event: &Event) -> AgentId
pub const fn from_dst(event: &Event) -> AgentId
Creates new agent id information from the Event
destination agent.
sourcepub const fn has_master(&self) -> bool
pub const fn has_master(&self) -> bool
Returns whether the agent has a master.
Trait Implementations§
source§impl<'de> Deserialize<'de> for AgentId
impl<'de> Deserialize<'de> for AgentId
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<AgentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<AgentId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for AgentId
impl Serialize for AgentId
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for AgentId
impl RefUnwindSafe for AgentId
impl Send for AgentId
impl Sync for AgentId
impl Unpin for AgentId
impl UnwindSafe for AgentId
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