pub struct StyleRule {
pub select: String,
pub interaction: Option<Interaction>,
}Expand description
A CSS-like style rule: a selector + the properties it attaches to matching
placements. Lets a world define behaviour by type / .class / #id once,
instead of inline on every placement — restyle everything from one rule.
"styles": [
{ "select": ".harvestable", "interaction": { "label": "Chop", "effects": ["despawn"] } }
]Fields§
§select: StringA simple selector: "tree" (type), ".harvestable" (class), "#hero" (id).
interaction: Option<Interaction>The declarative interaction this rule attaches. (More properties — mesh, material — cascade here as the layer grows.)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StyleRule
impl<'de> Deserialize<'de> for StyleRule
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 StyleRule
impl RefUnwindSafe for StyleRule
impl Send for StyleRule
impl Sync for StyleRule
impl Unpin for StyleRule
impl UnsafeUnpin for StyleRule
impl UnwindSafe for StyleRule
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