(module: &ModuleDef, visibility: CodegenVisibility, out: &mut Indenter)
| 1562 | } |
| 1563 | |
| 1564 | fn print_impl_spacetime_module(module: &ModuleDef, visibility: CodegenVisibility, out: &mut Indenter) { |
| 1565 | out.delimited_block( |
| 1566 | "impl __sdk::SpacetimeModule for RemoteModule {", |
| 1567 | |out| { |
| 1568 | writeln!( |
| 1569 | out, |
| 1570 | " |
| 1571 | type DbConnection = DbConnection; |
| 1572 | type EventContext = EventContext; |
| 1573 | type ReducerEventContext = ReducerEventContext; |
| 1574 | type ProcedureEventContext = ProcedureEventContext; |
| 1575 | type SubscriptionEventContext = SubscriptionEventContext; |
| 1576 | type ErrorContext = ErrorContext; |
| 1577 | type Reducer = Reducer; |
| 1578 | type DbView = RemoteTables; |
| 1579 | type Reducers = RemoteReducers; |
| 1580 | type Procedures = RemoteProcedures; |
| 1581 | type DbUpdate = DbUpdate; |
| 1582 | type AppliedDiff<'r> = AppliedDiff<'r>; |
| 1583 | type SubscriptionHandle = SubscriptionHandle; |
| 1584 | type QueryBuilder = __sdk::QueryBuilder; |
| 1585 | " |
| 1586 | ); |
| 1587 | out.delimited_block( |
| 1588 | "fn register_tables(client_cache: &mut __sdk::ClientCache<Self>) {", |
| 1589 | |out| { |
| 1590 | for (_, accessor_name, _) in iter_table_names_and_types(module, visibility) { |
| 1591 | writeln!( |
| 1592 | out, |
| 1593 | "{}::register_table(client_cache);", |
| 1594 | table_module_name(accessor_name) |
| 1595 | ); |
| 1596 | } |
| 1597 | }, |
| 1598 | "}\n", |
| 1599 | ); |
| 1600 | out.delimited_block( |
| 1601 | "const ALL_TABLE_NAMES: &'static [&'static str] = &[", |
| 1602 | |out| { |
| 1603 | for (name, _, _) in iter_table_names_and_types(module, visibility) { |
| 1604 | writeln!(out, "\"{name}\","); |
| 1605 | } |
| 1606 | }, |
| 1607 | "];\n", |
| 1608 | ); |
| 1609 | }, |
| 1610 | "}\n", |
| 1611 | ); |
| 1612 | } |
| 1613 | |
| 1614 | fn print_const_db_context_types(out: &mut Indenter) { |
| 1615 | writeln!( |
no test coverage detected
searching dependent graphs…