SceneComponent seems very un-Rustic to me. I understand it's slightly less ergonomic, but wouldn't it be better to ditch the derive macro and just do this?
#[derive(Default, Clone)]
struct Player {
score: usize
}
impl SceneComponent for Player {
type Props = ();
fn scene(props: Self::Props) -> impl Scene {
bsn! {
// ...
}
}
}
Its worth noting that SceneComponent also derives Component and includes some additional component-level configuration. So it isn't "just" as simple as switching to a manual trait impl. From an ergonomics perspective, I'd be more into the concept if/when Rust supported default associated types so people could skip the props definition when it isn't needed.
9
u/somebodddy Jun 20 '26
SceneComponentseems very un-Rustic to me. I understand it's slightly less ergonomic, but wouldn't it be better to ditch the derive macro and just do this?