feat: static Attributes type

This commit is contained in:
2025-03-13 16:15:46 -04:00
parent d9960a1650
commit 28ad5d7345
3 changed files with 13 additions and 9 deletions

View File

@@ -24,12 +24,16 @@ impl<'py> FromPyObject<'py> for Type {
#[derive(Debug, FromPyObject)]
#[pyo3(from_item_all)]
pub struct Data<OldStateContextEvent, NewStateContextEvent> {
pub struct Data<OldAttributes, OldStateContextEvent, NewAttributes, NewStateContextEvent> {
pub entity_id: EntityId,
pub old_state: Option<State<OldStateContextEvent>>,
pub new_state: Option<State<NewStateContextEvent>>,
pub old_state: Option<State<OldAttributes, OldStateContextEvent>>,
pub new_state: Option<State<NewAttributes, NewStateContextEvent>>,
}
/// A state changed event is fired when on state write the state is changed.
pub type Event<OldStateContextEvent, NewStateContextEvent, Context> =
super::super::event::Event<Type, Data<OldStateContextEvent, NewStateContextEvent>, Context>;
pub type Event<OldAttributes, OldStateContextEvent, NewAttributes, NewStateContextEvent, Context> =
super::super::event::Event<
Type,
Data<OldAttributes, OldStateContextEvent, NewAttributes, NewStateContextEvent>,
Context,
>;