pub enum Attribute {
Property {
key: String,
value: String,
},
EventListener {
event: EventType,
handler: Rc<dyn Fn(Event)>,
},
DirectStyle(Rc<dyn Any>),
ScenePayload(Arc<dyn Any + Sync + Send>),
Entity(EntityId),
}Expand description
DOM element attribute or event listener.
Variants§
Property
EventListener
DirectStyle(Rc<dyn Any>)
ScenePayload(Arc<dyn Any + Sync + Send>)
Thread-safe type-erased 3D scene handle (e.g. Arc<strata_render::Scene3D>) attached to a viewport element.
Entity(EntityId)
Implementations§
Source§impl Attribute
impl Attribute
pub fn property(key: impl Into<String>, value: impl Into<String>) -> Attribute
pub fn direct_style<T>(style: T) -> Attributewhere
T: 'static,
pub fn scene_payload<T>(payload: T) -> Attribute
pub fn scene_payload_arc(payload: Arc<dyn Any + Sync + Send>) -> Attribute
pub fn entity(id: EntityId) -> Attribute
pub fn event_listener<Args, F>(event: EventType, handler: F) -> Attributewhere
F: EventHandlerMarker<Args> + 'static,
pub fn value_listener<Args, F>(event: EventType, handler: F) -> Attributewhere
F: ValueHandlerMarker<Args> + 'static,
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Attribute
impl !Send for Attribute
impl !Sync for Attribute
impl !UnwindSafe for Attribute
impl Forget for Attribute
impl Freeze for Attribute
impl Move for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
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