pub struct Log { /* private fields */ }
Expand description
A fully processed log file.
Implementations
sourceimpl Log
impl Log
sourcepub fn agent_by_addr(&self, addr: u64) -> Option<&Agent>
pub fn agent_by_addr(&self, addr: u64) -> Option<&Agent>
Return an agent based on its address.
sourcepub fn agent_by_instance_id(&self, instance_id: u16) -> Option<&Agent>
pub fn agent_by_instance_id(&self, instance_id: u16) -> Option<&Agent>
Return an agent based on the instance ID.
sourcepub fn master_agent(&self, addr: u64) -> Option<&Agent>
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.
sourcepub fn players(&self) -> impl Iterator<Item = &Agent<Player>>
pub fn players(&self) -> impl Iterator<Item = &Agent<Player>>
Return an iterator over all agents that represent player characters.
sourcepub fn characters(&self) -> impl Iterator<Item = &Agent<Character>>
pub fn characters(&self) -> impl Iterator<Item = &Agent<Character>>
Return an iterator over all agents that are characters.
sourcepub fn gadgets(&self) -> impl Iterator<Item = &Agent<Gadget>>
pub fn gadgets(&self) -> impl Iterator<Item = &Agent<Gadget>>
Return an iterator over all agents that are gadgets.
sourcepub fn boss(&self) -> &Agent
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
.
sourcepub fn boss_agents(&self) -> Vec<&Agent>
pub fn boss_agents(&self) -> Vec<&Agent>
Return all boss agents.
This correctly returns multiple agents on encounters where multiple agents are needed.
sourcepub fn encounter_id(&self) -> u16
pub fn encounter_id(&self) -> u16
Returns the encounter id.
sourcepub fn encounter(&self) -> Option<Encounter>
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
.
sourcepub fn analyzer<'s>(&'s self) -> Option<Box<dyn Analyzer + 's>>
pub fn analyzer<'s>(&'s self) -> Option<Box<dyn Analyzer + 's>>
Return an analyzer suitable to analyze the given log.
sourcepub fn span(&self) -> u64
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.
sourcepub fn is_generic(&self) -> bool
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.
sourceimpl Log
impl Log
Convenience data accessing funtions for Log
s.
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 EventKind
s. 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!
sourcepub fn is_cm(&self) -> bool
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
sourcepub fn local_start_timestamp(&self) -> Option<u32>
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
.
sourcepub fn local_end_timestamp(&self) -> Option<u32>
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
.
sourcepub fn was_rewarded(&self) -> bool
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).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnwindSafe for Log
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more