More granular table traits by onx2 · Pull Request #4775 · clockworklabs/SpacetimeDB
This is the main change to functionality. I wanted to have access to specific traits so in bevy_stdb I can go from:
fn bind_insert<TRow, TTable>(world: &World, table: &TTable)
where
TRow: Send + Sync + Clone + InModule + 'static,
RowEvent<TRow>: Send + Sync,
- TTable: Table<
+ TTable: WithInsert<
Row = TRow,
EventContext = <<TRow as InModule>::Module as SpacetimeModule>::EventContext,
>,
TTable::EventContext: AbstractEventContext<Event = RowEvent<TRow>>,
{
let sender = channel_sender::<InsertMessage<TRow>>(world);
table.on_insert(move |ctx, row| {
let _ = sender.send(InsertMessage {
event: ctx.event().clone(),
row: row.clone(),
});
});
}