FFI export - V10 serialization
| 374 | |
| 375 | // FFI export - V10 serialization |
| 376 | void Internal::Module::__describe_module__(BytesSink sink) { |
| 377 | // The preinit functions should have already been called by SpacetimeDB |
| 378 | // Including our validation preinit which checks for recursive types |
| 379 | std::vector<uint8_t> buffer = SerializeModuleDef(); |
| 380 | |
| 381 | // Now try to write using FFI directly |
| 382 | if (!buffer.empty()) { |
| 383 | size_t bytes_to_write = buffer.size(); |
| 384 | FFI::bytes_sink_write(sink, buffer.data(), &bytes_to_write); |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | // Helper to consume all bytes from a BytesSource |
| 389 | std::vector<uint8_t> ConsumeBytes(BytesSource source) { |