pub struct ComponentSlot {
pub kind: ComponentKind,
pub enabled: bool,
pub properties: Value,
}Expand description
A single attached component with typed kind and Waymark-style property bag. Properties are key-value pairs that the ESCG runtime evaluates per-tick.
Fields§
§kind: ComponentKind§enabled: bool§properties: ValueProperties bag: Waymark script fields, physics params, emitter config, etc. Serialized as JSON for portability across editor / runtime / server.
Implementations§
Source§impl ComponentSlot
impl ComponentSlot
pub fn new(kind: ComponentKind) -> Self
Sourcepub fn set_property(&mut self, key: &str, value: Value) -> Result<(), String>
pub fn set_property(&mut self, key: &str, value: Value) -> Result<(), String>
Set a named property. Bounded: max 256 properties per component.
pub fn get_property(&self, key: &str) -> Option<&Value>
Trait Implementations§
Source§impl Clone for ComponentSlot
impl Clone for ComponentSlot
Source§fn clone(&self) -> ComponentSlot
fn clone(&self) -> ComponentSlot
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 moreSource§impl Debug for ComponentSlot
impl Debug for ComponentSlot
Source§impl<'de> Deserialize<'de> for ComponentSlot
impl<'de> Deserialize<'de> for ComponentSlot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ComponentSlot
impl RefUnwindSafe for ComponentSlot
impl Send for ComponentSlot
impl Sync for ComponentSlot
impl Unpin for ComponentSlot
impl UnsafeUnpin for ComponentSlot
impl UnwindSafe for ComponentSlot
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