diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 638d6f29ec8..9e9d5e329b4 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -183,13 +183,15 @@ pub struct {insert_callback_id}(__sdk::CallbackId); write!( out, " -impl<'ctx> __sdk::EventTable for {table_handle}<'ctx> {{ +impl<'ctx> __sdk::TableLike for {table_handle}<'ctx> {{ type Row = {row_type}; type EventContext = super::EventContext; fn count(&self) -> u64 {{ self.imp.count() }} fn iter(&self) -> impl Iterator + '_ {{ self.imp.iter() }} +}} +impl<'ctx> __sdk::WithInsert for {table_handle}<'ctx> {{ type InsertCallbackId = {insert_callback_id}; fn on_insert( @@ -203,6 +205,8 @@ impl<'ctx> __sdk::EventTable for {table_handle}<'ctx> {{ self.imp.remove_on_insert(callback.0) }} }} + +impl<'ctx> __sdk::EventTable for {table_handle}<'ctx> {{}} " ); } else { @@ -213,13 +217,15 @@ impl<'ctx> __sdk::EventTable for {table_handle}<'ctx> {{ out, "pub struct {delete_callback_id}(__sdk::CallbackId); -impl<'ctx> __sdk::Table for {table_handle}<'ctx> {{ +impl<'ctx> __sdk::TableLike for {table_handle}<'ctx> {{ type Row = {row_type}; type EventContext = super::EventContext; fn count(&self) -> u64 {{ self.imp.count() }} fn iter(&self) -> impl Iterator + '_ {{ self.imp.iter() }} +}} +impl<'ctx> __sdk::WithInsert for {table_handle}<'ctx> {{ type InsertCallbackId = {insert_callback_id}; fn on_insert( @@ -232,7 +238,9 @@ impl<'ctx> __sdk::Table for {table_handle}<'ctx> {{ fn remove_on_insert(&self, callback: {insert_callback_id}) {{ self.imp.remove_on_insert(callback.0) }} +}} +impl<'ctx> __sdk::WithDelete for {table_handle}<'ctx> {{ type DeleteCallbackId = {delete_callback_id}; fn on_delete( @@ -246,6 +254,8 @@ impl<'ctx> __sdk::Table for {table_handle}<'ctx> {{ self.imp.remove_on_delete(callback.0) }} }} + +impl<'ctx> __sdk::Table for {table_handle}<'ctx> {{}} " ); @@ -258,7 +268,7 @@ impl<'ctx> __sdk::Table for {table_handle}<'ctx> {{ " pub struct {update_callback_id}(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for {table_handle}<'ctx> {{ +impl<'ctx> __sdk::WithUpdate for {table_handle}<'ctx> {{ type UpdateCallbackId = {update_callback_id}; fn on_update( @@ -272,6 +282,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for {table_handle}<'ctx> {{ self.imp.remove_on_update(callback.0) }} }} + +impl<'ctx> __sdk::TableWithPrimaryKey for {table_handle}<'ctx> {{}} " ); } @@ -1877,7 +1889,7 @@ impl"), - "[`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks", + "[`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks", Some("[`__sdk::Event`]"), ); diff --git a/sdks/rust/src/lib.rs b/sdks/rust/src/lib.rs index d99447d440f..5e5d4010572 100644 --- a/sdks/rust/src/lib.rs +++ b/sdks/rust/src/lib.rs @@ -29,7 +29,7 @@ pub use db_connection::DbConnectionBuilder; pub use db_context::DbContext; pub use error::{Error, Result}; pub use event::{Event, ReducerEvent, Status}; -pub use table::{EventTable, Table, TableWithPrimaryKey}; +pub use table::{EventTable, Table, TableLike, TableWithPrimaryKey, WithDelete, WithInsert, WithUpdate}; pub use spacetime_module::SubscriptionHandle; pub use spacetimedb_client_api_messages::websocket::v1::Compression; @@ -62,7 +62,7 @@ pub mod __codegen { pub use crate::subscription::{OnEndedCallback, SubscriptionBuilder, SubscriptionHandleImpl}; pub use crate::{ ConnectionId, DbConnectionBuilder, DbContext, Event, EventTable, Identity, ReducerEvent, ScheduleAt, Table, - TableWithPrimaryKey, TimeDuration, Timestamp, Uuid, + TableLike, TableWithPrimaryKey, TimeDuration, Timestamp, Uuid, WithDelete, WithInsert, WithUpdate, }; } diff --git a/sdks/rust/src/table.rs b/sdks/rust/src/table.rs index fe42c613a4a..1f521ada5ec 100644 --- a/sdks/rust/src/table.rs +++ b/sdks/rust/src/table.rs @@ -1,4 +1,5 @@ -//! The [`Table`] and [`TableWithPrimaryKey`] traits, +//! The [`TableLike`], [`Table`], [`TableWithPrimaryKey`], and [`EventTable`] traits, +//! together with the [`WithInsert`], [`WithDelete`], and [`WithUpdate`] capability traits, //! which allow certain simple queries of the client cache, //! and expose row callbacks which run when subscribed rows are inserted, deleted or updated. //! @@ -7,12 +8,10 @@ //! which mediate access to tables in the client cache. //! Obtain a table handle by calling a method on `ctx.db`, where `ctx` is a `DbConnection` or `EventContext`. -/// Trait implemented by table handles, which mediate access to tables in the client cache. +/// Common functionality shared by table-like handles. /// /// Obtain a table handle by calling a method on `ctx.db`, where `ctx` is a `DbConnection` or `EventContext`. -/// -/// For persistent (non-event) tables only. See [`EventTable`] for transient event tables. -pub trait Table { +pub trait TableLike { /// The type of rows stored in this table. type Row: 'static; @@ -24,9 +23,16 @@ pub trait Table { /// An iterator over all the subscribed rows in the client cache. fn iter(&self) -> impl Iterator + '_; +} +/// Capability trait for table-like handles which support insert callbacks. +pub trait WithInsert: TableLike { type InsertCallbackId; - /// Register a callback to run whenever a subscribed row is inserted into the client cache. + + /// Register a callback to run whenever a row is observed as inserted by this table handle. + /// + /// For persistent tables, this means a subscribed row is inserted into the client cache. + /// For event tables, this means an event row is delivered. /// /// The returned [`Self::InsertCallbackId`] can be passed to [`Self::remove_on_insert`] /// to cancel the callback. @@ -34,10 +40,15 @@ pub trait Table { &self, callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, ) -> Self::InsertCallbackId; + /// Cancel a callback previously registered by [`Self::on_insert`], causing it not to run in the future. fn remove_on_insert(&self, callback: Self::InsertCallbackId); +} +/// Capability trait for table-like handles which support delete callbacks. +pub trait WithDelete: TableLike { type DeleteCallbackId; + /// Register a callback to run whenever a subscribed row is deleted from the client cache. /// /// The returned [`Self::DeleteCallbackId`] can be passed to [`Self::remove_on_delete`] @@ -46,22 +57,15 @@ pub trait Table { &self, callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, ) -> Self::DeleteCallbackId; + /// Cancel a callback previously registered by [`Self::on_delete`], causing it not to run in the future. fn remove_on_delete(&self, callback: Self::DeleteCallbackId); } -/// Subtrait of [`Table`] implemented only by tables with a column designated as a primary key, -/// which allows the SDK to identify updates. -/// -/// SpacetimeDB does not have a special notion of updates as a primitive operation. -/// Instead, an update is a delete followed by an insert -/// of rows with the same primary key within the same transaction. -/// This means that the module's calls to `ctx.db.some_table().unique_column().update(...)` -/// may not result in an update event on the client if `unique_column` is not the primary key, -/// and that clients may observe update events resulting from deletes and inserts by the module -/// without going through such an `update` method. -pub trait TableWithPrimaryKey: Table { +/// Capability trait for table-like handles which support update callbacks. +pub trait WithUpdate: TableLike { type UpdateCallbackId; + /// Register a callback to run whenever a subscribed row is updated within a transaction, /// with an old version deleted and a new version inserted with the same primary key. /// @@ -74,38 +78,34 @@ pub trait TableWithPrimaryKey: Table { &self, callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, ) -> Self::UpdateCallbackId; + /// Cancel a callback previously registered by [`Self::on_update`], causing it not to run in the future. fn remove_on_update(&self, callback: Self::UpdateCallbackId); } +/// Trait implemented by persistent table handles, which mediate access to tables in the client cache. +/// +/// Obtain a table handle by calling a method on `ctx.db`, where `ctx` is a `DbConnection` or `EventContext`. +/// +/// For persistent (non-event) tables only. See [`EventTable`] for transient event tables. +pub trait Table: TableLike + WithInsert + WithDelete {} + +/// Subtrait of [`Table`] implemented only by tables with a column designated as a primary key, +/// which allows the SDK to identify updates. +/// +/// SpacetimeDB does not have a special notion of updates as a primitive operation. +/// Instead, an update is a delete followed by an insert +/// of rows with the same primary key within the same transaction. +/// This means that the module's calls to `ctx.db.some_table().unique_column().update(...)` +/// may not result in an update event on the client if `unique_column` is not the primary key, +/// and that clients may observe update events resulting from deletes and inserts by the module +/// without going through such an `update` method. +pub trait TableWithPrimaryKey: Table + WithUpdate {} + /// Trait for event tables, whose rows are transient and never persisted in the client cache. /// /// Event table rows are delivered as inserts but are not stored; /// only `on_insert` callbacks fire, and `count`/`iter` always reflect an empty table. /// /// Obtain a table handle by calling a method on `ctx.db`, where `ctx` is a `DbConnection` or `EventContext`. -pub trait EventTable { - /// The type of rows in this table. - type Row: 'static; - - /// The `EventContext` type generated for the module which defines this table. - type EventContext; - - /// The number of subscribed rows in the client cache (always 0 for event tables). - fn count(&self) -> u64; - - /// An iterator over all the subscribed rows in the client cache (always empty for event tables). - fn iter(&self) -> impl Iterator + '_; - - type InsertCallbackId; - /// Register a callback to run whenever a row is inserted. - /// - /// The returned [`Self::InsertCallbackId`] can be passed to [`Self::remove_on_insert`] - /// to cancel the callback. - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> Self::InsertCallbackId; - /// Cancel a callback previously registered by [`Self::on_insert`], causing it not to run in the future. - fn remove_on_insert(&self, callback: Self::InsertCallbackId); -} +pub trait EventTable: TableLike + WithInsert {} diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/connected_table.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/connected_table.rs index 26873a10c5d..d0f4697c946 100644 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/connected_table.rs +++ b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/connected_table.rs @@ -40,7 +40,7 @@ impl ConnectedTableAccess for super::RemoteTables { pub struct ConnectedInsertCallbackId(__sdk::CallbackId); pub struct ConnectedDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ConnectedTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ConnectedTableHandle<'ctx> { type Row = Connected; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ConnectedTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ConnectedTableHandle<'ctx> { type InsertCallbackId = ConnectedInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ConnectedTableHandle<'ctx> { fn remove_on_insert(&self, callback: ConnectedInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ConnectedTableHandle<'ctx> { type DeleteCallbackId = ConnectedDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ConnectedTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ConnectedTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("connected"); diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs index 35147a9e6e3..6b3bd3948de 100644 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs +++ b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/disconnected_table.rs @@ -40,7 +40,7 @@ impl DisconnectedTableAccess for super::RemoteTables { pub struct DisconnectedInsertCallbackId(__sdk::CallbackId); pub struct DisconnectedDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for DisconnectedTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for DisconnectedTableHandle<'ctx> { type Row = Disconnected; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for DisconnectedTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for DisconnectedTableHandle<'ctx> { type InsertCallbackId = DisconnectedInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for DisconnectedTableHandle<'ctx> { fn remove_on_insert(&self, callback: DisconnectedInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for DisconnectedTableHandle<'ctx> { type DeleteCallbackId = DisconnectedDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for DisconnectedTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for DisconnectedTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("disconnected"); diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs deleted file mode 100644 index cfbf1d03d30..00000000000 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs +++ /dev/null @@ -1,62 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -pub(super) struct IdentityConnectedArgs {} - -impl From for super::Reducer { - fn from(args: IdentityConnectedArgs) -> Self { - Self::IdentityConnected - } -} - -impl __sdk::InModule for IdentityConnectedArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the reducer `identity_connected`. -/// -/// Implemented for [`super::RemoteReducers`]. -pub trait identity_connected { - /// Request that the remote module invoke the reducer `identity_connected` to run as soon as possible. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and this method provides no way to listen for its completion status. - /// /// Use [`identity_connected:identity_connected_then`] to run a callback after the reducer completes. - fn identity_connected(&self) -> __sdk::Result<()> { - self.identity_connected_then(|_, _| {}) - } - - /// Request that the remote module invoke the reducer `identity_connected` to run as soon as possible, - /// registering `callback` to run when we are notified that the reducer completed. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and its status can be observed with the `callback`. - fn identity_connected_then( - &self, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()>; -} - -impl identity_connected for super::RemoteReducers { - fn identity_connected_then( - &self, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(IdentityConnectedArgs {}, callback) - } -} diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs deleted file mode 100644 index 8cec050f73e..00000000000 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs +++ /dev/null @@ -1,62 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -pub(super) struct IdentityDisconnectedArgs {} - -impl From for super::Reducer { - fn from(args: IdentityDisconnectedArgs) -> Self { - Self::IdentityDisconnected - } -} - -impl __sdk::InModule for IdentityDisconnectedArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the reducer `identity_disconnected`. -/// -/// Implemented for [`super::RemoteReducers`]. -pub trait identity_disconnected { - /// Request that the remote module invoke the reducer `identity_disconnected` to run as soon as possible. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and this method provides no way to listen for its completion status. - /// /// Use [`identity_disconnected:identity_disconnected_then`] to run a callback after the reducer completes. - fn identity_disconnected(&self) -> __sdk::Result<()> { - self.identity_disconnected_then(|_, _| {}) - } - - /// Request that the remote module invoke the reducer `identity_disconnected` to run as soon as possible, - /// registering `callback` to run when we are notified that the reducer completed. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and its status can be observed with the `callback`. - fn identity_disconnected_then( - &self, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()>; -} - -impl identity_disconnected for super::RemoteReducers { - fn identity_disconnected_then( - &self, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(IdentityDisconnectedArgs {}, callback) - } -} diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs index 1ef84bbcf6b..c48bee35cc9 100644 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.0.5 (commit ca7484e072f9514fb2f890f26600a5d096f59431). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -10,15 +10,11 @@ pub mod connected_table; pub mod connected_type; pub mod disconnected_table; pub mod disconnected_type; -pub mod identity_connected_reducer; -pub mod identity_disconnected_reducer; pub use connected_table::*; pub use connected_type::Connected; pub use disconnected_table::*; pub use disconnected_type::Disconnected; -pub use identity_connected_reducer::identity_connected; -pub use identity_disconnected_reducer::identity_disconnected; #[derive(Clone, PartialEq, Debug)] @@ -27,10 +23,7 @@ pub use identity_disconnected_reducer::identity_disconnected; /// Contained within a [`__sdk::ReducerEvent`] in [`EventContext`]s for reducer events /// to indicate which reducer caused the event. -pub enum Reducer { - IdentityConnected, - IdentityDisconnected, -} +pub enum Reducer {} impl __sdk::InModule for Reducer { type Module = RemoteModule; @@ -39,18 +32,12 @@ impl __sdk::InModule for Reducer { impl __sdk::Reducer for Reducer { fn reducer_name(&self) -> &'static str { match self { - Reducer::IdentityConnected => "identity_connected", - Reducer::IdentityDisconnected => "identity_disconnected", _ => unreachable!(), } } #[allow(clippy::clone_on_copy)] fn args_bsatn(&self) -> Result, __sats::bsatn::EncodeError> { match self { - Reducer::IdentityConnected => __sats::bsatn::to_vec(&identity_connected_reducer::IdentityConnectedArgs {}), - Reducer::IdentityDisconnected => { - __sats::bsatn::to_vec(&identity_disconnected_reducer::IdentityDisconnectedArgs {}) - } _ => unreachable!(), } } @@ -421,7 +408,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, diff --git a/sdks/rust/tests/connect_disconnect_client/src/test_handlers.rs b/sdks/rust/tests/connect_disconnect_client/src/test_handlers.rs index 56753d78039..27e39ebf42d 100644 --- a/sdks/rust/tests/connect_disconnect_client/src/test_handlers.rs +++ b/sdks/rust/tests/connect_disconnect_client/src/test_handlers.rs @@ -1,6 +1,6 @@ use crate::module_bindings::*; -use spacetimedb_sdk::{DbConnectionBuilder, DbContext, Table}; +use spacetimedb_sdk::{DbConnectionBuilder, DbContext, TableLike}; use test_counter::TestCounter; diff --git a/sdks/rust/tests/event-table-client/src/module_bindings/mod.rs b/sdks/rust/tests/event-table-client/src/module_bindings/mod.rs index 36db8c84b50..dc719761a69 100644 --- a/sdks/rust/tests/event-table-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/event-table-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.0.5 (commit ca7484e072f9514fb2f890f26600a5d096f59431). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -414,7 +414,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, diff --git a/sdks/rust/tests/event-table-client/src/module_bindings/test_event_table.rs b/sdks/rust/tests/event-table-client/src/module_bindings/test_event_table.rs index b6d14f66674..668bd8fc229 100644 --- a/sdks/rust/tests/event-table-client/src/module_bindings/test_event_table.rs +++ b/sdks/rust/tests/event-table-client/src/module_bindings/test_event_table.rs @@ -39,7 +39,7 @@ impl TestEventTableAccess for super::RemoteTables { pub struct TestEventInsertCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::EventTable for TestEventTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for TestEventTableHandle<'ctx> { type Row = TestEvent; type EventContext = super::EventContext; @@ -49,7 +49,9 @@ impl<'ctx> __sdk::EventTable for TestEventTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for TestEventTableHandle<'ctx> { type InsertCallbackId = TestEventInsertCallbackId; fn on_insert( @@ -64,6 +66,8 @@ impl<'ctx> __sdk::EventTable for TestEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::EventTable for TestEventTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("test_event"); diff --git a/sdks/rust/tests/event-table-client/src/test_handlers.rs b/sdks/rust/tests/event-table-client/src/test_handlers.rs index f77c78e3896..46566f15fd1 100644 --- a/sdks/rust/tests/event-table-client/src/test_handlers.rs +++ b/sdks/rust/tests/event-table-client/src/test_handlers.rs @@ -1,6 +1,6 @@ use crate::module_bindings::*; -use spacetimedb_sdk::{DbConnectionBuilder, DbContext, Event, EventTable}; +use spacetimedb_sdk::{DbConnectionBuilder, DbContext, Event, TableLike, WithInsert}; use std::sync::atomic::{AtomicU32, Ordering}; use test_counter::TestCounter; diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs b/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs index 18eef1b125e..2c2b85bd61b 100644 --- a/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.0.5 (commit ca7484e072f9514fb2f890f26600a5d096f59431). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -23,8 +23,6 @@ pub mod return_primitive_procedure; pub mod return_struct_procedure; pub mod return_struct_type; pub mod schedule_proc_reducer; -pub mod scheduled_proc_procedure; -pub mod scheduled_proc_table_table; pub mod scheduled_proc_table_type; pub mod sorted_uuids_insert_procedure; pub mod will_panic_procedure; @@ -46,8 +44,6 @@ pub use return_primitive_procedure::return_primitive; pub use return_struct_procedure::return_struct; pub use return_struct_type::ReturnStruct; pub use schedule_proc_reducer::schedule_proc; -pub use scheduled_proc_procedure::scheduled_proc; -pub use scheduled_proc_table_table::*; pub use scheduled_proc_table_type::ScheduledProcTable; pub use sorted_uuids_insert_procedure::sorted_uuids_insert; pub use will_panic_procedure::will_panic; @@ -90,7 +86,6 @@ pub struct DbUpdate { my_table: __sdk::TableUpdate, pk_uuid: __sdk::TableUpdate, proc_inserts_into: __sdk::TableUpdate, - scheduled_proc_table: __sdk::TableUpdate, } impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { @@ -108,9 +103,6 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { "proc_inserts_into" => db_update .proc_inserts_into .append(proc_inserts_into_table::parse_table_update(table_update)?), - "scheduled_proc_table" => db_update - .scheduled_proc_table - .append(scheduled_proc_table_table::parse_table_update(table_update)?), unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "DatabaseUpdate").into()); @@ -133,9 +125,6 @@ impl __sdk::DbUpdate for DbUpdate { diff.pk_uuid = cache.apply_diff_to_table::("pk_uuid", &self.pk_uuid); diff.proc_inserts_into = cache.apply_diff_to_table::("proc_inserts_into", &self.proc_inserts_into); - diff.scheduled_proc_table = cache - .apply_diff_to_table::("scheduled_proc_table", &self.scheduled_proc_table) - .with_updates_by_pk(|row| &row.scheduled_id); diff } @@ -152,9 +141,6 @@ impl __sdk::DbUpdate for DbUpdate { "proc_inserts_into" => db_update .proc_inserts_into .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "scheduled_proc_table" => db_update - .scheduled_proc_table - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); } @@ -175,9 +161,6 @@ impl __sdk::DbUpdate for DbUpdate { "proc_inserts_into" => db_update .proc_inserts_into .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "scheduled_proc_table" => db_update - .scheduled_proc_table - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); } @@ -194,7 +177,6 @@ pub struct AppliedDiff<'r> { my_table: __sdk::TableAppliedDiff<'r, MyTable>, pk_uuid: __sdk::TableAppliedDiff<'r, PkUuid>, proc_inserts_into: __sdk::TableAppliedDiff<'r, ProcInsertsInto>, - scheduled_proc_table: __sdk::TableAppliedDiff<'r, ScheduledProcTable>, __unused: std::marker::PhantomData<&'r ()>, } @@ -207,11 +189,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { callbacks.invoke_table_row_callbacks::("my_table", &self.my_table, event); callbacks.invoke_table_row_callbacks::("pk_uuid", &self.pk_uuid, event); callbacks.invoke_table_row_callbacks::("proc_inserts_into", &self.proc_inserts_into, event); - callbacks.invoke_table_row_callbacks::( - "scheduled_proc_table", - &self.scheduled_proc_table, - event, - ); } } @@ -481,7 +458,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, @@ -872,8 +849,6 @@ impl __sdk::SpacetimeModule for RemoteModule { my_table_table::register_table(client_cache); pk_uuid_table::register_table(client_cache); proc_inserts_into_table::register_table(client_cache); - scheduled_proc_table_table::register_table(client_cache); } - const ALL_TABLE_NAMES: &'static [&'static str] = - &["my_table", "pk_uuid", "proc_inserts_into", "scheduled_proc_table"]; + const ALL_TABLE_NAMES: &'static [&'static str] = &["my_table", "pk_uuid", "proc_inserts_into"]; } diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/my_table_table.rs b/sdks/rust/tests/procedure-client/src/module_bindings/my_table_table.rs index a9215f629c4..c3cdf53b23d 100644 --- a/sdks/rust/tests/procedure-client/src/module_bindings/my_table_table.rs +++ b/sdks/rust/tests/procedure-client/src/module_bindings/my_table_table.rs @@ -41,7 +41,7 @@ impl MyTableTableAccess for super::RemoteTables { pub struct MyTableInsertCallbackId(__sdk::CallbackId); pub struct MyTableDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for MyTableTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for MyTableTableHandle<'ctx> { type Row = MyTable; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for MyTableTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for MyTableTableHandle<'ctx> { type InsertCallbackId = MyTableInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for MyTableTableHandle<'ctx> { fn remove_on_insert(&self, callback: MyTableInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for MyTableTableHandle<'ctx> { type DeleteCallbackId = MyTableDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for MyTableTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for MyTableTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("my_table"); diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/pk_uuid_table.rs b/sdks/rust/tests/procedure-client/src/module_bindings/pk_uuid_table.rs index f177d36ead8..d17e294c193 100644 --- a/sdks/rust/tests/procedure-client/src/module_bindings/pk_uuid_table.rs +++ b/sdks/rust/tests/procedure-client/src/module_bindings/pk_uuid_table.rs @@ -40,7 +40,7 @@ impl PkUuidTableAccess for super::RemoteTables { pub struct PkUuidInsertCallbackId(__sdk::CallbackId); pub struct PkUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkUuidTableHandle<'ctx> { type Row = PkUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkUuidTableHandle<'ctx> { type InsertCallbackId = PkUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkUuidTableHandle<'ctx> { type DeleteCallbackId = PkUuidDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("pk_uuid"); diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/proc_inserts_into_table.rs b/sdks/rust/tests/procedure-client/src/module_bindings/proc_inserts_into_table.rs index 6f61280d313..b88e0896f4a 100644 --- a/sdks/rust/tests/procedure-client/src/module_bindings/proc_inserts_into_table.rs +++ b/sdks/rust/tests/procedure-client/src/module_bindings/proc_inserts_into_table.rs @@ -40,7 +40,7 @@ impl ProcInsertsIntoTableAccess for super::RemoteTables { pub struct ProcInsertsIntoInsertCallbackId(__sdk::CallbackId); pub struct ProcInsertsIntoDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ProcInsertsIntoTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ProcInsertsIntoTableHandle<'ctx> { type Row = ProcInsertsInto; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ProcInsertsIntoTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ProcInsertsIntoTableHandle<'ctx> { type InsertCallbackId = ProcInsertsIntoInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ProcInsertsIntoTableHandle<'ctx> { fn remove_on_insert(&self, callback: ProcInsertsIntoInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ProcInsertsIntoTableHandle<'ctx> { type DeleteCallbackId = ProcInsertsIntoDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ProcInsertsIntoTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ProcInsertsIntoTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("proc_inserts_into"); diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs b/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs deleted file mode 100644 index 124f51162f0..00000000000 --- a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -use super::scheduled_proc_table_type::ScheduledProcTable; - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -struct ScheduledProcArgs { - pub data: ScheduledProcTable, -} - -impl __sdk::InModule for ScheduledProcArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the procedure `scheduled_proc`. -/// -/// Implemented for [`super::RemoteProcedures`]. -pub trait scheduled_proc { - fn scheduled_proc(&self, data: ScheduledProcTable) { - self.scheduled_proc_then(data, |_, _| {}); - } - - fn scheduled_proc_then( - &self, - data: ScheduledProcTable, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ); -} - -impl scheduled_proc for super::RemoteProcedures { - fn scheduled_proc_then( - &self, - data: ScheduledProcTable, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ) { - self.imp - .invoke_procedure_with_callback::<_, ()>("scheduled_proc", ScheduledProcArgs { data }, __callback); - } -} diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs b/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs deleted file mode 100644 index 03f3ea0fda9..00000000000 --- a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs +++ /dev/null @@ -1,159 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::scheduled_proc_table_type::ScheduledProcTable; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `scheduled_proc_table`. -/// -/// Obtain a handle from the [`ScheduledProcTableTableAccess::scheduled_proc_table`] method on [`super::RemoteTables`], -/// like `ctx.db.scheduled_proc_table()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.scheduled_proc_table().on_insert(...)`. -pub struct ScheduledProcTableTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `scheduled_proc_table`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait ScheduledProcTableTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`ScheduledProcTableTableHandle`], which mediates access to the table `scheduled_proc_table`. - fn scheduled_proc_table(&self) -> ScheduledProcTableTableHandle<'_>; -} - -impl ScheduledProcTableTableAccess for super::RemoteTables { - fn scheduled_proc_table(&self) -> ScheduledProcTableTableHandle<'_> { - ScheduledProcTableTableHandle { - imp: self.imp.get_table::("scheduled_proc_table"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct ScheduledProcTableInsertCallbackId(__sdk::CallbackId); -pub struct ScheduledProcTableDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for ScheduledProcTableTableHandle<'ctx> { - type Row = ScheduledProcTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = ScheduledProcTableInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableInsertCallbackId { - ScheduledProcTableInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: ScheduledProcTableInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = ScheduledProcTableDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableDeleteCallbackId { - ScheduledProcTableDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: ScheduledProcTableDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -pub struct ScheduledProcTableUpdateCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::TableWithPrimaryKey for ScheduledProcTableTableHandle<'ctx> { - type UpdateCallbackId = ScheduledProcTableUpdateCallbackId; - - fn on_update( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableUpdateCallbackId { - ScheduledProcTableUpdateCallbackId(self.imp.on_update(Box::new(callback))) - } - - fn remove_on_update(&self, callback: ScheduledProcTableUpdateCallbackId) { - self.imp.remove_on_update(callback.0) - } -} - -/// Access to the `scheduled_id` unique index on the table `scheduled_proc_table`, -/// which allows point queries on the field of the same name -/// via the [`ScheduledProcTableScheduledIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.scheduled_proc_table().scheduled_id().find(...)`. -pub struct ScheduledProcTableScheduledIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> ScheduledProcTableTableHandle<'ctx> { - /// Get a handle on the `scheduled_id` unique index on the table `scheduled_proc_table`. - pub fn scheduled_id(&self) -> ScheduledProcTableScheduledIdUnique<'ctx> { - ScheduledProcTableScheduledIdUnique { - imp: self.imp.get_unique_constraint::("scheduled_id"), - phantom: std::marker::PhantomData, - } - } -} - -impl<'ctx> ScheduledProcTableScheduledIdUnique<'ctx> { - /// Find the subscribed row whose `scheduled_id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("scheduled_proc_table"); - _table.add_unique_constraint::("scheduled_id", |row| &row.scheduled_id); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::v2::TableUpdate, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ScheduledProcTable`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait scheduled_proc_tableQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ScheduledProcTable`. - fn scheduled_proc_table(&self) -> __sdk::__query_builder::Table; -} - -impl scheduled_proc_tableQueryTableAccess for __sdk::QueryTableAccessor { - fn scheduled_proc_table(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("scheduled_proc_table") - } -} diff --git a/sdks/rust/tests/procedure-client/src/test_handlers.rs b/sdks/rust/tests/procedure-client/src/test_handlers.rs index d3f75c0698a..8abb2a925b4 100644 --- a/sdks/rust/tests/procedure-client/src/test_handlers.rs +++ b/sdks/rust/tests/procedure-client/src/test_handlers.rs @@ -2,7 +2,7 @@ use crate::module_bindings::*; use anyhow::Context; use core::time::Duration; use spacetimedb_lib::db::raw_def::v9::{RawMiscModuleExportV9, RawModuleDefV9}; -use spacetimedb_sdk::{DbConnectionBuilder, DbContext, Table}; +use spacetimedb_sdk::{DbConnectionBuilder, DbContext, Table, TableLike, WithInsert}; use test_counter::TestCounter; const LOCALHOST: &str = "http://localhost:3000"; diff --git a/sdks/rust/tests/test-client/src/module_bindings/btree_u_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/btree_u_32_table.rs index f5f7216ef84..174a1a729ea 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/btree_u_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/btree_u_32_table.rs @@ -40,7 +40,7 @@ impl BtreeU32TableAccess for super::RemoteTables { pub struct BtreeU32InsertCallbackId(__sdk::CallbackId); pub struct BtreeU32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for BtreeU32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for BtreeU32TableHandle<'ctx> { type Row = BTreeU32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for BtreeU32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for BtreeU32TableHandle<'ctx> { type InsertCallbackId = BtreeU32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for BtreeU32TableHandle<'ctx> { fn remove_on_insert(&self, callback: BtreeU32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for BtreeU32TableHandle<'ctx> { type DeleteCallbackId = BtreeU32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for BtreeU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for BtreeU32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("btree_u_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/indexed_simple_enum_table.rs b/sdks/rust/tests/test-client/src/module_bindings/indexed_simple_enum_table.rs index 02b40f1302e..071b46352a3 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/indexed_simple_enum_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/indexed_simple_enum_table.rs @@ -41,7 +41,7 @@ impl IndexedSimpleEnumTableAccess for super::RemoteTables { pub struct IndexedSimpleEnumInsertCallbackId(__sdk::CallbackId); pub struct IndexedSimpleEnumDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for IndexedSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for IndexedSimpleEnumTableHandle<'ctx> { type Row = IndexedSimpleEnum; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for IndexedSimpleEnumTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for IndexedSimpleEnumTableHandle<'ctx> { type InsertCallbackId = IndexedSimpleEnumInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for IndexedSimpleEnumTableHandle<'ctx> { fn remove_on_insert(&self, callback: IndexedSimpleEnumInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for IndexedSimpleEnumTableHandle<'ctx> { type DeleteCallbackId = IndexedSimpleEnumDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for IndexedSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for IndexedSimpleEnumTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("indexed_simple_enum"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs b/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs deleted file mode 100644 index 63eaf2e6ff3..00000000000 --- a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs +++ /dev/null @@ -1,111 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::indexed_table_2_type::IndexedTable2; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `indexed_table_2`. -/// -/// Obtain a handle from the [`IndexedTable2TableAccess::indexed_table_2`] method on [`super::RemoteTables`], -/// like `ctx.db.indexed_table_2()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.indexed_table_2().on_insert(...)`. -pub struct IndexedTable2TableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `indexed_table_2`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait IndexedTable2TableAccess { - #[allow(non_snake_case)] - /// Obtain a [`IndexedTable2TableHandle`], which mediates access to the table `indexed_table_2`. - fn indexed_table_2(&self) -> IndexedTable2TableHandle<'_>; -} - -impl IndexedTable2TableAccess for super::RemoteTables { - fn indexed_table_2(&self) -> IndexedTable2TableHandle<'_> { - IndexedTable2TableHandle { - imp: self.imp.get_table::("indexed_table_2"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct IndexedTable2InsertCallbackId(__sdk::CallbackId); -pub struct IndexedTable2DeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for IndexedTable2TableHandle<'ctx> { - type Row = IndexedTable2; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = IndexedTable2InsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTable2InsertCallbackId { - IndexedTable2InsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: IndexedTable2InsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = IndexedTable2DeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTable2DeleteCallbackId { - IndexedTable2DeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: IndexedTable2DeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("indexed_table_2"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::v2::TableUpdate, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `IndexedTable2`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait indexed_table_2QueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `IndexedTable2`. - fn indexed_table_2(&self) -> __sdk::__query_builder::Table; -} - -impl indexed_table_2QueryTableAccess for __sdk::QueryTableAccessor { - fn indexed_table_2(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("indexed_table_2") - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs b/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs deleted file mode 100644 index 73b03043ace..00000000000 --- a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs +++ /dev/null @@ -1,111 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::indexed_table_type::IndexedTable; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `indexed_table`. -/// -/// Obtain a handle from the [`IndexedTableTableAccess::indexed_table`] method on [`super::RemoteTables`], -/// like `ctx.db.indexed_table()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.indexed_table().on_insert(...)`. -pub struct IndexedTableTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `indexed_table`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait IndexedTableTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`IndexedTableTableHandle`], which mediates access to the table `indexed_table`. - fn indexed_table(&self) -> IndexedTableTableHandle<'_>; -} - -impl IndexedTableTableAccess for super::RemoteTables { - fn indexed_table(&self) -> IndexedTableTableHandle<'_> { - IndexedTableTableHandle { - imp: self.imp.get_table::("indexed_table"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct IndexedTableInsertCallbackId(__sdk::CallbackId); -pub struct IndexedTableDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for IndexedTableTableHandle<'ctx> { - type Row = IndexedTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = IndexedTableInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTableInsertCallbackId { - IndexedTableInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: IndexedTableInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = IndexedTableDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTableDeleteCallbackId { - IndexedTableDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: IndexedTableDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("indexed_table"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::v2::TableUpdate, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `IndexedTable`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait indexed_tableQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `IndexedTable`. - fn indexed_table(&self) -> __sdk::__query_builder::Table; -} - -impl indexed_tableQueryTableAccess for __sdk::QueryTableAccessor { - fn indexed_table(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("indexed_table") - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/large_table_table.rs b/sdks/rust/tests/test-client/src/module_bindings/large_table_table.rs index 8eb966cfcc7..fbd59728cef 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/large_table_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/large_table_table.rs @@ -46,7 +46,7 @@ impl LargeTableTableAccess for super::RemoteTables { pub struct LargeTableInsertCallbackId(__sdk::CallbackId); pub struct LargeTableDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for LargeTableTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for LargeTableTableHandle<'ctx> { type Row = LargeTable; type EventContext = super::EventContext; @@ -56,7 +56,9 @@ impl<'ctx> __sdk::Table for LargeTableTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for LargeTableTableHandle<'ctx> { type InsertCallbackId = LargeTableInsertCallbackId; fn on_insert( @@ -69,7 +71,9 @@ impl<'ctx> __sdk::Table for LargeTableTableHandle<'ctx> { fn remove_on_insert(&self, callback: LargeTableInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for LargeTableTableHandle<'ctx> { type DeleteCallbackId = LargeTableDeleteCallbackId; fn on_delete( @@ -84,6 +88,8 @@ impl<'ctx> __sdk::Table for LargeTableTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for LargeTableTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("large_table"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/mod.rs b/sdks/rust/tests/test-client/src/module_bindings/mod.rs index 50dc1e0cb5a..701259ffd08 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.1.0 (commit 77575596072d271b763513ec1833d4a6e0627aef). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -52,9 +52,7 @@ pub mod every_primitive_struct_type; pub mod every_vec_struct_type; pub mod indexed_simple_enum_table; pub mod indexed_simple_enum_type; -pub mod indexed_table_2_table; pub mod indexed_table_2_type; -pub mod indexed_table_table; pub mod indexed_table_type; pub mod insert_call_timestamp_reducer; pub mod insert_call_uuid_v_4_reducer; @@ -297,7 +295,6 @@ pub mod result_vec_i_32_string_table; pub mod result_vec_i_32_string_type; pub mod scheduled_table_table; pub mod scheduled_table_type; -pub mod send_scheduled_message_reducer; pub mod simple_enum_type; pub mod sorted_uuids_insert_reducer; pub mod table_holds_table_table; @@ -475,9 +472,7 @@ pub use every_primitive_struct_type::EveryPrimitiveStruct; pub use every_vec_struct_type::EveryVecStruct; pub use indexed_simple_enum_table::*; pub use indexed_simple_enum_type::IndexedSimpleEnum; -pub use indexed_table_2_table::*; pub use indexed_table_2_type::IndexedTable2; -pub use indexed_table_table::*; pub use indexed_table_type::IndexedTable; pub use insert_call_timestamp_reducer::insert_call_timestamp; pub use insert_call_uuid_v_4_reducer::insert_call_uuid_v_4; @@ -720,7 +715,6 @@ pub use result_vec_i_32_string_table::*; pub use result_vec_i_32_string_type::ResultVecI32String; pub use scheduled_table_table::*; pub use scheduled_table_type::ScheduledTable; -pub use send_scheduled_message_reducer::send_scheduled_message; pub use simple_enum_type::SimpleEnum; pub use sorted_uuids_insert_reducer::sorted_uuids_insert; pub use table_holds_table_table::*; @@ -1405,9 +1399,6 @@ pub enum Reducer { u: Vec<__sdk::Uuid>, }, NoOpSucceeds, - SendScheduledMessage { - arg: ScheduledTable, - }, SortedUuidsInsert, UpdateIndexedSimpleEnum { a: SimpleEnum, @@ -1725,7 +1716,6 @@ impl __sdk::Reducer for Reducer { Reducer::InsertVecUnitStruct { .. } => "insert_vec_unit_struct", Reducer::InsertVecUuid { .. } => "insert_vec_uuid", Reducer::NoOpSucceeds => "no_op_succeeds", - Reducer::SendScheduledMessage { .. } => "send_scheduled_message", Reducer::SortedUuidsInsert => "sorted_uuids_insert", Reducer::UpdateIndexedSimpleEnum { .. } => "update_indexed_simple_enum", Reducer::UpdatePkBool { .. } => "update_pk_bool", @@ -2445,9 +2435,6 @@ impl __sdk::Reducer for Reducer { __sats::bsatn::to_vec(&insert_vec_uuid_reducer::InsertVecUuidArgs { u: u.clone() }) } Reducer::NoOpSucceeds => __sats::bsatn::to_vec(&no_op_succeeds_reducer::NoOpSucceedsArgs {}), - Reducer::SendScheduledMessage { arg } => { - __sats::bsatn::to_vec(&send_scheduled_message_reducer::SendScheduledMessageArgs { arg: arg.clone() }) - } Reducer::SortedUuidsInsert => __sats::bsatn::to_vec(&sorted_uuids_insert_reducer::SortedUuidsInsertArgs {}), Reducer::UpdateIndexedSimpleEnum { a, b } => { __sats::bsatn::to_vec(&update_indexed_simple_enum_reducer::UpdateIndexedSimpleEnumArgs { @@ -2654,8 +2641,6 @@ impl __sdk::Reducer for Reducer { pub struct DbUpdate { btree_u_32: __sdk::TableUpdate, indexed_simple_enum: __sdk::TableUpdate, - indexed_table: __sdk::TableUpdate, - indexed_table_2: __sdk::TableUpdate, large_table: __sdk::TableUpdate, one_bool: __sdk::TableUpdate, one_byte_struct: __sdk::TableUpdate, @@ -2775,12 +2760,6 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { "indexed_simple_enum" => db_update .indexed_simple_enum .append(indexed_simple_enum_table::parse_table_update(table_update)?), - "indexed_table" => db_update - .indexed_table - .append(indexed_table_table::parse_table_update(table_update)?), - "indexed_table_2" => db_update - .indexed_table_2 - .append(indexed_table_2_table::parse_table_update(table_update)?), "large_table" => db_update .large_table .append(large_table_table::parse_table_update(table_update)?), @@ -3111,8 +3090,6 @@ impl __sdk::DbUpdate for DbUpdate { diff.btree_u_32 = cache.apply_diff_to_table::("btree_u_32", &self.btree_u_32); diff.indexed_simple_enum = cache.apply_diff_to_table::("indexed_simple_enum", &self.indexed_simple_enum); - diff.indexed_table = cache.apply_diff_to_table::("indexed_table", &self.indexed_table); - diff.indexed_table_2 = cache.apply_diff_to_table::("indexed_table_2", &self.indexed_table_2); diff.large_table = cache.apply_diff_to_table::("large_table", &self.large_table); diff.one_bool = cache.apply_diff_to_table::("one_bool", &self.one_bool); diff.one_byte_struct = cache.apply_diff_to_table::("one_byte_struct", &self.one_byte_struct); @@ -3300,12 +3277,6 @@ impl __sdk::DbUpdate for DbUpdate { "indexed_simple_enum" => db_update .indexed_simple_enum .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "indexed_table" => db_update - .indexed_table - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "indexed_table_2" => db_update - .indexed_table_2 - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "large_table" => db_update .large_table .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), @@ -3638,12 +3609,6 @@ impl __sdk::DbUpdate for DbUpdate { "indexed_simple_enum" => db_update .indexed_simple_enum .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "indexed_table" => db_update - .indexed_table - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "indexed_table_2" => db_update - .indexed_table_2 - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "large_table" => db_update .large_table .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), @@ -3974,8 +3939,6 @@ impl __sdk::DbUpdate for DbUpdate { pub struct AppliedDiff<'r> { btree_u_32: __sdk::TableAppliedDiff<'r, BTreeU32>, indexed_simple_enum: __sdk::TableAppliedDiff<'r, IndexedSimpleEnum>, - indexed_table: __sdk::TableAppliedDiff<'r, IndexedTable>, - indexed_table_2: __sdk::TableAppliedDiff<'r, IndexedTable2>, large_table: __sdk::TableAppliedDiff<'r, LargeTable>, one_bool: __sdk::TableAppliedDiff<'r, OneBool>, one_byte_struct: __sdk::TableAppliedDiff<'r, OneByteStruct>, @@ -4096,8 +4059,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { &self.indexed_simple_enum, event, ); - callbacks.invoke_table_row_callbacks::("indexed_table", &self.indexed_table, event); - callbacks.invoke_table_row_callbacks::("indexed_table_2", &self.indexed_table_2, event); callbacks.invoke_table_row_callbacks::("large_table", &self.large_table, event); callbacks.invoke_table_row_callbacks::("one_bool", &self.one_bool, event); callbacks.invoke_table_row_callbacks::("one_byte_struct", &self.one_byte_struct, event); @@ -4524,7 +4485,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, @@ -4914,8 +4875,6 @@ impl __sdk::SpacetimeModule for RemoteModule { fn register_tables(client_cache: &mut __sdk::ClientCache) { btree_u_32_table::register_table(client_cache); indexed_simple_enum_table::register_table(client_cache); - indexed_table_table::register_table(client_cache); - indexed_table_2_table::register_table(client_cache); large_table_table::register_table(client_cache); one_bool_table::register_table(client_cache); one_byte_struct_table::register_table(client_cache); @@ -5025,8 +4984,6 @@ impl __sdk::SpacetimeModule for RemoteModule { const ALL_TABLE_NAMES: &'static [&'static str] = &[ "btree_u_32", "indexed_simple_enum", - "indexed_table", - "indexed_table_2", "large_table", "one_bool", "one_byte_struct", diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_bool_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_bool_table.rs index 2ff801d601c..86243612028 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_bool_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_bool_table.rs @@ -40,7 +40,7 @@ impl OneBoolTableAccess for super::RemoteTables { pub struct OneBoolInsertCallbackId(__sdk::CallbackId); pub struct OneBoolDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneBoolTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneBoolTableHandle<'ctx> { type Row = OneBool; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneBoolTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneBoolTableHandle<'ctx> { type InsertCallbackId = OneBoolInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneBoolTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneBoolInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneBoolTableHandle<'ctx> { type DeleteCallbackId = OneBoolDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneBoolTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneBoolTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_bool"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_byte_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_byte_struct_table.rs index 583653d5c25..e9360014d3d 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_byte_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_byte_struct_table.rs @@ -41,7 +41,7 @@ impl OneByteStructTableAccess for super::RemoteTables { pub struct OneByteStructInsertCallbackId(__sdk::CallbackId); pub struct OneByteStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneByteStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneByteStructTableHandle<'ctx> { type Row = OneByteStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OneByteStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneByteStructTableHandle<'ctx> { type InsertCallbackId = OneByteStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OneByteStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneByteStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneByteStructTableHandle<'ctx> { type DeleteCallbackId = OneByteStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OneByteStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneByteStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_byte_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_connection_id_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_connection_id_table.rs index 7729d3c4276..5440ee6a246 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_connection_id_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_connection_id_table.rs @@ -40,7 +40,7 @@ impl OneConnectionIdTableAccess for super::RemoteTables { pub struct OneConnectionIdInsertCallbackId(__sdk::CallbackId); pub struct OneConnectionIdDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneConnectionIdTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneConnectionIdTableHandle<'ctx> { type Row = OneConnectionId; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneConnectionIdTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneConnectionIdTableHandle<'ctx> { type InsertCallbackId = OneConnectionIdInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneConnectionIdTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneConnectionIdInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneConnectionIdTableHandle<'ctx> { type DeleteCallbackId = OneConnectionIdDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneConnectionIdTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneConnectionIdTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_connection_id"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs index 4678f789925..1b1c7bbf82d 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_enum_with_payload_table.rs @@ -41,7 +41,7 @@ impl OneEnumWithPayloadTableAccess for super::RemoteTables { pub struct OneEnumWithPayloadInsertCallbackId(__sdk::CallbackId); pub struct OneEnumWithPayloadDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneEnumWithPayloadTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneEnumWithPayloadTableHandle<'ctx> { type Row = OneEnumWithPayload; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OneEnumWithPayloadTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneEnumWithPayloadTableHandle<'ctx> { type InsertCallbackId = OneEnumWithPayloadInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OneEnumWithPayloadTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneEnumWithPayloadInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneEnumWithPayloadTableHandle<'ctx> { type DeleteCallbackId = OneEnumWithPayloadDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OneEnumWithPayloadTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneEnumWithPayloadTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_enum_with_payload"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs index e90f30e64c7..35953662d84 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_every_primitive_struct_table.rs @@ -43,7 +43,7 @@ impl OneEveryPrimitiveStructTableAccess for super::RemoteTables { pub struct OneEveryPrimitiveStructInsertCallbackId(__sdk::CallbackId); pub struct OneEveryPrimitiveStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneEveryPrimitiveStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneEveryPrimitiveStructTableHandle<'ctx> { type Row = OneEveryPrimitiveStruct; type EventContext = super::EventContext; @@ -53,7 +53,9 @@ impl<'ctx> __sdk::Table for OneEveryPrimitiveStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneEveryPrimitiveStructTableHandle<'ctx> { type InsertCallbackId = OneEveryPrimitiveStructInsertCallbackId; fn on_insert( @@ -66,7 +68,9 @@ impl<'ctx> __sdk::Table for OneEveryPrimitiveStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneEveryPrimitiveStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneEveryPrimitiveStructTableHandle<'ctx> { type DeleteCallbackId = OneEveryPrimitiveStructDeleteCallbackId; fn on_delete( @@ -81,6 +85,8 @@ impl<'ctx> __sdk::Table for OneEveryPrimitiveStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneEveryPrimitiveStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_every_primitive_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs index 42cd12476ec..04ec26c8f49 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_every_vec_struct_table.rs @@ -41,7 +41,7 @@ impl OneEveryVecStructTableAccess for super::RemoteTables { pub struct OneEveryVecStructInsertCallbackId(__sdk::CallbackId); pub struct OneEveryVecStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneEveryVecStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneEveryVecStructTableHandle<'ctx> { type Row = OneEveryVecStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OneEveryVecStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneEveryVecStructTableHandle<'ctx> { type InsertCallbackId = OneEveryVecStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OneEveryVecStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneEveryVecStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneEveryVecStructTableHandle<'ctx> { type DeleteCallbackId = OneEveryVecStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OneEveryVecStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneEveryVecStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_every_vec_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_f_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_f_32_table.rs index e083d39f730..62d0fbccaf2 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_f_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_f_32_table.rs @@ -40,7 +40,7 @@ impl OneF32TableAccess for super::RemoteTables { pub struct OneF32InsertCallbackId(__sdk::CallbackId); pub struct OneF32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneF32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneF32TableHandle<'ctx> { type Row = OneF32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneF32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneF32TableHandle<'ctx> { type InsertCallbackId = OneF32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneF32TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneF32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneF32TableHandle<'ctx> { type DeleteCallbackId = OneF32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneF32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneF32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_f_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_f_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_f_64_table.rs index 7a3f5de637b..5fb4c92f940 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_f_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_f_64_table.rs @@ -40,7 +40,7 @@ impl OneF64TableAccess for super::RemoteTables { pub struct OneF64InsertCallbackId(__sdk::CallbackId); pub struct OneF64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneF64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneF64TableHandle<'ctx> { type Row = OneF64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneF64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneF64TableHandle<'ctx> { type InsertCallbackId = OneF64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneF64TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneF64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneF64TableHandle<'ctx> { type DeleteCallbackId = OneF64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneF64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneF64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_f_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_128_table.rs index ebff49e97a1..231b1103cb1 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_128_table.rs @@ -40,7 +40,7 @@ impl OneI128TableAccess for super::RemoteTables { pub struct OneI128InsertCallbackId(__sdk::CallbackId); pub struct OneI128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI128TableHandle<'ctx> { type Row = OneI128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI128TableHandle<'ctx> { type InsertCallbackId = OneI128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI128TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI128TableHandle<'ctx> { type DeleteCallbackId = OneI128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI128TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_128"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_16_table.rs index 6a0ca13292b..d97c2dff8e7 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_16_table.rs @@ -40,7 +40,7 @@ impl OneI16TableAccess for super::RemoteTables { pub struct OneI16InsertCallbackId(__sdk::CallbackId); pub struct OneI16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI16TableHandle<'ctx> { type Row = OneI16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI16TableHandle<'ctx> { type InsertCallbackId = OneI16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI16TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI16TableHandle<'ctx> { type DeleteCallbackId = OneI16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI16TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_16"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_256_table.rs index 1c8cf51fa96..23f50b249d0 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_256_table.rs @@ -40,7 +40,7 @@ impl OneI256TableAccess for super::RemoteTables { pub struct OneI256InsertCallbackId(__sdk::CallbackId); pub struct OneI256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI256TableHandle<'ctx> { type Row = OneI256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI256TableHandle<'ctx> { type InsertCallbackId = OneI256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI256TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI256TableHandle<'ctx> { type DeleteCallbackId = OneI256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI256TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_256"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_32_table.rs index 22343727a10..4a9d464925c 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_32_table.rs @@ -40,7 +40,7 @@ impl OneI32TableAccess for super::RemoteTables { pub struct OneI32InsertCallbackId(__sdk::CallbackId); pub struct OneI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI32TableHandle<'ctx> { type Row = OneI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI32TableHandle<'ctx> { type InsertCallbackId = OneI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI32TableHandle<'ctx> { type DeleteCallbackId = OneI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_64_table.rs index f9c64a63f43..96708f0618a 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_64_table.rs @@ -40,7 +40,7 @@ impl OneI64TableAccess for super::RemoteTables { pub struct OneI64InsertCallbackId(__sdk::CallbackId); pub struct OneI64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI64TableHandle<'ctx> { type Row = OneI64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI64TableHandle<'ctx> { type InsertCallbackId = OneI64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI64TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI64TableHandle<'ctx> { type DeleteCallbackId = OneI64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_i_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_i_8_table.rs index 1f982cf650d..3a82b192483 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_i_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_i_8_table.rs @@ -40,7 +40,7 @@ impl OneI8TableAccess for super::RemoteTables { pub struct OneI8InsertCallbackId(__sdk::CallbackId); pub struct OneI8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneI8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneI8TableHandle<'ctx> { type Row = OneI8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneI8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneI8TableHandle<'ctx> { type InsertCallbackId = OneI8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneI8TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneI8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneI8TableHandle<'ctx> { type DeleteCallbackId = OneI8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneI8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneI8TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_i_8"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_identity_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_identity_table.rs index 0752919e36f..cfd37a0ab93 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_identity_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_identity_table.rs @@ -40,7 +40,7 @@ impl OneIdentityTableAccess for super::RemoteTables { pub struct OneIdentityInsertCallbackId(__sdk::CallbackId); pub struct OneIdentityDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneIdentityTableHandle<'ctx> { type Row = OneIdentity; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneIdentityTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneIdentityTableHandle<'ctx> { type InsertCallbackId = OneIdentityInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneIdentityTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneIdentityInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneIdentityTableHandle<'ctx> { type DeleteCallbackId = OneIdentityDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneIdentityTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_identity"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_simple_enum_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_simple_enum_table.rs index 5497a4ec3d7..6060df61c7e 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_simple_enum_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_simple_enum_table.rs @@ -41,7 +41,7 @@ impl OneSimpleEnumTableAccess for super::RemoteTables { pub struct OneSimpleEnumInsertCallbackId(__sdk::CallbackId); pub struct OneSimpleEnumDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneSimpleEnumTableHandle<'ctx> { type Row = OneSimpleEnum; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OneSimpleEnumTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneSimpleEnumTableHandle<'ctx> { type InsertCallbackId = OneSimpleEnumInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OneSimpleEnumTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneSimpleEnumInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneSimpleEnumTableHandle<'ctx> { type DeleteCallbackId = OneSimpleEnumDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OneSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneSimpleEnumTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_simple_enum"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_string_table.rs index 43ba9653704..6a9bd7f1c94 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_string_table.rs @@ -40,7 +40,7 @@ impl OneStringTableAccess for super::RemoteTables { pub struct OneStringInsertCallbackId(__sdk::CallbackId); pub struct OneStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneStringTableHandle<'ctx> { type Row = OneString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneStringTableHandle<'ctx> { type InsertCallbackId = OneStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneStringTableHandle<'ctx> { type DeleteCallbackId = OneStringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneStringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_timestamp_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_timestamp_table.rs index 15219ae1931..79f25cc31eb 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_timestamp_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_timestamp_table.rs @@ -40,7 +40,7 @@ impl OneTimestampTableAccess for super::RemoteTables { pub struct OneTimestampInsertCallbackId(__sdk::CallbackId); pub struct OneTimestampDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneTimestampTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneTimestampTableHandle<'ctx> { type Row = OneTimestamp; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneTimestampTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneTimestampTableHandle<'ctx> { type InsertCallbackId = OneTimestampInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneTimestampTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneTimestampInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneTimestampTableHandle<'ctx> { type DeleteCallbackId = OneTimestampDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneTimestampTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneTimestampTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_timestamp"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_128_table.rs index c6c3b8405a4..9f454322d33 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_128_table.rs @@ -40,7 +40,7 @@ impl OneU128TableAccess for super::RemoteTables { pub struct OneU128InsertCallbackId(__sdk::CallbackId); pub struct OneU128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU128TableHandle<'ctx> { type Row = OneU128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU128TableHandle<'ctx> { type InsertCallbackId = OneU128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU128TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU128TableHandle<'ctx> { type DeleteCallbackId = OneU128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU128TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_128"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_16_table.rs index 73a291c8cea..3428cc982d9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_16_table.rs @@ -40,7 +40,7 @@ impl OneU16TableAccess for super::RemoteTables { pub struct OneU16InsertCallbackId(__sdk::CallbackId); pub struct OneU16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU16TableHandle<'ctx> { type Row = OneU16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU16TableHandle<'ctx> { type InsertCallbackId = OneU16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU16TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU16TableHandle<'ctx> { type DeleteCallbackId = OneU16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU16TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_16"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_256_table.rs index e5c07561c26..6d6322d0af1 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_256_table.rs @@ -40,7 +40,7 @@ impl OneU256TableAccess for super::RemoteTables { pub struct OneU256InsertCallbackId(__sdk::CallbackId); pub struct OneU256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU256TableHandle<'ctx> { type Row = OneU256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU256TableHandle<'ctx> { type InsertCallbackId = OneU256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU256TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU256TableHandle<'ctx> { type DeleteCallbackId = OneU256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU256TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_256"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_32_table.rs index c818a74eace..12d035cc0fa 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_32_table.rs @@ -40,7 +40,7 @@ impl OneU32TableAccess for super::RemoteTables { pub struct OneU32InsertCallbackId(__sdk::CallbackId); pub struct OneU32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU32TableHandle<'ctx> { type Row = OneU32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU32TableHandle<'ctx> { type InsertCallbackId = OneU32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU32TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU32TableHandle<'ctx> { type DeleteCallbackId = OneU32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_64_table.rs index 1addfb72311..74e363565d6 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_64_table.rs @@ -40,7 +40,7 @@ impl OneU64TableAccess for super::RemoteTables { pub struct OneU64InsertCallbackId(__sdk::CallbackId); pub struct OneU64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU64TableHandle<'ctx> { type Row = OneU64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU64TableHandle<'ctx> { type InsertCallbackId = OneU64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU64TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU64TableHandle<'ctx> { type DeleteCallbackId = OneU64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_u_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_u_8_table.rs index 4ea390ae321..3d02f500ae6 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_u_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_u_8_table.rs @@ -40,7 +40,7 @@ impl OneU8TableAccess for super::RemoteTables { pub struct OneU8InsertCallbackId(__sdk::CallbackId); pub struct OneU8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneU8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneU8TableHandle<'ctx> { type Row = OneU8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneU8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneU8TableHandle<'ctx> { type InsertCallbackId = OneU8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneU8TableHandle<'ctx> { fn remove_on_insert(&self, callback: OneU8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneU8TableHandle<'ctx> { type DeleteCallbackId = OneU8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneU8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneU8TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_u_8"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_unit_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_unit_struct_table.rs index 6af7cd5ab89..2482b683bf4 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_unit_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_unit_struct_table.rs @@ -41,7 +41,7 @@ impl OneUnitStructTableAccess for super::RemoteTables { pub struct OneUnitStructInsertCallbackId(__sdk::CallbackId); pub struct OneUnitStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneUnitStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneUnitStructTableHandle<'ctx> { type Row = OneUnitStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OneUnitStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneUnitStructTableHandle<'ctx> { type InsertCallbackId = OneUnitStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OneUnitStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneUnitStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneUnitStructTableHandle<'ctx> { type DeleteCallbackId = OneUnitStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OneUnitStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneUnitStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_unit_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/one_uuid_table.rs b/sdks/rust/tests/test-client/src/module_bindings/one_uuid_table.rs index 414f0f05962..8ac6a64c36f 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/one_uuid_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/one_uuid_table.rs @@ -40,7 +40,7 @@ impl OneUuidTableAccess for super::RemoteTables { pub struct OneUuidInsertCallbackId(__sdk::CallbackId); pub struct OneUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OneUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OneUuidTableHandle<'ctx> { type Row = OneUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OneUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OneUuidTableHandle<'ctx> { type InsertCallbackId = OneUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OneUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: OneUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OneUuidTableHandle<'ctx> { type DeleteCallbackId = OneUuidDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OneUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OneUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("one_uuid"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs index b1933882ccd..8f65fa7313b 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_every_primitive_struct_table.rs @@ -43,7 +43,7 @@ impl OptionEveryPrimitiveStructTableAccess for super::RemoteTables { pub struct OptionEveryPrimitiveStructInsertCallbackId(__sdk::CallbackId); pub struct OptionEveryPrimitiveStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionEveryPrimitiveStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionEveryPrimitiveStructTableHandle<'ctx> { type Row = OptionEveryPrimitiveStruct; type EventContext = super::EventContext; @@ -53,7 +53,9 @@ impl<'ctx> __sdk::Table for OptionEveryPrimitiveStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionEveryPrimitiveStructTableHandle<'ctx> { type InsertCallbackId = OptionEveryPrimitiveStructInsertCallbackId; fn on_insert( @@ -66,7 +68,9 @@ impl<'ctx> __sdk::Table for OptionEveryPrimitiveStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionEveryPrimitiveStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionEveryPrimitiveStructTableHandle<'ctx> { type DeleteCallbackId = OptionEveryPrimitiveStructDeleteCallbackId; fn on_delete( @@ -81,6 +85,8 @@ impl<'ctx> __sdk::Table for OptionEveryPrimitiveStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionEveryPrimitiveStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_every_primitive_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_i_32_table.rs index b23a358174f..8489b8a074e 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_i_32_table.rs @@ -40,7 +40,7 @@ impl OptionI32TableAccess for super::RemoteTables { pub struct OptionI32InsertCallbackId(__sdk::CallbackId); pub struct OptionI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionI32TableHandle<'ctx> { type Row = OptionI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OptionI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionI32TableHandle<'ctx> { type InsertCallbackId = OptionI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OptionI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionI32TableHandle<'ctx> { type DeleteCallbackId = OptionI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OptionI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_identity_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_identity_table.rs index 06e66352971..e5083b224bf 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_identity_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_identity_table.rs @@ -40,7 +40,7 @@ impl OptionIdentityTableAccess for super::RemoteTables { pub struct OptionIdentityInsertCallbackId(__sdk::CallbackId); pub struct OptionIdentityDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionIdentityTableHandle<'ctx> { type Row = OptionIdentity; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OptionIdentityTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionIdentityTableHandle<'ctx> { type InsertCallbackId = OptionIdentityInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OptionIdentityTableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionIdentityInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionIdentityTableHandle<'ctx> { type DeleteCallbackId = OptionIdentityDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OptionIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionIdentityTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_identity"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_simple_enum_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_simple_enum_table.rs index e4567161113..154180af08b 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_simple_enum_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_simple_enum_table.rs @@ -41,7 +41,7 @@ impl OptionSimpleEnumTableAccess for super::RemoteTables { pub struct OptionSimpleEnumInsertCallbackId(__sdk::CallbackId); pub struct OptionSimpleEnumDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionSimpleEnumTableHandle<'ctx> { type Row = OptionSimpleEnum; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for OptionSimpleEnumTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionSimpleEnumTableHandle<'ctx> { type InsertCallbackId = OptionSimpleEnumInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for OptionSimpleEnumTableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionSimpleEnumInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionSimpleEnumTableHandle<'ctx> { type DeleteCallbackId = OptionSimpleEnumDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for OptionSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionSimpleEnumTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_simple_enum"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_string_table.rs index 91c819df742..1d586f339d4 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_string_table.rs @@ -40,7 +40,7 @@ impl OptionStringTableAccess for super::RemoteTables { pub struct OptionStringInsertCallbackId(__sdk::CallbackId); pub struct OptionStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionStringTableHandle<'ctx> { type Row = OptionString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OptionStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionStringTableHandle<'ctx> { type InsertCallbackId = OptionStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OptionStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionStringTableHandle<'ctx> { type DeleteCallbackId = OptionStringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OptionStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionStringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_uuid_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_uuid_table.rs index b9ace60a6fa..7a4ccef0b1b 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_uuid_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_uuid_table.rs @@ -40,7 +40,7 @@ impl OptionUuidTableAccess for super::RemoteTables { pub struct OptionUuidInsertCallbackId(__sdk::CallbackId); pub struct OptionUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionUuidTableHandle<'ctx> { type Row = OptionUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OptionUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionUuidTableHandle<'ctx> { type InsertCallbackId = OptionUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OptionUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionUuidTableHandle<'ctx> { type DeleteCallbackId = OptionUuidDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OptionUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_uuid"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs index bb42948ded7..5e64684de30 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/option_vec_option_i_32_table.rs @@ -40,7 +40,7 @@ impl OptionVecOptionI32TableAccess for super::RemoteTables { pub struct OptionVecOptionI32InsertCallbackId(__sdk::CallbackId); pub struct OptionVecOptionI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for OptionVecOptionI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for OptionVecOptionI32TableHandle<'ctx> { type Row = OptionVecOptionI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for OptionVecOptionI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for OptionVecOptionI32TableHandle<'ctx> { type InsertCallbackId = OptionVecOptionI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for OptionVecOptionI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: OptionVecOptionI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for OptionVecOptionI32TableHandle<'ctx> { type DeleteCallbackId = OptionVecOptionI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for OptionVecOptionI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for OptionVecOptionI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("option_vec_option_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_bool_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_bool_table.rs index 56cfe6eb2c8..5dd0afa2216 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_bool_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_bool_table.rs @@ -40,7 +40,7 @@ impl PkBoolTableAccess for super::RemoteTables { pub struct PkBoolInsertCallbackId(__sdk::CallbackId); pub struct PkBoolDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkBoolTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkBoolTableHandle<'ctx> { type Row = PkBool; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkBoolTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkBoolTableHandle<'ctx> { type InsertCallbackId = PkBoolInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkBoolTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkBoolInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkBoolTableHandle<'ctx> { type DeleteCallbackId = PkBoolDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkBoolTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkBoolTableHandle<'ctx> {} + pub struct PkBoolUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkBoolTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkBoolTableHandle<'ctx> { type UpdateCallbackId = PkBoolUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkBoolTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkBoolTableHandle<'ctx> {} + /// Access to the `b` unique index on the table `pk_bool`, /// which allows point queries on the field of the same name /// via the [`PkBoolBUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_connection_id_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_connection_id_table.rs index ef7c0081c54..5f23884d387 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_connection_id_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_connection_id_table.rs @@ -40,7 +40,7 @@ impl PkConnectionIdTableAccess for super::RemoteTables { pub struct PkConnectionIdInsertCallbackId(__sdk::CallbackId); pub struct PkConnectionIdDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkConnectionIdTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkConnectionIdTableHandle<'ctx> { type Row = PkConnectionId; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkConnectionIdTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkConnectionIdTableHandle<'ctx> { type InsertCallbackId = PkConnectionIdInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkConnectionIdTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkConnectionIdInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkConnectionIdTableHandle<'ctx> { type DeleteCallbackId = PkConnectionIdDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkConnectionIdTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkConnectionIdTableHandle<'ctx> {} + pub struct PkConnectionIdUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkConnectionIdTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkConnectionIdTableHandle<'ctx> { type UpdateCallbackId = PkConnectionIdUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkConnectionIdTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkConnectionIdTableHandle<'ctx> {} + /// Access to the `a` unique index on the table `pk_connection_id`, /// which allows point queries on the field of the same name /// via the [`PkConnectionIdAUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_128_table.rs index ed52b296500..2ac114b267f 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_128_table.rs @@ -40,7 +40,7 @@ impl PkI128TableAccess for super::RemoteTables { pub struct PkI128InsertCallbackId(__sdk::CallbackId); pub struct PkI128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI128TableHandle<'ctx> { type Row = PkI128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI128TableHandle<'ctx> { type InsertCallbackId = PkI128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI128TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI128TableHandle<'ctx> { type DeleteCallbackId = PkI128DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI128TableHandle<'ctx> {} + pub struct PkI128UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI128TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI128TableHandle<'ctx> { type UpdateCallbackId = PkI128UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI128TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI128TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_128`, /// which allows point queries on the field of the same name /// via the [`PkI128NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_16_table.rs index acfc4d4d4cf..8183b707a61 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_16_table.rs @@ -40,7 +40,7 @@ impl PkI16TableAccess for super::RemoteTables { pub struct PkI16InsertCallbackId(__sdk::CallbackId); pub struct PkI16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI16TableHandle<'ctx> { type Row = PkI16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI16TableHandle<'ctx> { type InsertCallbackId = PkI16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI16TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI16TableHandle<'ctx> { type DeleteCallbackId = PkI16DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI16TableHandle<'ctx> {} + pub struct PkI16UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI16TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI16TableHandle<'ctx> { type UpdateCallbackId = PkI16UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI16TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI16TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_16`, /// which allows point queries on the field of the same name /// via the [`PkI16NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_256_table.rs index 9cf4d71b655..a4af0fe764e 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_256_table.rs @@ -40,7 +40,7 @@ impl PkI256TableAccess for super::RemoteTables { pub struct PkI256InsertCallbackId(__sdk::CallbackId); pub struct PkI256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI256TableHandle<'ctx> { type Row = PkI256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI256TableHandle<'ctx> { type InsertCallbackId = PkI256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI256TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI256TableHandle<'ctx> { type DeleteCallbackId = PkI256DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI256TableHandle<'ctx> {} + pub struct PkI256UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI256TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI256TableHandle<'ctx> { type UpdateCallbackId = PkI256UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI256TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI256TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_256`, /// which allows point queries on the field of the same name /// via the [`PkI256NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_32_table.rs index 01c7410cfb2..304863fc073 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_32_table.rs @@ -40,7 +40,7 @@ impl PkI32TableAccess for super::RemoteTables { pub struct PkI32InsertCallbackId(__sdk::CallbackId); pub struct PkI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI32TableHandle<'ctx> { type Row = PkI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI32TableHandle<'ctx> { type InsertCallbackId = PkI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI32TableHandle<'ctx> { type DeleteCallbackId = PkI32DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI32TableHandle<'ctx> {} + pub struct PkI32UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI32TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI32TableHandle<'ctx> { type UpdateCallbackId = PkI32UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI32TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_32`, /// which allows point queries on the field of the same name /// via the [`PkI32NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_64_table.rs index b6c486ade37..83a8f605d23 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_64_table.rs @@ -40,7 +40,7 @@ impl PkI64TableAccess for super::RemoteTables { pub struct PkI64InsertCallbackId(__sdk::CallbackId); pub struct PkI64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI64TableHandle<'ctx> { type Row = PkI64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI64TableHandle<'ctx> { type InsertCallbackId = PkI64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI64TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI64TableHandle<'ctx> { type DeleteCallbackId = PkI64DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI64TableHandle<'ctx> {} + pub struct PkI64UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI64TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI64TableHandle<'ctx> { type UpdateCallbackId = PkI64UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI64TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI64TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_64`, /// which allows point queries on the field of the same name /// via the [`PkI64NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_i_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_i_8_table.rs index 010b1b45793..e953dd8b732 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_i_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_i_8_table.rs @@ -40,7 +40,7 @@ impl PkI8TableAccess for super::RemoteTables { pub struct PkI8InsertCallbackId(__sdk::CallbackId); pub struct PkI8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkI8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkI8TableHandle<'ctx> { type Row = PkI8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkI8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkI8TableHandle<'ctx> { type InsertCallbackId = PkI8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkI8TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkI8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkI8TableHandle<'ctx> { type DeleteCallbackId = PkI8DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkI8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkI8TableHandle<'ctx> {} + pub struct PkI8UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkI8TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkI8TableHandle<'ctx> { type UpdateCallbackId = PkI8UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkI8TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkI8TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_i_8`, /// which allows point queries on the field of the same name /// via the [`PkI8NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_identity_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_identity_table.rs index 6e52e47ea50..1b65a3fef45 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_identity_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_identity_table.rs @@ -40,7 +40,7 @@ impl PkIdentityTableAccess for super::RemoteTables { pub struct PkIdentityInsertCallbackId(__sdk::CallbackId); pub struct PkIdentityDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkIdentityTableHandle<'ctx> { type Row = PkIdentity; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkIdentityTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkIdentityTableHandle<'ctx> { type InsertCallbackId = PkIdentityInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkIdentityTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkIdentityInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkIdentityTableHandle<'ctx> { type DeleteCallbackId = PkIdentityDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkIdentityTableHandle<'ctx> {} + pub struct PkIdentityUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkIdentityTableHandle<'ctx> { type UpdateCallbackId = PkIdentityUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkIdentityTableHandle<'ctx> {} + /// Access to the `i` unique index on the table `pk_identity`, /// which allows point queries on the field of the same name /// via the [`PkIdentityIUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_simple_enum_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_simple_enum_table.rs index 5e51f22be69..90048831b7e 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_simple_enum_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_simple_enum_table.rs @@ -41,7 +41,7 @@ impl PkSimpleEnumTableAccess for super::RemoteTables { pub struct PkSimpleEnumInsertCallbackId(__sdk::CallbackId); pub struct PkSimpleEnumDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkSimpleEnumTableHandle<'ctx> { type Row = PkSimpleEnum; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for PkSimpleEnumTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkSimpleEnumTableHandle<'ctx> { type InsertCallbackId = PkSimpleEnumInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for PkSimpleEnumTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkSimpleEnumInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkSimpleEnumTableHandle<'ctx> { type DeleteCallbackId = PkSimpleEnumDeleteCallbackId; fn on_delete( @@ -79,9 +83,11 @@ impl<'ctx> __sdk::Table for PkSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkSimpleEnumTableHandle<'ctx> {} + pub struct PkSimpleEnumUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkSimpleEnumTableHandle<'ctx> { type UpdateCallbackId = PkSimpleEnumUpdateCallbackId; fn on_update( @@ -96,6 +102,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkSimpleEnumTableHandle<'ctx> {} + /// Access to the `a` unique index on the table `pk_simple_enum`, /// which allows point queries on the field of the same name /// via the [`PkSimpleEnumAUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_string_table.rs index 8f31b1e280b..a6ce1ef92b6 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_string_table.rs @@ -40,7 +40,7 @@ impl PkStringTableAccess for super::RemoteTables { pub struct PkStringInsertCallbackId(__sdk::CallbackId); pub struct PkStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkStringTableHandle<'ctx> { type Row = PkString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkStringTableHandle<'ctx> { type InsertCallbackId = PkStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkStringTableHandle<'ctx> { type DeleteCallbackId = PkStringDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkStringTableHandle<'ctx> {} + pub struct PkStringUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkStringTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkStringTableHandle<'ctx> { type UpdateCallbackId = PkStringUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkStringTableHandle<'ctx> {} + /// Access to the `s` unique index on the table `pk_string`, /// which allows point queries on the field of the same name /// via the [`PkStringSUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_128_table.rs index 4ef0969e695..de5b171f5cb 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_128_table.rs @@ -40,7 +40,7 @@ impl PkU128TableAccess for super::RemoteTables { pub struct PkU128InsertCallbackId(__sdk::CallbackId); pub struct PkU128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU128TableHandle<'ctx> { type Row = PkU128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU128TableHandle<'ctx> { type InsertCallbackId = PkU128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU128TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU128TableHandle<'ctx> { type DeleteCallbackId = PkU128DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU128TableHandle<'ctx> {} + pub struct PkU128UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU128TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU128TableHandle<'ctx> { type UpdateCallbackId = PkU128UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU128TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU128TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_128`, /// which allows point queries on the field of the same name /// via the [`PkU128NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_16_table.rs index 136479f3749..3223e04be1b 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_16_table.rs @@ -40,7 +40,7 @@ impl PkU16TableAccess for super::RemoteTables { pub struct PkU16InsertCallbackId(__sdk::CallbackId); pub struct PkU16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU16TableHandle<'ctx> { type Row = PkU16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU16TableHandle<'ctx> { type InsertCallbackId = PkU16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU16TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU16TableHandle<'ctx> { type DeleteCallbackId = PkU16DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU16TableHandle<'ctx> {} + pub struct PkU16UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU16TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU16TableHandle<'ctx> { type UpdateCallbackId = PkU16UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU16TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU16TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_16`, /// which allows point queries on the field of the same name /// via the [`PkU16NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_256_table.rs index 19b6f7c59ba..382cda2b4a1 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_256_table.rs @@ -40,7 +40,7 @@ impl PkU256TableAccess for super::RemoteTables { pub struct PkU256InsertCallbackId(__sdk::CallbackId); pub struct PkU256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU256TableHandle<'ctx> { type Row = PkU256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU256TableHandle<'ctx> { type InsertCallbackId = PkU256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU256TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU256TableHandle<'ctx> { type DeleteCallbackId = PkU256DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU256TableHandle<'ctx> {} + pub struct PkU256UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU256TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU256TableHandle<'ctx> { type UpdateCallbackId = PkU256UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU256TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU256TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_256`, /// which allows point queries on the field of the same name /// via the [`PkU256NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_table.rs index 670ccd0ff52..886326fb62c 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_table.rs @@ -40,7 +40,7 @@ impl PkU32TableAccess for super::RemoteTables { pub struct PkU32InsertCallbackId(__sdk::CallbackId); pub struct PkU32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU32TableHandle<'ctx> { type Row = PkU32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU32TableHandle<'ctx> { type InsertCallbackId = PkU32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU32TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU32TableHandle<'ctx> { type DeleteCallbackId = PkU32DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU32TableHandle<'ctx> {} + pub struct PkU32UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU32TableHandle<'ctx> { type UpdateCallbackId = PkU32UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_32`, /// which allows point queries on the field of the same name /// via the [`PkU32NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_two_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_two_table.rs index 176afc27be4..dbead556ff5 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_two_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_32_two_table.rs @@ -40,7 +40,7 @@ impl PkU32TwoTableAccess for super::RemoteTables { pub struct PkU32TwoInsertCallbackId(__sdk::CallbackId); pub struct PkU32TwoDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU32TwoTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU32TwoTableHandle<'ctx> { type Row = PkU32Two; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU32TwoTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU32TwoTableHandle<'ctx> { type InsertCallbackId = PkU32TwoInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU32TwoTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU32TwoInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU32TwoTableHandle<'ctx> { type DeleteCallbackId = PkU32TwoDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU32TwoTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU32TwoTableHandle<'ctx> {} + pub struct PkU32TwoUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TwoTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU32TwoTableHandle<'ctx> { type UpdateCallbackId = PkU32TwoUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TwoTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU32TwoTableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_32_two`, /// which allows point queries on the field of the same name /// via the [`PkU32TwoNUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_64_table.rs index 7ebda9ee9b5..991b42781dd 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_64_table.rs @@ -40,7 +40,7 @@ impl PkU64TableAccess for super::RemoteTables { pub struct PkU64InsertCallbackId(__sdk::CallbackId); pub struct PkU64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU64TableHandle<'ctx> { type Row = PkU64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU64TableHandle<'ctx> { type InsertCallbackId = PkU64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU64TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU64TableHandle<'ctx> { type DeleteCallbackId = PkU64DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU64TableHandle<'ctx> {} + pub struct PkU64UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU64TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU64TableHandle<'ctx> { type UpdateCallbackId = PkU64UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU64TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU64TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_64`, /// which allows point queries on the field of the same name /// via the [`PkU64NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_u_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_u_8_table.rs index 4603dc0295b..fc8d8e96de9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_u_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_u_8_table.rs @@ -40,7 +40,7 @@ impl PkU8TableAccess for super::RemoteTables { pub struct PkU8InsertCallbackId(__sdk::CallbackId); pub struct PkU8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkU8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkU8TableHandle<'ctx> { type Row = PkU8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkU8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkU8TableHandle<'ctx> { type InsertCallbackId = PkU8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkU8TableHandle<'ctx> { fn remove_on_insert(&self, callback: PkU8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkU8TableHandle<'ctx> { type DeleteCallbackId = PkU8DeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkU8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkU8TableHandle<'ctx> {} + pub struct PkU8UpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkU8TableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkU8TableHandle<'ctx> { type UpdateCallbackId = PkU8UpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkU8TableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkU8TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `pk_u_8`, /// which allows point queries on the field of the same name /// via the [`PkU8NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/pk_uuid_table.rs b/sdks/rust/tests/test-client/src/module_bindings/pk_uuid_table.rs index 2e72f521768..e7f86aa4071 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/pk_uuid_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/pk_uuid_table.rs @@ -40,7 +40,7 @@ impl PkUuidTableAccess for super::RemoteTables { pub struct PkUuidInsertCallbackId(__sdk::CallbackId); pub struct PkUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PkUuidTableHandle<'ctx> { type Row = PkUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PkUuidTableHandle<'ctx> { type InsertCallbackId = PkUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: PkUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PkUuidTableHandle<'ctx> { type DeleteCallbackId = PkUuidDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PkUuidTableHandle<'ctx> {} + pub struct PkUuidUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PkUuidTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PkUuidTableHandle<'ctx> { type UpdateCallbackId = PkUuidUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PkUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PkUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("pk_uuid"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_every_primitive_struct_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_every_primitive_struct_string_table.rs index 2536cbb8b0f..365d692554a 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_every_primitive_struct_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_every_primitive_struct_string_table.rs @@ -43,7 +43,7 @@ impl ResultEveryPrimitiveStructStringTableAccess for super::RemoteTables { pub struct ResultEveryPrimitiveStructStringInsertCallbackId(__sdk::CallbackId); pub struct ResultEveryPrimitiveStructStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultEveryPrimitiveStructStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultEveryPrimitiveStructStringTableHandle<'ctx> { type Row = ResultEveryPrimitiveStructString; type EventContext = super::EventContext; @@ -53,7 +53,9 @@ impl<'ctx> __sdk::Table for ResultEveryPrimitiveStructStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultEveryPrimitiveStructStringTableHandle<'ctx> { type InsertCallbackId = ResultEveryPrimitiveStructStringInsertCallbackId; fn on_insert( @@ -66,7 +68,9 @@ impl<'ctx> __sdk::Table for ResultEveryPrimitiveStructStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultEveryPrimitiveStructStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultEveryPrimitiveStructStringTableHandle<'ctx> { type DeleteCallbackId = ResultEveryPrimitiveStructStringDeleteCallbackId; fn on_delete( @@ -81,6 +85,8 @@ impl<'ctx> __sdk::Table for ResultEveryPrimitiveStructStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultEveryPrimitiveStructStringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_i_32_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_i_32_string_table.rs index 991122618d2..d55dcb8f882 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_i_32_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_i_32_string_table.rs @@ -40,7 +40,7 @@ impl ResultI32StringTableAccess for super::RemoteTables { pub struct ResultI32StringInsertCallbackId(__sdk::CallbackId); pub struct ResultI32StringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultI32StringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultI32StringTableHandle<'ctx> { type Row = ResultI32String; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ResultI32StringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultI32StringTableHandle<'ctx> { type InsertCallbackId = ResultI32StringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ResultI32StringTableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultI32StringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultI32StringTableHandle<'ctx> { type DeleteCallbackId = ResultI32StringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ResultI32StringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultI32StringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("result_i_32_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_identity_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_identity_string_table.rs index 34d9f6e4cee..297c34746aa 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_identity_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_identity_string_table.rs @@ -40,7 +40,7 @@ impl ResultIdentityStringTableAccess for super::RemoteTables { pub struct ResultIdentityStringInsertCallbackId(__sdk::CallbackId); pub struct ResultIdentityStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultIdentityStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultIdentityStringTableHandle<'ctx> { type Row = ResultIdentityString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ResultIdentityStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultIdentityStringTableHandle<'ctx> { type InsertCallbackId = ResultIdentityStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ResultIdentityStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultIdentityStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultIdentityStringTableHandle<'ctx> { type DeleteCallbackId = ResultIdentityStringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ResultIdentityStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultIdentityStringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("result_identity_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_simple_enum_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_simple_enum_i_32_table.rs index b35acf45ecc..5730028cbf9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_simple_enum_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_simple_enum_i_32_table.rs @@ -41,7 +41,7 @@ impl ResultSimpleEnumI32TableAccess for super::RemoteTables { pub struct ResultSimpleEnumI32InsertCallbackId(__sdk::CallbackId); pub struct ResultSimpleEnumI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultSimpleEnumI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultSimpleEnumI32TableHandle<'ctx> { type Row = ResultSimpleEnumI32; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for ResultSimpleEnumI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultSimpleEnumI32TableHandle<'ctx> { type InsertCallbackId = ResultSimpleEnumI32InsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for ResultSimpleEnumI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultSimpleEnumI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultSimpleEnumI32TableHandle<'ctx> { type DeleteCallbackId = ResultSimpleEnumI32DeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for ResultSimpleEnumI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultSimpleEnumI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("result_simple_enum_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_string_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_string_i_32_table.rs index 5d611cd1068..b67900b6426 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_string_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_string_i_32_table.rs @@ -40,7 +40,7 @@ impl ResultStringI32TableAccess for super::RemoteTables { pub struct ResultStringI32InsertCallbackId(__sdk::CallbackId); pub struct ResultStringI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultStringI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultStringI32TableHandle<'ctx> { type Row = ResultStringI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ResultStringI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultStringI32TableHandle<'ctx> { type InsertCallbackId = ResultStringI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ResultStringI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultStringI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultStringI32TableHandle<'ctx> { type DeleteCallbackId = ResultStringI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ResultStringI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultStringI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("result_string_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/result_vec_i_32_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/result_vec_i_32_string_table.rs index afd2fea744b..99e265f56bf 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/result_vec_i_32_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/result_vec_i_32_string_table.rs @@ -40,7 +40,7 @@ impl ResultVecI32StringTableAccess for super::RemoteTables { pub struct ResultVecI32StringInsertCallbackId(__sdk::CallbackId); pub struct ResultVecI32StringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ResultVecI32StringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ResultVecI32StringTableHandle<'ctx> { type Row = ResultVecI32String; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ResultVecI32StringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ResultVecI32StringTableHandle<'ctx> { type InsertCallbackId = ResultVecI32StringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ResultVecI32StringTableHandle<'ctx> { fn remove_on_insert(&self, callback: ResultVecI32StringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ResultVecI32StringTableHandle<'ctx> { type DeleteCallbackId = ResultVecI32StringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for ResultVecI32StringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ResultVecI32StringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("result_vec_i_32_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/scheduled_table_table.rs b/sdks/rust/tests/test-client/src/module_bindings/scheduled_table_table.rs index 873aed85c1c..dc20c817df6 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/scheduled_table_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/scheduled_table_table.rs @@ -40,7 +40,7 @@ impl ScheduledTableTableAccess for super::RemoteTables { pub struct ScheduledTableInsertCallbackId(__sdk::CallbackId); pub struct ScheduledTableDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ScheduledTableTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ScheduledTableTableHandle<'ctx> { type Row = ScheduledTable; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ScheduledTableTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ScheduledTableTableHandle<'ctx> { type InsertCallbackId = ScheduledTableInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ScheduledTableTableHandle<'ctx> { fn remove_on_insert(&self, callback: ScheduledTableInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ScheduledTableTableHandle<'ctx> { type DeleteCallbackId = ScheduledTableDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for ScheduledTableTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ScheduledTableTableHandle<'ctx> {} + pub struct ScheduledTableUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for ScheduledTableTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for ScheduledTableTableHandle<'ctx> { type UpdateCallbackId = ScheduledTableUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ScheduledTableTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for ScheduledTableTableHandle<'ctx> {} + /// Access to the `scheduled_id` unique index on the table `scheduled_table`, /// which allows point queries on the field of the same name /// via the [`ScheduledTableScheduledIdUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/send_scheduled_message_reducer.rs b/sdks/rust/tests/test-client/src/module_bindings/send_scheduled_message_reducer.rs deleted file mode 100644 index 2c6a5d14efa..00000000000 --- a/sdks/rust/tests/test-client/src/module_bindings/send_scheduled_message_reducer.rs +++ /dev/null @@ -1,68 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -use super::scheduled_table_type::ScheduledTable; - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -pub(super) struct SendScheduledMessageArgs { - pub arg: ScheduledTable, -} - -impl From for super::Reducer { - fn from(args: SendScheduledMessageArgs) -> Self { - Self::SendScheduledMessage { arg: args.arg } - } -} - -impl __sdk::InModule for SendScheduledMessageArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the reducer `send_scheduled_message`. -/// -/// Implemented for [`super::RemoteReducers`]. -pub trait send_scheduled_message { - /// Request that the remote module invoke the reducer `send_scheduled_message` to run as soon as possible. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and this method provides no way to listen for its completion status. - /// /// Use [`send_scheduled_message:send_scheduled_message_then`] to run a callback after the reducer completes. - fn send_scheduled_message(&self, arg: ScheduledTable) -> __sdk::Result<()> { - self.send_scheduled_message_then(arg, |_, _| {}) - } - - /// Request that the remote module invoke the reducer `send_scheduled_message` to run as soon as possible, - /// registering `callback` to run when we are notified that the reducer completed. - /// - /// This method returns immediately, and errors only if we are unable to send the request. - /// The reducer will run asynchronously in the future, - /// and its status can be observed with the `callback`. - fn send_scheduled_message_then( - &self, - arg: ScheduledTable, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()>; -} - -impl send_scheduled_message for super::RemoteReducers { - fn send_scheduled_message_then( - &self, - arg: ScheduledTable, - - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, - ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(SendScheduledMessageArgs { arg }, callback) - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/table_holds_table_table.rs b/sdks/rust/tests/test-client/src/module_bindings/table_holds_table_table.rs index 7417956456d..a33130680fb 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/table_holds_table_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/table_holds_table_table.rs @@ -42,7 +42,7 @@ impl TableHoldsTableTableAccess for super::RemoteTables { pub struct TableHoldsTableInsertCallbackId(__sdk::CallbackId); pub struct TableHoldsTableDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for TableHoldsTableTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for TableHoldsTableTableHandle<'ctx> { type Row = TableHoldsTable; type EventContext = super::EventContext; @@ -52,7 +52,9 @@ impl<'ctx> __sdk::Table for TableHoldsTableTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for TableHoldsTableTableHandle<'ctx> { type InsertCallbackId = TableHoldsTableInsertCallbackId; fn on_insert( @@ -65,7 +67,9 @@ impl<'ctx> __sdk::Table for TableHoldsTableTableHandle<'ctx> { fn remove_on_insert(&self, callback: TableHoldsTableInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for TableHoldsTableTableHandle<'ctx> { type DeleteCallbackId = TableHoldsTableDeleteCallbackId; fn on_delete( @@ -80,6 +84,8 @@ impl<'ctx> __sdk::Table for TableHoldsTableTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for TableHoldsTableTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("table_holds_table"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_bool_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_bool_table.rs index cf53f787bc2..cdb8a66fac5 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_bool_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_bool_table.rs @@ -40,7 +40,7 @@ impl UniqueBoolTableAccess for super::RemoteTables { pub struct UniqueBoolInsertCallbackId(__sdk::CallbackId); pub struct UniqueBoolDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueBoolTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueBoolTableHandle<'ctx> { type Row = UniqueBool; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueBoolTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueBoolTableHandle<'ctx> { type InsertCallbackId = UniqueBoolInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueBoolTableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueBoolInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueBoolTableHandle<'ctx> { type DeleteCallbackId = UniqueBoolDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueBoolTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueBoolTableHandle<'ctx> {} + /// Access to the `b` unique index on the table `unique_bool`, /// which allows point queries on the field of the same name /// via the [`UniqueBoolBUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_connection_id_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_connection_id_table.rs index c5f1d74fd95..561dd59bed6 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_connection_id_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_connection_id_table.rs @@ -40,7 +40,7 @@ impl UniqueConnectionIdTableAccess for super::RemoteTables { pub struct UniqueConnectionIdInsertCallbackId(__sdk::CallbackId); pub struct UniqueConnectionIdDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueConnectionIdTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueConnectionIdTableHandle<'ctx> { type Row = UniqueConnectionId; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueConnectionIdTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueConnectionIdTableHandle<'ctx> { type InsertCallbackId = UniqueConnectionIdInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueConnectionIdTableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueConnectionIdInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueConnectionIdTableHandle<'ctx> { type DeleteCallbackId = UniqueConnectionIdDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueConnectionIdTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueConnectionIdTableHandle<'ctx> {} + /// Access to the `a` unique index on the table `unique_connection_id`, /// which allows point queries on the field of the same name /// via the [`UniqueConnectionIdAUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_128_table.rs index 8282e5cbccd..149c36f18fc 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_128_table.rs @@ -40,7 +40,7 @@ impl UniqueI128TableAccess for super::RemoteTables { pub struct UniqueI128InsertCallbackId(__sdk::CallbackId); pub struct UniqueI128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI128TableHandle<'ctx> { type Row = UniqueI128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI128TableHandle<'ctx> { type InsertCallbackId = UniqueI128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI128TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI128TableHandle<'ctx> { type DeleteCallbackId = UniqueI128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI128TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_128`, /// which allows point queries on the field of the same name /// via the [`UniqueI128NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_16_table.rs index b89c23ce1c5..6753d7ba767 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_16_table.rs @@ -40,7 +40,7 @@ impl UniqueI16TableAccess for super::RemoteTables { pub struct UniqueI16InsertCallbackId(__sdk::CallbackId); pub struct UniqueI16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI16TableHandle<'ctx> { type Row = UniqueI16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI16TableHandle<'ctx> { type InsertCallbackId = UniqueI16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI16TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI16TableHandle<'ctx> { type DeleteCallbackId = UniqueI16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI16TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_16`, /// which allows point queries on the field of the same name /// via the [`UniqueI16NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_256_table.rs index 33b9d3dfad2..f5758a9e3b8 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_256_table.rs @@ -40,7 +40,7 @@ impl UniqueI256TableAccess for super::RemoteTables { pub struct UniqueI256InsertCallbackId(__sdk::CallbackId); pub struct UniqueI256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI256TableHandle<'ctx> { type Row = UniqueI256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI256TableHandle<'ctx> { type InsertCallbackId = UniqueI256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI256TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI256TableHandle<'ctx> { type DeleteCallbackId = UniqueI256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI256TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_256`, /// which allows point queries on the field of the same name /// via the [`UniqueI256NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_32_table.rs index cead866df5c..07eb1ac3f67 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_32_table.rs @@ -40,7 +40,7 @@ impl UniqueI32TableAccess for super::RemoteTables { pub struct UniqueI32InsertCallbackId(__sdk::CallbackId); pub struct UniqueI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI32TableHandle<'ctx> { type Row = UniqueI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI32TableHandle<'ctx> { type InsertCallbackId = UniqueI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI32TableHandle<'ctx> { type DeleteCallbackId = UniqueI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI32TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_32`, /// which allows point queries on the field of the same name /// via the [`UniqueI32NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_64_table.rs index 514474aa4b1..d6421a963cb 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_64_table.rs @@ -40,7 +40,7 @@ impl UniqueI64TableAccess for super::RemoteTables { pub struct UniqueI64InsertCallbackId(__sdk::CallbackId); pub struct UniqueI64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI64TableHandle<'ctx> { type Row = UniqueI64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI64TableHandle<'ctx> { type InsertCallbackId = UniqueI64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI64TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI64TableHandle<'ctx> { type DeleteCallbackId = UniqueI64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI64TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_64`, /// which allows point queries on the field of the same name /// via the [`UniqueI64NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_i_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_i_8_table.rs index a4a6bef6d5b..c1d6ea17921 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_i_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_i_8_table.rs @@ -40,7 +40,7 @@ impl UniqueI8TableAccess for super::RemoteTables { pub struct UniqueI8InsertCallbackId(__sdk::CallbackId); pub struct UniqueI8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueI8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueI8TableHandle<'ctx> { type Row = UniqueI8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueI8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueI8TableHandle<'ctx> { type InsertCallbackId = UniqueI8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueI8TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueI8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueI8TableHandle<'ctx> { type DeleteCallbackId = UniqueI8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueI8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueI8TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_i_8`, /// which allows point queries on the field of the same name /// via the [`UniqueI8NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_identity_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_identity_table.rs index 69d3678c2a9..7d323ce0709 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_identity_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_identity_table.rs @@ -40,7 +40,7 @@ impl UniqueIdentityTableAccess for super::RemoteTables { pub struct UniqueIdentityInsertCallbackId(__sdk::CallbackId); pub struct UniqueIdentityDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueIdentityTableHandle<'ctx> { type Row = UniqueIdentity; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueIdentityTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueIdentityTableHandle<'ctx> { type InsertCallbackId = UniqueIdentityInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueIdentityTableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueIdentityInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueIdentityTableHandle<'ctx> { type DeleteCallbackId = UniqueIdentityDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueIdentityTableHandle<'ctx> {} + /// Access to the `i` unique index on the table `unique_identity`, /// which allows point queries on the field of the same name /// via the [`UniqueIdentityIUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_string_table.rs index f5af15d05a6..33e60964a58 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_string_table.rs @@ -40,7 +40,7 @@ impl UniqueStringTableAccess for super::RemoteTables { pub struct UniqueStringInsertCallbackId(__sdk::CallbackId); pub struct UniqueStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueStringTableHandle<'ctx> { type Row = UniqueString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueStringTableHandle<'ctx> { type InsertCallbackId = UniqueStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueStringTableHandle<'ctx> { type DeleteCallbackId = UniqueStringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueStringTableHandle<'ctx> {} + /// Access to the `s` unique index on the table `unique_string`, /// which allows point queries on the field of the same name /// via the [`UniqueStringSUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_128_table.rs index 4780f357b8b..90051f8bd76 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_128_table.rs @@ -40,7 +40,7 @@ impl UniqueU128TableAccess for super::RemoteTables { pub struct UniqueU128InsertCallbackId(__sdk::CallbackId); pub struct UniqueU128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU128TableHandle<'ctx> { type Row = UniqueU128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU128TableHandle<'ctx> { type InsertCallbackId = UniqueU128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU128TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU128TableHandle<'ctx> { type DeleteCallbackId = UniqueU128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU128TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_128`, /// which allows point queries on the field of the same name /// via the [`UniqueU128NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_16_table.rs index f78ed798c9b..c20b3e6ae94 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_16_table.rs @@ -40,7 +40,7 @@ impl UniqueU16TableAccess for super::RemoteTables { pub struct UniqueU16InsertCallbackId(__sdk::CallbackId); pub struct UniqueU16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU16TableHandle<'ctx> { type Row = UniqueU16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU16TableHandle<'ctx> { type InsertCallbackId = UniqueU16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU16TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU16TableHandle<'ctx> { type DeleteCallbackId = UniqueU16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU16TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_16`, /// which allows point queries on the field of the same name /// via the [`UniqueU16NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_256_table.rs index 289808a8c47..feaf215092a 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_256_table.rs @@ -40,7 +40,7 @@ impl UniqueU256TableAccess for super::RemoteTables { pub struct UniqueU256InsertCallbackId(__sdk::CallbackId); pub struct UniqueU256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU256TableHandle<'ctx> { type Row = UniqueU256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU256TableHandle<'ctx> { type InsertCallbackId = UniqueU256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU256TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU256TableHandle<'ctx> { type DeleteCallbackId = UniqueU256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU256TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_256`, /// which allows point queries on the field of the same name /// via the [`UniqueU256NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_32_table.rs index a07fa51d146..45d9a0eb546 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_32_table.rs @@ -40,7 +40,7 @@ impl UniqueU32TableAccess for super::RemoteTables { pub struct UniqueU32InsertCallbackId(__sdk::CallbackId); pub struct UniqueU32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU32TableHandle<'ctx> { type Row = UniqueU32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU32TableHandle<'ctx> { type InsertCallbackId = UniqueU32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU32TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU32TableHandle<'ctx> { type DeleteCallbackId = UniqueU32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU32TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_32`, /// which allows point queries on the field of the same name /// via the [`UniqueU32NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_64_table.rs index 032c1032ae9..06b81f12054 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_64_table.rs @@ -40,7 +40,7 @@ impl UniqueU64TableAccess for super::RemoteTables { pub struct UniqueU64InsertCallbackId(__sdk::CallbackId); pub struct UniqueU64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU64TableHandle<'ctx> { type Row = UniqueU64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU64TableHandle<'ctx> { type InsertCallbackId = UniqueU64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU64TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU64TableHandle<'ctx> { type DeleteCallbackId = UniqueU64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU64TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_64`, /// which allows point queries on the field of the same name /// via the [`UniqueU64NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_u_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_u_8_table.rs index 1bceb392864..75a343f2e95 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_u_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_u_8_table.rs @@ -40,7 +40,7 @@ impl UniqueU8TableAccess for super::RemoteTables { pub struct UniqueU8InsertCallbackId(__sdk::CallbackId); pub struct UniqueU8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueU8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueU8TableHandle<'ctx> { type Row = UniqueU8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueU8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueU8TableHandle<'ctx> { type InsertCallbackId = UniqueU8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueU8TableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueU8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueU8TableHandle<'ctx> { type DeleteCallbackId = UniqueU8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueU8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueU8TableHandle<'ctx> {} + /// Access to the `n` unique index on the table `unique_u_8`, /// which allows point queries on the field of the same name /// via the [`UniqueU8NUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/unique_uuid_table.rs b/sdks/rust/tests/test-client/src/module_bindings/unique_uuid_table.rs index 771136825a1..275ade9317d 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/unique_uuid_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/unique_uuid_table.rs @@ -40,7 +40,7 @@ impl UniqueUuidTableAccess for super::RemoteTables { pub struct UniqueUuidInsertCallbackId(__sdk::CallbackId); pub struct UniqueUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UniqueUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UniqueUuidTableHandle<'ctx> { type Row = UniqueUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UniqueUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UniqueUuidTableHandle<'ctx> { type InsertCallbackId = UniqueUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UniqueUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: UniqueUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UniqueUuidTableHandle<'ctx> { type DeleteCallbackId = UniqueUuidDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for UniqueUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UniqueUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("unique_uuid"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/users_table.rs b/sdks/rust/tests/test-client/src/module_bindings/users_table.rs index bb231ad743a..eeec2345f42 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/users_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/users_table.rs @@ -40,7 +40,7 @@ impl UsersTableAccess for super::RemoteTables { pub struct UsersInsertCallbackId(__sdk::CallbackId); pub struct UsersDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for UsersTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for UsersTableHandle<'ctx> { type Row = Users; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for UsersTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for UsersTableHandle<'ctx> { type InsertCallbackId = UsersInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for UsersTableHandle<'ctx> { fn remove_on_insert(&self, callback: UsersInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for UsersTableHandle<'ctx> { type DeleteCallbackId = UsersDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for UsersTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for UsersTableHandle<'ctx> {} + pub struct UsersUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for UsersTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for UsersTableHandle<'ctx> { type UpdateCallbackId = UsersUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for UsersTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for UsersTableHandle<'ctx> {} + /// Access to the `identity` unique index on the table `users`, /// which allows point queries on the field of the same name /// via the [`UsersIdentityUnique::find`] method. diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_bool_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_bool_table.rs index 8967237ef97..61d57920cb9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_bool_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_bool_table.rs @@ -40,7 +40,7 @@ impl VecBoolTableAccess for super::RemoteTables { pub struct VecBoolInsertCallbackId(__sdk::CallbackId); pub struct VecBoolDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecBoolTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecBoolTableHandle<'ctx> { type Row = VecBool; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecBoolTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecBoolTableHandle<'ctx> { type InsertCallbackId = VecBoolInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecBoolTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecBoolInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecBoolTableHandle<'ctx> { type DeleteCallbackId = VecBoolDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecBoolTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecBoolTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_bool"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_byte_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_byte_struct_table.rs index 90f2062bc76..106c1e8f9d2 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_byte_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_byte_struct_table.rs @@ -41,7 +41,7 @@ impl VecByteStructTableAccess for super::RemoteTables { pub struct VecByteStructInsertCallbackId(__sdk::CallbackId); pub struct VecByteStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecByteStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecByteStructTableHandle<'ctx> { type Row = VecByteStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for VecByteStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecByteStructTableHandle<'ctx> { type InsertCallbackId = VecByteStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for VecByteStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecByteStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecByteStructTableHandle<'ctx> { type DeleteCallbackId = VecByteStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for VecByteStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecByteStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_byte_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_connection_id_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_connection_id_table.rs index b371fff1010..11f6e1e5400 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_connection_id_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_connection_id_table.rs @@ -40,7 +40,7 @@ impl VecConnectionIdTableAccess for super::RemoteTables { pub struct VecConnectionIdInsertCallbackId(__sdk::CallbackId); pub struct VecConnectionIdDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecConnectionIdTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecConnectionIdTableHandle<'ctx> { type Row = VecConnectionId; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecConnectionIdTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecConnectionIdTableHandle<'ctx> { type InsertCallbackId = VecConnectionIdInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecConnectionIdTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecConnectionIdInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecConnectionIdTableHandle<'ctx> { type DeleteCallbackId = VecConnectionIdDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecConnectionIdTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecConnectionIdTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_connection_id"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs index c27f983c73a..3047beed684 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_enum_with_payload_table.rs @@ -41,7 +41,7 @@ impl VecEnumWithPayloadTableAccess for super::RemoteTables { pub struct VecEnumWithPayloadInsertCallbackId(__sdk::CallbackId); pub struct VecEnumWithPayloadDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecEnumWithPayloadTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecEnumWithPayloadTableHandle<'ctx> { type Row = VecEnumWithPayload; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for VecEnumWithPayloadTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecEnumWithPayloadTableHandle<'ctx> { type InsertCallbackId = VecEnumWithPayloadInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for VecEnumWithPayloadTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecEnumWithPayloadInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecEnumWithPayloadTableHandle<'ctx> { type DeleteCallbackId = VecEnumWithPayloadDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for VecEnumWithPayloadTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecEnumWithPayloadTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_enum_with_payload"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs index 8f1e5d0ffcb..4a8fb0634bc 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_every_primitive_struct_table.rs @@ -43,7 +43,7 @@ impl VecEveryPrimitiveStructTableAccess for super::RemoteTables { pub struct VecEveryPrimitiveStructInsertCallbackId(__sdk::CallbackId); pub struct VecEveryPrimitiveStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecEveryPrimitiveStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecEveryPrimitiveStructTableHandle<'ctx> { type Row = VecEveryPrimitiveStruct; type EventContext = super::EventContext; @@ -53,7 +53,9 @@ impl<'ctx> __sdk::Table for VecEveryPrimitiveStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecEveryPrimitiveStructTableHandle<'ctx> { type InsertCallbackId = VecEveryPrimitiveStructInsertCallbackId; fn on_insert( @@ -66,7 +68,9 @@ impl<'ctx> __sdk::Table for VecEveryPrimitiveStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecEveryPrimitiveStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecEveryPrimitiveStructTableHandle<'ctx> { type DeleteCallbackId = VecEveryPrimitiveStructDeleteCallbackId; fn on_delete( @@ -81,6 +85,8 @@ impl<'ctx> __sdk::Table for VecEveryPrimitiveStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecEveryPrimitiveStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_every_primitive_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs index b368706c5d6..3ea52132bbd 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_every_vec_struct_table.rs @@ -41,7 +41,7 @@ impl VecEveryVecStructTableAccess for super::RemoteTables { pub struct VecEveryVecStructInsertCallbackId(__sdk::CallbackId); pub struct VecEveryVecStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecEveryVecStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecEveryVecStructTableHandle<'ctx> { type Row = VecEveryVecStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for VecEveryVecStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecEveryVecStructTableHandle<'ctx> { type InsertCallbackId = VecEveryVecStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for VecEveryVecStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecEveryVecStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecEveryVecStructTableHandle<'ctx> { type DeleteCallbackId = VecEveryVecStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for VecEveryVecStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecEveryVecStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_every_vec_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_f_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_f_32_table.rs index 470119b3a7f..05dde35a6c4 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_f_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_f_32_table.rs @@ -40,7 +40,7 @@ impl VecF32TableAccess for super::RemoteTables { pub struct VecF32InsertCallbackId(__sdk::CallbackId); pub struct VecF32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecF32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecF32TableHandle<'ctx> { type Row = VecF32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecF32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecF32TableHandle<'ctx> { type InsertCallbackId = VecF32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecF32TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecF32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecF32TableHandle<'ctx> { type DeleteCallbackId = VecF32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecF32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecF32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_f_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_f_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_f_64_table.rs index f1d6ff21724..f85e0ecc592 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_f_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_f_64_table.rs @@ -40,7 +40,7 @@ impl VecF64TableAccess for super::RemoteTables { pub struct VecF64InsertCallbackId(__sdk::CallbackId); pub struct VecF64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecF64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecF64TableHandle<'ctx> { type Row = VecF64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecF64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecF64TableHandle<'ctx> { type InsertCallbackId = VecF64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecF64TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecF64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecF64TableHandle<'ctx> { type DeleteCallbackId = VecF64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecF64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecF64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_f_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_128_table.rs index 110c759278b..2ad8b1aec49 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_128_table.rs @@ -40,7 +40,7 @@ impl VecI128TableAccess for super::RemoteTables { pub struct VecI128InsertCallbackId(__sdk::CallbackId); pub struct VecI128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI128TableHandle<'ctx> { type Row = VecI128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI128TableHandle<'ctx> { type InsertCallbackId = VecI128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI128TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI128TableHandle<'ctx> { type DeleteCallbackId = VecI128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI128TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_128"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_16_table.rs index 76104d0df08..7a5fbd1f601 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_16_table.rs @@ -40,7 +40,7 @@ impl VecI16TableAccess for super::RemoteTables { pub struct VecI16InsertCallbackId(__sdk::CallbackId); pub struct VecI16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI16TableHandle<'ctx> { type Row = VecI16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI16TableHandle<'ctx> { type InsertCallbackId = VecI16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI16TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI16TableHandle<'ctx> { type DeleteCallbackId = VecI16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI16TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_16"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_256_table.rs index 93b66ec77e7..0f608cb53e7 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_256_table.rs @@ -40,7 +40,7 @@ impl VecI256TableAccess for super::RemoteTables { pub struct VecI256InsertCallbackId(__sdk::CallbackId); pub struct VecI256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI256TableHandle<'ctx> { type Row = VecI256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI256TableHandle<'ctx> { type InsertCallbackId = VecI256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI256TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI256TableHandle<'ctx> { type DeleteCallbackId = VecI256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI256TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_256"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_32_table.rs index 7adc5dedcb6..b8b27f54924 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_32_table.rs @@ -40,7 +40,7 @@ impl VecI32TableAccess for super::RemoteTables { pub struct VecI32InsertCallbackId(__sdk::CallbackId); pub struct VecI32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI32TableHandle<'ctx> { type Row = VecI32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI32TableHandle<'ctx> { type InsertCallbackId = VecI32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI32TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI32TableHandle<'ctx> { type DeleteCallbackId = VecI32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_64_table.rs index c1c3d9fe6d4..e1b3308d580 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_64_table.rs @@ -40,7 +40,7 @@ impl VecI64TableAccess for super::RemoteTables { pub struct VecI64InsertCallbackId(__sdk::CallbackId); pub struct VecI64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI64TableHandle<'ctx> { type Row = VecI64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI64TableHandle<'ctx> { type InsertCallbackId = VecI64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI64TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI64TableHandle<'ctx> { type DeleteCallbackId = VecI64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_i_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_i_8_table.rs index 4485c46b9bf..254f17bde52 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_i_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_i_8_table.rs @@ -40,7 +40,7 @@ impl VecI8TableAccess for super::RemoteTables { pub struct VecI8InsertCallbackId(__sdk::CallbackId); pub struct VecI8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecI8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecI8TableHandle<'ctx> { type Row = VecI8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecI8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecI8TableHandle<'ctx> { type InsertCallbackId = VecI8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecI8TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecI8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecI8TableHandle<'ctx> { type DeleteCallbackId = VecI8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecI8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecI8TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_i_8"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_identity_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_identity_table.rs index 45723d9cf5a..b24f93ea2bd 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_identity_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_identity_table.rs @@ -40,7 +40,7 @@ impl VecIdentityTableAccess for super::RemoteTables { pub struct VecIdentityInsertCallbackId(__sdk::CallbackId); pub struct VecIdentityDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecIdentityTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecIdentityTableHandle<'ctx> { type Row = VecIdentity; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecIdentityTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecIdentityTableHandle<'ctx> { type InsertCallbackId = VecIdentityInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecIdentityTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecIdentityInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecIdentityTableHandle<'ctx> { type DeleteCallbackId = VecIdentityDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecIdentityTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_identity"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_simple_enum_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_simple_enum_table.rs index e047b02490d..a2411211240 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_simple_enum_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_simple_enum_table.rs @@ -41,7 +41,7 @@ impl VecSimpleEnumTableAccess for super::RemoteTables { pub struct VecSimpleEnumInsertCallbackId(__sdk::CallbackId); pub struct VecSimpleEnumDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecSimpleEnumTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecSimpleEnumTableHandle<'ctx> { type Row = VecSimpleEnum; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for VecSimpleEnumTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecSimpleEnumTableHandle<'ctx> { type InsertCallbackId = VecSimpleEnumInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for VecSimpleEnumTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecSimpleEnumInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecSimpleEnumTableHandle<'ctx> { type DeleteCallbackId = VecSimpleEnumDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for VecSimpleEnumTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecSimpleEnumTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_simple_enum"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_string_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_string_table.rs index b18da99a950..05998304ad9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_string_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_string_table.rs @@ -40,7 +40,7 @@ impl VecStringTableAccess for super::RemoteTables { pub struct VecStringInsertCallbackId(__sdk::CallbackId); pub struct VecStringDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecStringTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecStringTableHandle<'ctx> { type Row = VecString; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecStringTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecStringTableHandle<'ctx> { type InsertCallbackId = VecStringInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecStringTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecStringInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecStringTableHandle<'ctx> { type DeleteCallbackId = VecStringDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecStringTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecStringTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_string"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_timestamp_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_timestamp_table.rs index ec532416149..2800cf69d37 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_timestamp_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_timestamp_table.rs @@ -40,7 +40,7 @@ impl VecTimestampTableAccess for super::RemoteTables { pub struct VecTimestampInsertCallbackId(__sdk::CallbackId); pub struct VecTimestampDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecTimestampTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecTimestampTableHandle<'ctx> { type Row = VecTimestamp; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecTimestampTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecTimestampTableHandle<'ctx> { type InsertCallbackId = VecTimestampInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecTimestampTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecTimestampInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecTimestampTableHandle<'ctx> { type DeleteCallbackId = VecTimestampDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecTimestampTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecTimestampTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_timestamp"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_128_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_128_table.rs index 8f96d7434eb..9bbab107771 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_128_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_128_table.rs @@ -40,7 +40,7 @@ impl VecU128TableAccess for super::RemoteTables { pub struct VecU128InsertCallbackId(__sdk::CallbackId); pub struct VecU128DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU128TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU128TableHandle<'ctx> { type Row = VecU128; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU128TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU128TableHandle<'ctx> { type InsertCallbackId = VecU128InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU128TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU128InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU128TableHandle<'ctx> { type DeleteCallbackId = VecU128DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU128TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU128TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_128"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_16_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_16_table.rs index 2cf50b8b026..ece4253b9d9 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_16_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_16_table.rs @@ -40,7 +40,7 @@ impl VecU16TableAccess for super::RemoteTables { pub struct VecU16InsertCallbackId(__sdk::CallbackId); pub struct VecU16DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU16TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU16TableHandle<'ctx> { type Row = VecU16; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU16TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU16TableHandle<'ctx> { type InsertCallbackId = VecU16InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU16TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU16InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU16TableHandle<'ctx> { type DeleteCallbackId = VecU16DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU16TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU16TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_16"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_256_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_256_table.rs index 2f3c13a0450..2930e29cb91 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_256_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_256_table.rs @@ -40,7 +40,7 @@ impl VecU256TableAccess for super::RemoteTables { pub struct VecU256InsertCallbackId(__sdk::CallbackId); pub struct VecU256DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU256TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU256TableHandle<'ctx> { type Row = VecU256; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU256TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU256TableHandle<'ctx> { type InsertCallbackId = VecU256InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU256TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU256InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU256TableHandle<'ctx> { type DeleteCallbackId = VecU256DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU256TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU256TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_256"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_32_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_32_table.rs index 04fc2d0925c..ce29219971e 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_32_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_32_table.rs @@ -40,7 +40,7 @@ impl VecU32TableAccess for super::RemoteTables { pub struct VecU32InsertCallbackId(__sdk::CallbackId); pub struct VecU32DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU32TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU32TableHandle<'ctx> { type Row = VecU32; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU32TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU32TableHandle<'ctx> { type InsertCallbackId = VecU32InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU32TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU32InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU32TableHandle<'ctx> { type DeleteCallbackId = VecU32DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU32TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU32TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_32"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_64_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_64_table.rs index cfc64e363d5..4d89e4c9838 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_64_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_64_table.rs @@ -40,7 +40,7 @@ impl VecU64TableAccess for super::RemoteTables { pub struct VecU64InsertCallbackId(__sdk::CallbackId); pub struct VecU64DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU64TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU64TableHandle<'ctx> { type Row = VecU64; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU64TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU64TableHandle<'ctx> { type InsertCallbackId = VecU64InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU64TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU64InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU64TableHandle<'ctx> { type DeleteCallbackId = VecU64DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU64TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU64TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_64"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_u_8_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_u_8_table.rs index 140444f92ed..85b26082d82 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_u_8_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_u_8_table.rs @@ -40,7 +40,7 @@ impl VecU8TableAccess for super::RemoteTables { pub struct VecU8InsertCallbackId(__sdk::CallbackId); pub struct VecU8DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecU8TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecU8TableHandle<'ctx> { type Row = VecU8; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecU8TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecU8TableHandle<'ctx> { type InsertCallbackId = VecU8InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecU8TableHandle<'ctx> { fn remove_on_insert(&self, callback: VecU8InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecU8TableHandle<'ctx> { type DeleteCallbackId = VecU8DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecU8TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecU8TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_u_8"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_unit_struct_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_unit_struct_table.rs index f3b6eb600a8..36cd0f61824 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_unit_struct_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_unit_struct_table.rs @@ -41,7 +41,7 @@ impl VecUnitStructTableAccess for super::RemoteTables { pub struct VecUnitStructInsertCallbackId(__sdk::CallbackId); pub struct VecUnitStructDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecUnitStructTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecUnitStructTableHandle<'ctx> { type Row = VecUnitStruct; type EventContext = super::EventContext; @@ -51,7 +51,9 @@ impl<'ctx> __sdk::Table for VecUnitStructTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecUnitStructTableHandle<'ctx> { type InsertCallbackId = VecUnitStructInsertCallbackId; fn on_insert( @@ -64,7 +66,9 @@ impl<'ctx> __sdk::Table for VecUnitStructTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecUnitStructInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecUnitStructTableHandle<'ctx> { type DeleteCallbackId = VecUnitStructDeleteCallbackId; fn on_delete( @@ -79,6 +83,8 @@ impl<'ctx> __sdk::Table for VecUnitStructTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecUnitStructTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_unit_struct"); diff --git a/sdks/rust/tests/test-client/src/module_bindings/vec_uuid_table.rs b/sdks/rust/tests/test-client/src/module_bindings/vec_uuid_table.rs index 39054226c88..6aad146c8b4 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/vec_uuid_table.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/vec_uuid_table.rs @@ -40,7 +40,7 @@ impl VecUuidTableAccess for super::RemoteTables { pub struct VecUuidInsertCallbackId(__sdk::CallbackId); pub struct VecUuidDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for VecUuidTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for VecUuidTableHandle<'ctx> { type Row = VecUuid; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for VecUuidTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for VecUuidTableHandle<'ctx> { type InsertCallbackId = VecUuidInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for VecUuidTableHandle<'ctx> { fn remove_on_insert(&self, callback: VecUuidInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for VecUuidTableHandle<'ctx> { type DeleteCallbackId = VecUuidDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for VecUuidTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for VecUuidTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("vec_uuid"); diff --git a/sdks/rust/tests/test-client/src/pk_test_table.rs b/sdks/rust/tests/test-client/src/pk_test_table.rs index 45ee220cc2f..3af6fc8d9c2 100644 --- a/sdks/rust/tests/test-client/src/pk_test_table.rs +++ b/sdks/rust/tests/test-client/src/pk_test_table.rs @@ -1,5 +1,5 @@ use crate::module_bindings::*; -use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Table, TableWithPrimaryKey, Uuid}; +use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Uuid, WithDelete, WithInsert, WithUpdate}; use std::sync::Arc; use test_counter::TestCounter; diff --git a/sdks/rust/tests/test-client/src/simple_test_table.rs b/sdks/rust/tests/test-client/src/simple_test_table.rs index 52d6a350194..5fc33d28fa3 100644 --- a/sdks/rust/tests/test-client/src/simple_test_table.rs +++ b/sdks/rust/tests/test-client/src/simple_test_table.rs @@ -1,5 +1,5 @@ use crate::module_bindings::*; -use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Table, Timestamp, Uuid}; +use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Timestamp, Uuid, WithInsert}; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, diff --git a/sdks/rust/tests/test-client/src/test_handlers.rs b/sdks/rust/tests/test-client/src/test_handlers.rs index d83ee46cf4d..c18a80f337e 100644 --- a/sdks/rust/tests/test-client/src/test_handlers.rs +++ b/sdks/rust/tests/test-client/src/test_handlers.rs @@ -8,11 +8,11 @@ use rand::RngCore; #[cfg(not(target_arch = "wasm32"))] use spacetimedb_sdk::credentials; use spacetimedb_sdk::error::InternalError; -use spacetimedb_sdk::TableWithPrimaryKey; use spacetimedb_sdk::{ i256, u256, Compression, ConnectionId, DbConnectionBuilder, DbContext, Event, Identity, ReducerEvent, Status, SubscriptionHandle, Table, TimeDuration, Timestamp, Uuid, }; +use spacetimedb_sdk::{TableLike, WithDelete, WithInsert, WithUpdate}; use test_counter::TestCounter; use crate::simple_test_table::{insert_one, on_insert_one, SimpleTestTable}; diff --git a/sdks/rust/tests/test-client/src/unique_test_table.rs b/sdks/rust/tests/test-client/src/unique_test_table.rs index 672565f752e..ad83ccccf5d 100644 --- a/sdks/rust/tests/test-client/src/unique_test_table.rs +++ b/sdks/rust/tests/test-client/src/unique_test_table.rs @@ -1,5 +1,5 @@ use crate::module_bindings::*; -use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Table, Uuid}; +use spacetimedb_sdk::{i256, u256, ConnectionId, Event, Identity, Uuid, WithDelete, WithInsert}; use std::sync::Arc; use test_counter::TestCounter; diff --git a/sdks/rust/tests/view-client/src/module_bindings/mod.rs b/sdks/rust/tests/view-client/src/module_bindings/mod.rs index 9a292ee9a48..903c78773ba 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.0.5 (commit ca7484e072f9514fb2f890f26600a5d096f59431). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -15,7 +15,6 @@ pub mod nearby_players_table; pub mod player_and_level_type; pub mod player_level_table; pub mod player_level_type; -pub mod player_location_table; pub mod player_location_type; pub mod player_table; pub mod player_type; @@ -30,7 +29,6 @@ pub use nearby_players_table::*; pub use player_and_level_type::PlayerAndLevel; pub use player_level_table::*; pub use player_level_type::PlayerLevel; -pub use player_location_table::*; pub use player_location_type::PlayerLocation; pub use player_table::*; pub use player_type::Player; @@ -92,7 +90,6 @@ pub struct DbUpdate { nearby_players: __sdk::TableUpdate, player: __sdk::TableUpdate, player_level: __sdk::TableUpdate, - player_location: __sdk::TableUpdate, players_at_level_0: __sdk::TableUpdate, } @@ -115,9 +112,6 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { "player_level" => db_update .player_level .append(player_level_table::parse_table_update(table_update)?), - "player_location" => db_update - .player_location - .append(player_location_table::parse_table_update(table_update)?), "players_at_level_0" => db_update .players_at_level_0 .append(players_at_level_0_table::parse_table_update(table_update)?), @@ -143,7 +137,6 @@ impl __sdk::DbUpdate for DbUpdate { .apply_diff_to_table::("player", &self.player) .with_updates_by_pk(|row| &row.entity_id); diff.player_level = cache.apply_diff_to_table::("player_level", &self.player_level); - diff.player_location = cache.apply_diff_to_table::("player_location", &self.player_location); diff.my_player = cache.apply_diff_to_table::("my_player", &self.my_player); diff.my_player_and_level = cache.apply_diff_to_table::("my_player_and_level", &self.my_player_and_level); @@ -171,9 +164,6 @@ impl __sdk::DbUpdate for DbUpdate { "player_level" => db_update .player_level .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "player_location" => db_update - .player_location - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "players_at_level_0" => db_update .players_at_level_0 .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), @@ -203,9 +193,6 @@ impl __sdk::DbUpdate for DbUpdate { "player_level" => db_update .player_level .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "player_location" => db_update - .player_location - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "players_at_level_0" => db_update .players_at_level_0 .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), @@ -227,7 +214,6 @@ pub struct AppliedDiff<'r> { nearby_players: __sdk::TableAppliedDiff<'r, PlayerLocation>, player: __sdk::TableAppliedDiff<'r, Player>, player_level: __sdk::TableAppliedDiff<'r, PlayerLevel>, - player_location: __sdk::TableAppliedDiff<'r, PlayerLocation>, players_at_level_0: __sdk::TableAppliedDiff<'r, Player>, __unused: std::marker::PhantomData<&'r ()>, } @@ -243,7 +229,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { callbacks.invoke_table_row_callbacks::("nearby_players", &self.nearby_players, event); callbacks.invoke_table_row_callbacks::("player", &self.player, event); callbacks.invoke_table_row_callbacks::("player_level", &self.player_level, event); - callbacks.invoke_table_row_callbacks::("player_location", &self.player_location, event); callbacks.invoke_table_row_callbacks::("players_at_level_0", &self.players_at_level_0, event); } } @@ -514,7 +499,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, @@ -907,7 +892,6 @@ impl __sdk::SpacetimeModule for RemoteModule { nearby_players_table::register_table(client_cache); player_table::register_table(client_cache); player_level_table::register_table(client_cache); - player_location_table::register_table(client_cache); players_at_level_0_table::register_table(client_cache); } const ALL_TABLE_NAMES: &'static [&'static str] = &[ @@ -916,7 +900,6 @@ impl __sdk::SpacetimeModule for RemoteModule { "nearby_players", "player", "player_level", - "player_location", "players_at_level_0", ]; } diff --git a/sdks/rust/tests/view-client/src/module_bindings/my_player_and_level_table.rs b/sdks/rust/tests/view-client/src/module_bindings/my_player_and_level_table.rs index ac0ac773bdc..65cd6ff9f24 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/my_player_and_level_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/my_player_and_level_table.rs @@ -40,7 +40,7 @@ impl MyPlayerAndLevelTableAccess for super::RemoteTables { pub struct MyPlayerAndLevelInsertCallbackId(__sdk::CallbackId); pub struct MyPlayerAndLevelDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for MyPlayerAndLevelTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for MyPlayerAndLevelTableHandle<'ctx> { type Row = PlayerAndLevel; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for MyPlayerAndLevelTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for MyPlayerAndLevelTableHandle<'ctx> { type InsertCallbackId = MyPlayerAndLevelInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for MyPlayerAndLevelTableHandle<'ctx> { fn remove_on_insert(&self, callback: MyPlayerAndLevelInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for MyPlayerAndLevelTableHandle<'ctx> { type DeleteCallbackId = MyPlayerAndLevelDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for MyPlayerAndLevelTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for MyPlayerAndLevelTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("my_player_and_level"); diff --git a/sdks/rust/tests/view-client/src/module_bindings/my_player_table.rs b/sdks/rust/tests/view-client/src/module_bindings/my_player_table.rs index ddb0d624e15..464c70748fa 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/my_player_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/my_player_table.rs @@ -40,7 +40,7 @@ impl MyPlayerTableAccess for super::RemoteTables { pub struct MyPlayerInsertCallbackId(__sdk::CallbackId); pub struct MyPlayerDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for MyPlayerTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for MyPlayerTableHandle<'ctx> { type Row = Player; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for MyPlayerTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for MyPlayerTableHandle<'ctx> { type InsertCallbackId = MyPlayerInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for MyPlayerTableHandle<'ctx> { fn remove_on_insert(&self, callback: MyPlayerInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for MyPlayerTableHandle<'ctx> { type DeleteCallbackId = MyPlayerDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for MyPlayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for MyPlayerTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("my_player"); diff --git a/sdks/rust/tests/view-client/src/module_bindings/nearby_players_table.rs b/sdks/rust/tests/view-client/src/module_bindings/nearby_players_table.rs index 9ecc2f275fe..fa2322fefcc 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/nearby_players_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/nearby_players_table.rs @@ -40,7 +40,7 @@ impl NearbyPlayersTableAccess for super::RemoteTables { pub struct NearbyPlayersInsertCallbackId(__sdk::CallbackId); pub struct NearbyPlayersDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for NearbyPlayersTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for NearbyPlayersTableHandle<'ctx> { type Row = PlayerLocation; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for NearbyPlayersTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for NearbyPlayersTableHandle<'ctx> { type InsertCallbackId = NearbyPlayersInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for NearbyPlayersTableHandle<'ctx> { fn remove_on_insert(&self, callback: NearbyPlayersInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for NearbyPlayersTableHandle<'ctx> { type DeleteCallbackId = NearbyPlayersDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for NearbyPlayersTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for NearbyPlayersTableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("nearby_players"); diff --git a/sdks/rust/tests/view-client/src/module_bindings/player_level_table.rs b/sdks/rust/tests/view-client/src/module_bindings/player_level_table.rs index 2f092d15467..a825ff7d183 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/player_level_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/player_level_table.rs @@ -40,7 +40,7 @@ impl PlayerLevelTableAccess for super::RemoteTables { pub struct PlayerLevelInsertCallbackId(__sdk::CallbackId); pub struct PlayerLevelDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PlayerLevelTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PlayerLevelTableHandle<'ctx> { type Row = PlayerLevel; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PlayerLevelTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PlayerLevelTableHandle<'ctx> { type InsertCallbackId = PlayerLevelInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PlayerLevelTableHandle<'ctx> { fn remove_on_insert(&self, callback: PlayerLevelInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PlayerLevelTableHandle<'ctx> { type DeleteCallbackId = PlayerLevelDeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for PlayerLevelTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PlayerLevelTableHandle<'ctx> {} + /// Access to the `entity_id` unique index on the table `player_level`, /// which allows point queries on the field of the same name /// via the [`PlayerLevelEntityIdUnique::find`] method. diff --git a/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs b/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs deleted file mode 100644 index 6114b8bc3b5..00000000000 --- a/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs +++ /dev/null @@ -1,142 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::player_location_type::PlayerLocation; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `player_location`. -/// -/// Obtain a handle from the [`PlayerLocationTableAccess::player_location`] method on [`super::RemoteTables`], -/// like `ctx.db.player_location()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.player_location().on_insert(...)`. -pub struct PlayerLocationTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `player_location`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait PlayerLocationTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`PlayerLocationTableHandle`], which mediates access to the table `player_location`. - fn player_location(&self) -> PlayerLocationTableHandle<'_>; -} - -impl PlayerLocationTableAccess for super::RemoteTables { - fn player_location(&self) -> PlayerLocationTableHandle<'_> { - PlayerLocationTableHandle { - imp: self.imp.get_table::("player_location"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct PlayerLocationInsertCallbackId(__sdk::CallbackId); -pub struct PlayerLocationDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for PlayerLocationTableHandle<'ctx> { - type Row = PlayerLocation; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = PlayerLocationInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PlayerLocationInsertCallbackId { - PlayerLocationInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: PlayerLocationInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = PlayerLocationDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PlayerLocationDeleteCallbackId { - PlayerLocationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: PlayerLocationDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -/// Access to the `entity_id` unique index on the table `player_location`, -/// which allows point queries on the field of the same name -/// via the [`PlayerLocationEntityIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.player_location().entity_id().find(...)`. -pub struct PlayerLocationEntityIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> PlayerLocationTableHandle<'ctx> { - /// Get a handle on the `entity_id` unique index on the table `player_location`. - pub fn entity_id(&self) -> PlayerLocationEntityIdUnique<'ctx> { - PlayerLocationEntityIdUnique { - imp: self.imp.get_unique_constraint::("entity_id"), - phantom: std::marker::PhantomData, - } - } -} - -impl<'ctx> PlayerLocationEntityIdUnique<'ctx> { - /// Find the subscribed row whose `entity_id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("player_location"); - _table.add_unique_constraint::("entity_id", |row| &row.entity_id); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::v2::TableUpdate, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `PlayerLocation`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait player_locationQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PlayerLocation`. - fn player_location(&self) -> __sdk::__query_builder::Table; -} - -impl player_locationQueryTableAccess for __sdk::QueryTableAccessor { - fn player_location(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("player_location") - } -} diff --git a/sdks/rust/tests/view-client/src/module_bindings/player_table.rs b/sdks/rust/tests/view-client/src/module_bindings/player_table.rs index 1214943ef52..db5aecfbaf3 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/player_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/player_table.rs @@ -40,7 +40,7 @@ impl PlayerTableAccess for super::RemoteTables { pub struct PlayerInsertCallbackId(__sdk::CallbackId); pub struct PlayerDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PlayerTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PlayerTableHandle<'ctx> { type Row = Player; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PlayerTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PlayerTableHandle<'ctx> { type InsertCallbackId = PlayerInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PlayerTableHandle<'ctx> { fn remove_on_insert(&self, callback: PlayerInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PlayerTableHandle<'ctx> { type DeleteCallbackId = PlayerDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for PlayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PlayerTableHandle<'ctx> {} + pub struct PlayerUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for PlayerTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for PlayerTableHandle<'ctx> { type UpdateCallbackId = PlayerUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PlayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for PlayerTableHandle<'ctx> {} + /// Access to the `entity_id` unique index on the table `player`, /// which allows point queries on the field of the same name /// via the [`PlayerEntityIdUnique::find`] method. diff --git a/sdks/rust/tests/view-client/src/module_bindings/players_at_level_0_table.rs b/sdks/rust/tests/view-client/src/module_bindings/players_at_level_0_table.rs index 57c3ae723eb..827c95bc771 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/players_at_level_0_table.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/players_at_level_0_table.rs @@ -40,7 +40,7 @@ impl PlayersAtLevel0TableAccess for super::RemoteTables { pub struct PlayersAtLevel0InsertCallbackId(__sdk::CallbackId); pub struct PlayersAtLevel0DeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for PlayersAtLevel0TableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for PlayersAtLevel0TableHandle<'ctx> { type Row = Player; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for PlayersAtLevel0TableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for PlayersAtLevel0TableHandle<'ctx> { type InsertCallbackId = PlayersAtLevel0InsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for PlayersAtLevel0TableHandle<'ctx> { fn remove_on_insert(&self, callback: PlayersAtLevel0InsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for PlayersAtLevel0TableHandle<'ctx> { type DeleteCallbackId = PlayersAtLevel0DeleteCallbackId; fn on_delete( @@ -78,6 +82,8 @@ impl<'ctx> __sdk::Table for PlayersAtLevel0TableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for PlayersAtLevel0TableHandle<'ctx> {} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("players_at_level_0"); diff --git a/sdks/rust/tests/view-client/src/test_handlers.rs b/sdks/rust/tests/view-client/src/test_handlers.rs index 21b9dc43ae7..4b3216be848 100644 --- a/sdks/rust/tests/view-client/src/test_handlers.rs +++ b/sdks/rust/tests/view-client/src/test_handlers.rs @@ -1,6 +1,6 @@ use crate::module_bindings::*; use spacetimedb_lib::Identity; -use spacetimedb_sdk::{error::InternalError, DbConnectionBuilder, DbContext, Table}; +use spacetimedb_sdk::{error::InternalError, DbConnectionBuilder, DbContext, WithDelete, WithInsert}; use test_counter::TestCounter; const LOCALHOST: &str = "http://localhost:3000"; diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/all_view_pk_players_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/all_view_pk_players_table.rs index 4a64417bb6a..57f18185427 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/all_view_pk_players_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/all_view_pk_players_table.rs @@ -40,7 +40,7 @@ impl AllViewPkPlayersTableAccess for super::RemoteTables { pub struct AllViewPkPlayersInsertCallbackId(__sdk::CallbackId); pub struct AllViewPkPlayersDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for AllViewPkPlayersTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for AllViewPkPlayersTableHandle<'ctx> { type Row = ViewPkPlayer; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for AllViewPkPlayersTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for AllViewPkPlayersTableHandle<'ctx> { type InsertCallbackId = AllViewPkPlayersInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for AllViewPkPlayersTableHandle<'ctx> { fn remove_on_insert(&self, callback: AllViewPkPlayersInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for AllViewPkPlayersTableHandle<'ctx> { type DeleteCallbackId = AllViewPkPlayersDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for AllViewPkPlayersTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for AllViewPkPlayersTableHandle<'ctx> {} + pub struct AllViewPkPlayersUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for AllViewPkPlayersTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for AllViewPkPlayersTableHandle<'ctx> { type UpdateCallbackId = AllViewPkPlayersUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AllViewPkPlayersTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for AllViewPkPlayersTableHandle<'ctx> {} + /// Access to the `id` unique index on the table `all_view_pk_players`, /// which allows point queries on the field of the same name /// via the [`AllViewPkPlayersIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/mod.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/mod.rs index 04ee8aedb08..0e2c4c7ec89 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.0.5 (commit ca7484e072f9514fb2f890f26600a5d096f59431). +// This was generated using spacetimedb cli version 2.1.0 (commit aa84d00c80f19e20a89d7cb52b3470e59e844168). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -538,7 +538,7 @@ impl< } /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], -/// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. +/// passed to [`__sdk::WithInsert::on_insert`], [`__sdk::WithDelete::on_delete`] and [`__sdk::WithUpdate::on_update`] callbacks. pub struct EventContext { /// Access to tables defined by the module via extension traits implemented for [`RemoteTables`]. pub db: RemoteTables, diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_a_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_a_table.rs index a052c0291d2..08c3ff3d0e2 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_a_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_a_table.rs @@ -40,7 +40,7 @@ impl SenderViewPkPlayersATableAccess for super::RemoteTables { pub struct SenderViewPkPlayersAInsertCallbackId(__sdk::CallbackId); pub struct SenderViewPkPlayersADeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for SenderViewPkPlayersATableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for SenderViewPkPlayersATableHandle<'ctx> { type Row = ViewPkPlayer; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersATableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for SenderViewPkPlayersATableHandle<'ctx> { type InsertCallbackId = SenderViewPkPlayersAInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersATableHandle<'ctx> { fn remove_on_insert(&self, callback: SenderViewPkPlayersAInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for SenderViewPkPlayersATableHandle<'ctx> { type DeleteCallbackId = SenderViewPkPlayersADeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersATableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for SenderViewPkPlayersATableHandle<'ctx> {} + pub struct SenderViewPkPlayersAUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersATableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for SenderViewPkPlayersATableHandle<'ctx> { type UpdateCallbackId = SenderViewPkPlayersAUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersATableHandle<'ctx> } } +impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersATableHandle<'ctx> {} + /// Access to the `id` unique index on the table `sender_view_pk_players_a`, /// which allows point queries on the field of the same name /// via the [`SenderViewPkPlayersAIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_b_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_b_table.rs index cdb82a39446..e720806654d 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_b_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/sender_view_pk_players_b_table.rs @@ -40,7 +40,7 @@ impl SenderViewPkPlayersBTableAccess for super::RemoteTables { pub struct SenderViewPkPlayersBInsertCallbackId(__sdk::CallbackId); pub struct SenderViewPkPlayersBDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for SenderViewPkPlayersBTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for SenderViewPkPlayersBTableHandle<'ctx> { type Row = ViewPkPlayer; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersBTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for SenderViewPkPlayersBTableHandle<'ctx> { type InsertCallbackId = SenderViewPkPlayersBInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersBTableHandle<'ctx> { fn remove_on_insert(&self, callback: SenderViewPkPlayersBInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for SenderViewPkPlayersBTableHandle<'ctx> { type DeleteCallbackId = SenderViewPkPlayersBDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for SenderViewPkPlayersBTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for SenderViewPkPlayersBTableHandle<'ctx> {} + pub struct SenderViewPkPlayersBUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersBTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for SenderViewPkPlayersBTableHandle<'ctx> { type UpdateCallbackId = SenderViewPkPlayersBUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersBTableHandle<'ctx> } } +impl<'ctx> __sdk::TableWithPrimaryKey for SenderViewPkPlayersBTableHandle<'ctx> {} + /// Access to the `id` unique index on the table `sender_view_pk_players_b`, /// which allows point queries on the field of the same name /// via the [`SenderViewPkPlayersBIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_secondary_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_secondary_table.rs index f7f49d58b73..2121000de5a 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_secondary_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_secondary_table.rs @@ -42,7 +42,7 @@ impl ViewPkMembershipSecondaryTableAccess for super::RemoteTables { pub struct ViewPkMembershipSecondaryInsertCallbackId(__sdk::CallbackId); pub struct ViewPkMembershipSecondaryDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ViewPkMembershipSecondaryTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ViewPkMembershipSecondaryTableHandle<'ctx> { type Row = ViewPkMembershipSecondary; type EventContext = super::EventContext; @@ -52,7 +52,9 @@ impl<'ctx> __sdk::Table for ViewPkMembershipSecondaryTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ViewPkMembershipSecondaryTableHandle<'ctx> { type InsertCallbackId = ViewPkMembershipSecondaryInsertCallbackId; fn on_insert( @@ -65,7 +67,9 @@ impl<'ctx> __sdk::Table for ViewPkMembershipSecondaryTableHandle<'ctx> { fn remove_on_insert(&self, callback: ViewPkMembershipSecondaryInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ViewPkMembershipSecondaryTableHandle<'ctx> { type DeleteCallbackId = ViewPkMembershipSecondaryDeleteCallbackId; fn on_delete( @@ -80,9 +84,11 @@ impl<'ctx> __sdk::Table for ViewPkMembershipSecondaryTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ViewPkMembershipSecondaryTableHandle<'ctx> {} + pub struct ViewPkMembershipSecondaryUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipSecondaryTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for ViewPkMembershipSecondaryTableHandle<'ctx> { type UpdateCallbackId = ViewPkMembershipSecondaryUpdateCallbackId; fn on_update( @@ -97,6 +103,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipSecondaryTableHandle<' } } +impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipSecondaryTableHandle<'ctx> {} + /// Access to the `id` unique index on the table `view_pk_membership_secondary`, /// which allows point queries on the field of the same name /// via the [`ViewPkMembershipSecondaryIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_table.rs index bc491cad1bf..e2b9dd58ccc 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_membership_table.rs @@ -40,7 +40,7 @@ impl ViewPkMembershipTableAccess for super::RemoteTables { pub struct ViewPkMembershipInsertCallbackId(__sdk::CallbackId); pub struct ViewPkMembershipDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ViewPkMembershipTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ViewPkMembershipTableHandle<'ctx> { type Row = ViewPkMembership; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ViewPkMembershipTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ViewPkMembershipTableHandle<'ctx> { type InsertCallbackId = ViewPkMembershipInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ViewPkMembershipTableHandle<'ctx> { fn remove_on_insert(&self, callback: ViewPkMembershipInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ViewPkMembershipTableHandle<'ctx> { type DeleteCallbackId = ViewPkMembershipDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for ViewPkMembershipTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ViewPkMembershipTableHandle<'ctx> {} + pub struct ViewPkMembershipUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for ViewPkMembershipTableHandle<'ctx> { type UpdateCallbackId = ViewPkMembershipUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkMembershipTableHandle<'ctx> {} + /// Access to the `id` unique index on the table `view_pk_membership`, /// which allows point queries on the field of the same name /// via the [`ViewPkMembershipIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_player_table.rs b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_player_table.rs index 6a5db875df9..06ace456731 100644 --- a/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_player_table.rs +++ b/sdks/rust/tests/view-pk-client/src/module_bindings/view_pk_player_table.rs @@ -40,7 +40,7 @@ impl ViewPkPlayerTableAccess for super::RemoteTables { pub struct ViewPkPlayerInsertCallbackId(__sdk::CallbackId); pub struct ViewPkPlayerDeleteCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::Table for ViewPkPlayerTableHandle<'ctx> { +impl<'ctx> __sdk::TableLike for ViewPkPlayerTableHandle<'ctx> { type Row = ViewPkPlayer; type EventContext = super::EventContext; @@ -50,7 +50,9 @@ impl<'ctx> __sdk::Table for ViewPkPlayerTableHandle<'ctx> { fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } +} +impl<'ctx> __sdk::WithInsert for ViewPkPlayerTableHandle<'ctx> { type InsertCallbackId = ViewPkPlayerInsertCallbackId; fn on_insert( @@ -63,7 +65,9 @@ impl<'ctx> __sdk::Table for ViewPkPlayerTableHandle<'ctx> { fn remove_on_insert(&self, callback: ViewPkPlayerInsertCallbackId) { self.imp.remove_on_insert(callback.0) } +} +impl<'ctx> __sdk::WithDelete for ViewPkPlayerTableHandle<'ctx> { type DeleteCallbackId = ViewPkPlayerDeleteCallbackId; fn on_delete( @@ -78,9 +82,11 @@ impl<'ctx> __sdk::Table for ViewPkPlayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::Table for ViewPkPlayerTableHandle<'ctx> {} + pub struct ViewPkPlayerUpdateCallbackId(__sdk::CallbackId); -impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkPlayerTableHandle<'ctx> { +impl<'ctx> __sdk::WithUpdate for ViewPkPlayerTableHandle<'ctx> { type UpdateCallbackId = ViewPkPlayerUpdateCallbackId; fn on_update( @@ -95,6 +101,8 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkPlayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::TableWithPrimaryKey for ViewPkPlayerTableHandle<'ctx> {} + /// Access to the `id` unique index on the table `view_pk_player`, /// which allows point queries on the field of the same name /// via the [`ViewPkPlayerIdUnique::find`] method. diff --git a/sdks/rust/tests/view-pk-client/src/test_handlers.rs b/sdks/rust/tests/view-pk-client/src/test_handlers.rs index 4a7de205d38..acde33e53e3 100644 --- a/sdks/rust/tests/view-pk-client/src/test_handlers.rs +++ b/sdks/rust/tests/view-pk-client/src/test_handlers.rs @@ -1,5 +1,5 @@ use crate::module_bindings::*; -use spacetimedb_sdk::TableWithPrimaryKey; +use spacetimedb_sdk::WithUpdate; use spacetimedb_sdk::{error::InternalError, DbConnectionBuilder, DbContext}; use test_counter::TestCounter;