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

@@ -21,11 +21,11 @@ impl<'py> FromPyObject<'py> for StateMachine {
}
impl StateMachine {
pub fn get<ContextEvent: for<'py> FromPyObject<'py>>(
pub fn get<Attributes: for<'py> FromPyObject<'py>, ContextEvent: for<'py> FromPyObject<'py>>(
&self,
py: &Python,
entity_id: EntityId,
) -> Result<Option<State<ContextEvent>>, PyErr> {
) -> Result<Option<State<Attributes, ContextEvent>>, PyErr> {
let args = (entity_id.to_string(),);
let state = self.0.call_method1(*py, "get", args)?;
state.extract(*py)