pub struct ManagedField {
pub id: FieldId,
pub field: ForceField,
pub ttl: Option<f32>,
pub age: f32,
pub tags: Vec<String>,
pub strength_scale: f32,
pub fade_in: f32,
pub fade_out: f32,
}Expand description
A force field with lifecycle metadata.
Fields§
§id: FieldId§field: ForceField§ttl: Option<f32>None = permanent, Some(seconds) = expires after this duration.
age: f32Seconds this field has been alive.
Tags for grouping/query filtering.
strength_scale: f32Strength multiplier — can be faded over time.
fade_in: f32Fade-in duration (ramps strength from 0 to 1 over this time).
fade_out: f32Fade-out duration (ramps strength from 1 to 0 before expiry).
Implementations§
Source§impl ManagedField
impl ManagedField
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Whether this field has exceeded its TTL.
Sourcepub fn effective_scale(&self) -> f32
pub fn effective_scale(&self) -> f32
Effective strength multiplier accounting for fade-in and fade-out.
Auto Trait Implementations§
impl Freeze for ManagedField
impl RefUnwindSafe for ManagedField
impl Send for ManagedField
impl Sync for ManagedField
impl Unpin for ManagedField
impl UnsafeUnpin for ManagedField
impl UnwindSafe for ManagedField
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.