#[non_exhaustive]pub struct ResourceEvent {
pub kind: ResourceEventKind,
pub resource_type: u8,
pub amount: f64,
pub current: f64,
pub max: f64,
pub time_ms: u32,
pub source_spell_id: u32,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ResourceEventKind§resource_type: u8§amount: f64§current: f64§max: f64§time_ms: u32§source_spell_id: u32Gain/spend attribution: a spell id, or one of the reserved RESOURCE_SOURCE_* values.
Implementations§
Source§impl ResourceEvent
impl ResourceEvent
pub fn new(observation: ResourceObservation, time_ms: u32) -> Self
Sourcepub const fn with_source(self, source_spell_id: u32) -> Self
pub const fn with_source(self, source_spell_id: u32) -> Self
Attach the gaining/spending spell for per-source economy views.
Trait Implementations§
Source§impl Clone for ResourceEvent
impl Clone for ResourceEvent
Source§fn clone(&self) -> ResourceEvent
fn clone(&self) -> ResourceEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResourceEvent
impl RefUnwindSafe for ResourceEvent
impl Send for ResourceEvent
impl Sync for ResourceEvent
impl Unpin for ResourceEvent
impl UnsafeUnpin for ResourceEvent
impl UnwindSafe for ResourceEvent
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