Struct Log

Source
pub struct Log { /* private fields */ }
Expand description

A fully processed log file.

Implementations§

Source§

impl Log

Source

pub fn agents(&self) -> &[Agent]

Return all agents present in this log.

Source

pub fn agent_by_addr(&self, addr: u64) -> Option<&Agent>

Return an agent based on its address.

Source

pub fn agent_by_instance_id(&self, instance_id: u16) -> Option<&Agent>

Return an agent based on the instance ID.

Source

pub fn master_agent(&self, addr: u64) -> Option<&Agent>

Return the master agent of the given agent.

  • addr - The address of the agent which to get the master for.
Source

pub fn players(&self) -> impl Iterator<Item = &Agent<Player>>

Return an iterator over all agents that represent player characters.

Source

pub fn characters(&self) -> impl Iterator<Item = &Agent<Character>>

Return an iterator over all agents that are characters.

Source

pub fn gadgets(&self) -> impl Iterator<Item = &Agent<Gadget>>

Return an iterator over all agents that are gadgets.

Source

pub fn boss(&self) -> &Agent

Return the boss agent.

Be careful with encounters that have multiple boss agents, such as Trio and Xera.

§Panics

This function will panic if the boss agent cannot be found. For a more failsafe version, see Log::boss_agents.

Source

pub fn boss_agents(&self) -> Vec<&Agent>

Return all boss agents.

This correctly returns multiple agents on encounters where multiple agents are needed.

Source

pub fn is_boss(&self, addr: u64) -> bool

Check whether the given address is a boss agent.

Source

pub fn encounter_id(&self) -> u16

Returns the encounter id.

Source

pub fn encounter(&self) -> Option<Encounter>

Returns the encounter, if present.

Some logs don’t have an encounter set or have an ID that is unknown to us (for example, if people set up arcdps with custom IDs). Therefore, this method can only return the encounter if we know about it in Encounter.

Source

pub fn analyzer<'s>(&'s self) -> Option<Box<dyn Analyzer + 's>>

Return an analyzer suitable to analyze the given log.

Source

pub fn events(&self) -> &[Event]

Return all events present in this log.

Source

pub fn span(&self) -> u64

Returns the timespan of the log in milliseconds.

The timespan is the time between the first registered event and the last registered event, measured in milliseconds.

Note that this does not necessarily equate to the fight/encounter duration, as arcdps starts logging as soon as you enter combat, but some bosses are still invulnerable (e.g. Ensolyss). It does however give a good idea and is cheap to compute.

In the rare occassions that a log does not have any events, this function will return 0.

Source

pub fn is_generic(&self) -> bool

Check whether this log represents a “generic” log.

A generic log is a log that is not tied to a specific boss ID, but rather is triggered by squad members entering and leaving combat. This is for example the case in WvW logs, which can be identified using this function.

Note that many of the analyzing functions (such as Log::was_rewarded) do not have sensible results for generic functions.

Source

pub fn game_mode(&self) -> Option<GameMode>

Returns the game mode that the log was made in.

Note that if the game mode cannot be determined or is unknown to evtclib, None is returned.

Source§

impl Log

Convenience data accessing funtions for Logs.

The information that is gathered by those functions is “expensive” to compute, as we have to loop through every event. They are not saved in the header, and instead are implemented using special EventKinds. This is not a limitation of evtclib, but rather a result of how arcdps stores the data.

This also means that those functions are fallible because we cannot guarantee that the special events that we’re looking for is actually present in every log file.

Use those functions only if necessary, and prefer to cache the result if it will be reused!

Source

pub fn is_cm(&self) -> bool

Check whether the fight was done with challenge mote activated.

This function always returns false if

  • The fight was done without CM
  • The fight does not have a CM
  • We cannot determine whether the CM was active
  • The boss is not known
Source

pub fn local_start_timestamp(&self) -> Option<u32>

Get the timestamp of when the log was started.

The returned value is a unix timestamp in the local time zone.

If the LogStart event cannot be found, this function returns None.

Source

pub fn local_end_timestamp(&self) -> Option<u32>

Get the timestamp of when the log was ended.

The returned value is a unix timestamp in the local time zone.

If the LogEnd event cannot be found, this function returns None.

Source

pub fn was_rewarded(&self) -> bool

Check if rewards for this fight have been given out.

This can be used as an indication whether the fight was successful (true) or not (false).

If you want to properly determine whether a fight was successful, check the Analyzer::outcome method, which does more sophisticated checks (dependent on the boss).

Source

pub fn errors(&self) -> Vec<&str>

Returns all error strings that were captured.

If no errors were encountered, an empty vec is returned.

Note that those are errors reported verbatim by arcdps, nothing that evtclib produces/interprets.

Source

pub fn build_id(&self) -> Option<u64>

Returns the game’s build id.

If no build id was found, None is returned.

Trait Implementations§

Source§

impl Clone for Log

Source§

fn clone(&self) -> Log

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Log

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Log

§

impl RefUnwindSafe for Log

§

impl Send for Log

§

impl Sync for Log

§

impl Unpin for Log

§

impl UnwindSafe for Log

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.