Struct EffectStatus

Source
pub struct EffectStatus {
    pub spec: EffectSpec,
    pub remaining_seconds: f64,
    pub stacks: u8,
    pub periodic_elapsed_seconds: Option<f64>,
}
Expand description

A copied view of one active effect; editing it cannot change the set.

Times retain the simulation’s f64 precision. See the module example for inspection alongside periodic pulses.

Fields§

§spec: EffectSpec

The currently applied specification. Its duration is the last accepted specification’s duration, not the effect’s age or total lifetime.

§remaining_seconds: f64

Simulation seconds until expiry. This may exceed spec.seconds after a duration refresh or reapplication of a shorter specification.

§stacks: u8

Number of active stacks, including the first application.

§periodic_elapsed_seconds: Option<f64>

Elapsed seconds in the current pulse interval, or None for a nonperiodic effect. Refreshes preserve this phase.

Implementations§

Source§

impl EffectStatus

Source

pub fn periodic_progress(&self) -> Option<f64>

Fraction of the current pulse interval elapsed, or None for a nonperiodic effect. Views returned by the set yield a value in [0, 1).

Source

pub fn seconds_until_pulse(&self) -> Option<f64>

Seconds to the next pulse boundary, or None for a nonperiodic effect. This does not guarantee another pulse: the effect may expire first. Inspection does not advance time or consume a pulse.

Trait Implementations§

Source§

impl Clone for EffectStatus

Source§

fn clone(&self) -> EffectStatus

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 EffectStatus

Source§

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

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

impl PartialEq for EffectStatus

Source§

fn eq(&self, other: &EffectStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for EffectStatus

Source§

impl StructuralPartialEq for EffectStatus

Auto Trait Implementations§

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.