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§
§impl AgentId
impl AgentId
pub 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.
pub 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.
pub 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.
pub 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.
pub const fn has_master(&self) -> bool
pub const fn has_master(&self) -> bool
Returns whether the agent has a master.
Trait Implementations§
§impl<'de> Deserialize<'de> for AgentId
impl<'de> Deserialize<'de> for AgentId
§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
§impl Serialize for AgentId
impl Serialize for AgentId
§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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)