Struct arcdps::evtc::Agent

source ·
pub struct Agent {
    pub id: usize,
    pub prof: u32,
    pub elite: u32,
    pub is_self: u32,
    pub team: u16,
    /* private fields */
}
Expand description

Represents an agent in a combat event.

Names are available for the duration of the fight. Due to this, this struct is not usable for longer than the function call. If you need it for longer than that, consider converting it to AgentOwned.

let owned = agent.to_owned();
let owned: AgentOwned = agent.into();

Fields§

§id: usize

Unique id.

§prof: u32

Profession of the agent.

§elite: u32

Elite (specialization) of the agent.

§is_self: u32

Whether the agent is self (the local player).

§team: u16

Team the agent is in.

Implementations§

source§

impl Agent

source

pub fn name(&self) -> Option<&str>

Returns the agent’s name.

source

pub fn name_ptr(&self) -> *const c_char

Returns the raw pointer to the agent’s name.

source

pub fn to_owned(self) -> AgentOwned

Converts the Agent to the owned version AgentOwned.

source

pub const fn kind(&self) -> AgentKind

Determines the kind of agent.

Trait Implementations§

source§

impl Debug for Agent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Agent> for AgentOwned

source§

fn from(agent: Agent) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Agent

§

impl RefUnwindSafe for Agent

§

impl !Send for Agent

§

impl !Sync for Agent

§

impl Unpin for Agent

§

impl UnwindSafe for Agent

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.