diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..a10c0188dba --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +**/module_bindings/** linguist-generated=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fac5ba635a..fd392f92572 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: sudo chmod 777 /stdb - name: Run cargo test - run: cargo test --all --exclude test-client --exclude connect_disconnect_client --features odb_rocksdb,odb_sled + run: cargo test --all --features odb_rocksdb,odb_sled lints: name: Lints @@ -52,7 +52,7 @@ jobs: run: cargo fmt --all -- --check - name: Run cargo clippy - run: cargo clippy --all --exclude test-client --exclude connect_disconnect_client --tests --features odb_rocksdb,odb_sled -- -D warnings + run: cargo clippy --all --tests --features odb_rocksdb,odb_sled -- -D warnings wasm_bindings: name: Build and test wasm bindings diff --git a/crates/cli/src/subcommands/generate/rust.rs b/crates/cli/src/subcommands/generate/rust.rs index 179ad5b64d0..bc9ebf26c15 100644 --- a/crates/cli/src/subcommands/generate/rust.rs +++ b/crates/cli/src/subcommands/generate/rust.rs @@ -990,7 +990,7 @@ fn print_handle_resubscribe_defn(out: &mut Indenter, items: &[GenItem]) { /// to `ReducerCallbacks::handle_event_of_type` with an appropriate type argument. fn print_handle_event_defn(out: &mut Indenter, items: &[GenItem]) { out.delimited_block( - "fn handle_event(&self, event: Event, reducer_callbacks: &mut ReducerCallbacks, state: Arc) -> Option> {", + "fn handle_event(&self, event: Event, _reducer_callbacks: &mut ReducerCallbacks, _state: Arc) -> Option> {", |out| { out.delimited_block( "let Some(function_call) = &event.function_call else {", @@ -998,13 +998,21 @@ fn print_handle_event_defn(out: &mut Indenter, items: &[GenItem]) { .unwrap(), "};\n", ); + + // If the module defines no reducers, + // we'll generate a single match arm, the fallthrough. + // Clippy doesn't like this, as it could be a `let` binding, + // but we're not going to add logic to handle that case, + // so just quiet the lint. + writeln!(out, "#[allow(clippy::match_single_binding)]").unwrap(); + out.delimited_block( "match &function_call.reducer[..] {", |out| { for reducer in iter_reducer_items(items) { writeln!( out, - "{:?} => reducer_callbacks.handle_event_of_type::<{}::{}, ReducerEvent>(event, state, ReducerEvent::{}),", + "{:?} => _reducer_callbacks.handle_event_of_type::<{}::{}, ReducerEvent>(event, _state, ReducerEvent::{}),", reducer.name, reducer_module_name(reducer), reducer_type_name(reducer), diff --git a/crates/sdk/tests/connect_disconnect_client/src/.gitignore b/crates/sdk/tests/connect_disconnect_client/src/.gitignore deleted file mode 100644 index 85e3b6afebc..00000000000 --- a/crates/sdk/tests/connect_disconnect_client/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -module_bindings diff --git a/crates/sdk/tests/connect_disconnect_client/src/main.rs b/crates/sdk/tests/connect_disconnect_client/src/main.rs index 196f7b0b20a..1119f0720b6 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/main.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/main.rs @@ -1,4 +1,3 @@ -#[rustfmt::skip] mod module_bindings; use module_bindings::*; diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected.rs new file mode 100644 index 00000000000..adff1bd2139 --- /dev/null +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/connected.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct Connected { + pub identity: Identity, +} + +impl TableType for Connected { + const TABLE_NAME: &'static str = "Connected"; + type ReducerEvent = super::ReducerEvent; +} + +impl Connected { + #[allow(unused)] + pub fn filter_by_identity(identity: Identity) -> TableIter { + Self::filter(|row| row.identity == identity) + } +} diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected.rs new file mode 100644 index 00000000000..6abe6834b1b --- /dev/null +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/disconnected.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct Disconnected { + pub identity: Identity, +} + +impl TableType for Disconnected { + const TABLE_NAME: &'static str = "Disconnected"; + type ReducerEvent = super::ReducerEvent; +} + +impl Disconnected { + #[allow(unused)] + pub fn filter_by_identity(identity: Identity) -> TableIter { + Self::filter(|row| row.identity == identity) + } +} diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs new file mode 100644 index 00000000000..c68e1847b4a --- /dev/null +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs @@ -0,0 +1,112 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use spacetimedb_sdk::callbacks::{DbCallbacks, ReducerCallbacks}; +use spacetimedb_sdk::client_api_messages::{Event, TableUpdate}; +use spacetimedb_sdk::client_cache::{ClientCache, RowCallbackReminders}; +use spacetimedb_sdk::global_connection::with_connection_mut; +use spacetimedb_sdk::identity::Credentials; +use spacetimedb_sdk::reducer::AnyReducerEvent; +use spacetimedb_sdk::spacetime_module::SpacetimeModule; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; +use std::sync::Arc; + +pub mod connected; +pub mod disconnected; + +pub use connected::*; +pub use disconnected::*; + +#[allow(unused)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub enum ReducerEvent {} + +#[allow(unused)] +pub struct Module; +impl SpacetimeModule for Module { + fn handle_table_update( + &self, + table_update: TableUpdate, + client_cache: &mut ClientCache, + callbacks: &mut RowCallbackReminders, + ) { + let table_name = &table_update.table_name[..]; + match table_name { + "Connected" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "Disconnected" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + _ => spacetimedb_sdk::log::error!("TableRowOperation on unknown table {:?}", table_name), + } + } + fn invoke_row_callbacks( + &self, + reminders: &mut RowCallbackReminders, + worker: &mut DbCallbacks, + reducer_event: Option>, + state: &Arc, + ) { + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + } + fn handle_event( + &self, + event: Event, + _reducer_callbacks: &mut ReducerCallbacks, + _state: Arc, + ) -> Option> { + let Some(function_call) = &event.function_call else { + spacetimedb_sdk::log::warn!("Received Event with None function_call"); + return None; + }; + #[allow(clippy::match_single_binding)] + match &function_call.reducer[..] { + unknown => { + spacetimedb_sdk::log::error!("Event on an unknown reducer: {:?}", unknown); + None + } + } + } + fn handle_resubscribe( + &self, + new_subs: TableUpdate, + client_cache: &mut ClientCache, + callbacks: &mut RowCallbackReminders, + ) { + let table_name = &new_subs.table_name[..]; + match table_name { + "Connected" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "Disconnected" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + _ => spacetimedb_sdk::log::error!("TableRowOperation on unknown table {:?}", table_name), + } + } +} + +/// Connect to a database named `db_name` accessible over the internet at the URI `spacetimedb_uri`. +/// +/// If `credentials` are supplied, they will be passed to the new connection to +/// identify and authenticate the user. Otherwise, a set of `Credentials` will be +/// generated by the server. +pub fn connect(spacetimedb_uri: IntoUri, db_name: &str, credentials: Option) -> Result<()> +where + IntoUri: TryInto, + >::Error: std::error::Error + Send + Sync + 'static, +{ + with_connection_mut(|connection| { + connection.connect(spacetimedb_uri, db_name, credentials, Arc::new(Module))?; + Ok(()) + }) +} diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/useless_empty_reducer_reducer.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/useless_empty_reducer_reducer.rs new file mode 100644 index 00000000000..1d054878e04 --- /dev/null +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/useless_empty_reducer_reducer.rs @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UselessEmptyReducerArgs {} + +impl Reducer for UselessEmptyReducerArgs { + const REDUCER_NAME: &'static str = "useless_empty_reducer"; +} + +#[allow(unused)] +pub fn useless_empty_reducer() { + UselessEmptyReducerArgs {}.invoke(); +} + +#[allow(unused)] +pub fn on_useless_empty_reducer( + mut __callback: impl FnMut(&Identity, &Status) + Send + 'static, +) -> ReducerCallbackId { + UselessEmptyReducerArgs::on_reducer(move |__identity, __status, __args| { + let UselessEmptyReducerArgs {} = __args; + __callback(__identity, __status); + }) +} + +#[allow(unused)] +pub fn once_on_useless_empty_reducer( + __callback: impl FnOnce(&Identity, &Status) + Send + 'static, +) -> ReducerCallbackId { + UselessEmptyReducerArgs::once_on_reducer(move |__identity, __status, __args| { + let UselessEmptyReducerArgs {} = __args; + __callback(__identity, __status); + }) +} + +#[allow(unused)] +pub fn remove_on_useless_empty_reducer(id: ReducerCallbackId) { + UselessEmptyReducerArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/.gitignore b/crates/sdk/tests/test-client/src/.gitignore deleted file mode 100644 index 85e3b6afebc..00000000000 --- a/crates/sdk/tests/test-client/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -module_bindings diff --git a/crates/sdk/tests/test-client/src/main.rs b/crates/sdk/tests/test-client/src/main.rs index 443487a45d1..f38a589bcfe 100644 --- a/crates/sdk/tests/test-client/src/main.rs +++ b/crates/sdk/tests/test-client/src/main.rs @@ -9,7 +9,6 @@ use spacetimedb_sdk::{ #[allow(clippy::too_many_arguments)] #[allow(clippy::large_enum_variant)] -#[rustfmt::skip] mod module_bindings; use module_bindings::*; diff --git a/crates/sdk/tests/test-client/src/module_bindings/byte_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/byte_struct.rs new file mode 100644 index 00000000000..0ed48c46711 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/byte_struct.rs @@ -0,0 +1,18 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct ByteStruct { + pub b: u8, +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_address_reducer.rs new file mode 100644 index 00000000000..c26f0096a57 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkAddressArgs { + pub a: Address, +} + +impl Reducer for DeletePkAddressArgs { + const REDUCER_NAME: &'static str = "delete_pk_address"; +} + +#[allow(unused)] +pub fn delete_pk_address(a: Address) { + DeletePkAddressArgs { a }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + DeletePkAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + DeletePkAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_address(id: ReducerCallbackId) { + DeletePkAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_bool_reducer.rs new file mode 100644 index 00000000000..814e747f0d1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_bool_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkBoolArgs { + pub b: bool, +} + +impl Reducer for DeletePkBoolArgs { + const REDUCER_NAME: &'static str = "delete_pk_bool"; +} + +#[allow(unused)] +pub fn delete_pk_bool(b: bool) { + DeletePkBoolArgs { b }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + DeletePkBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + DeletePkBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_bool(id: ReducerCallbackId) { + DeletePkBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_128_reducer.rs new file mode 100644 index 00000000000..55327bb45aa --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkI128Args { + pub n: i128, +} + +impl Reducer for DeletePkI128Args { + const REDUCER_NAME: &'static str = "delete_pk_i128"; +} + +#[allow(unused)] +pub fn delete_pk_i_128(n: i128) { + DeletePkI128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_i_128(id: ReducerCallbackId) { + DeletePkI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_16_reducer.rs new file mode 100644 index 00000000000..a0ce0700fc9 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkI16Args { + pub n: i16, +} + +impl Reducer for DeletePkI16Args { + const REDUCER_NAME: &'static str = "delete_pk_i16"; +} + +#[allow(unused)] +pub fn delete_pk_i_16(n: i16) { + DeletePkI16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_i_16(id: ReducerCallbackId) { + DeletePkI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_32_reducer.rs new file mode 100644 index 00000000000..c8023edac43 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkI32Args { + pub n: i32, +} + +impl Reducer for DeletePkI32Args { + const REDUCER_NAME: &'static str = "delete_pk_i32"; +} + +#[allow(unused)] +pub fn delete_pk_i_32(n: i32) { + DeletePkI32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_i_32(id: ReducerCallbackId) { + DeletePkI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_64_reducer.rs new file mode 100644 index 00000000000..6955d62c750 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkI64Args { + pub n: i64, +} + +impl Reducer for DeletePkI64Args { + const REDUCER_NAME: &'static str = "delete_pk_i64"; +} + +#[allow(unused)] +pub fn delete_pk_i_64(n: i64) { + DeletePkI64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_i_64(id: ReducerCallbackId) { + DeletePkI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_8_reducer.rs new file mode 100644 index 00000000000..1f815b13f8a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkI8Args { + pub n: i8, +} + +impl Reducer for DeletePkI8Args { + const REDUCER_NAME: &'static str = "delete_pk_i8"; +} + +#[allow(unused)] +pub fn delete_pk_i_8(n: i8) { + DeletePkI8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + DeletePkI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_i_8(id: ReducerCallbackId) { + DeletePkI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_identity_reducer.rs new file mode 100644 index 00000000000..2113c387802 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkIdentityArgs { + pub i: Identity, +} + +impl Reducer for DeletePkIdentityArgs { + const REDUCER_NAME: &'static str = "delete_pk_identity"; +} + +#[allow(unused)] +pub fn delete_pk_identity(i: Identity) { + DeletePkIdentityArgs { i }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + DeletePkIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + DeletePkIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_identity(id: ReducerCallbackId) { + DeletePkIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_string_reducer.rs new file mode 100644 index 00000000000..fe7687e357e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_string_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkStringArgs { + pub s: String, +} + +impl Reducer for DeletePkStringArgs { + const REDUCER_NAME: &'static str = "delete_pk_string"; +} + +#[allow(unused)] +pub fn delete_pk_string(s: String) { + DeletePkStringArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + DeletePkStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + DeletePkStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_string(id: ReducerCallbackId) { + DeletePkStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_128_reducer.rs new file mode 100644 index 00000000000..d00197b6af1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkU128Args { + pub n: u128, +} + +impl Reducer for DeletePkU128Args { + const REDUCER_NAME: &'static str = "delete_pk_u128"; +} + +#[allow(unused)] +pub fn delete_pk_u_128(n: u128) { + DeletePkU128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_u_128(id: ReducerCallbackId) { + DeletePkU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_16_reducer.rs new file mode 100644 index 00000000000..7b24f83ecf2 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkU16Args { + pub n: u16, +} + +impl Reducer for DeletePkU16Args { + const REDUCER_NAME: &'static str = "delete_pk_u16"; +} + +#[allow(unused)] +pub fn delete_pk_u_16(n: u16) { + DeletePkU16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_u_16(id: ReducerCallbackId) { + DeletePkU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_32_reducer.rs new file mode 100644 index 00000000000..ac54f0dbf6d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkU32Args { + pub n: u32, +} + +impl Reducer for DeletePkU32Args { + const REDUCER_NAME: &'static str = "delete_pk_u32"; +} + +#[allow(unused)] +pub fn delete_pk_u_32(n: u32) { + DeletePkU32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_u_32(id: ReducerCallbackId) { + DeletePkU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_64_reducer.rs new file mode 100644 index 00000000000..915153251ac --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkU64Args { + pub n: u64, +} + +impl Reducer for DeletePkU64Args { + const REDUCER_NAME: &'static str = "delete_pk_u64"; +} + +#[allow(unused)] +pub fn delete_pk_u_64(n: u64) { + DeletePkU64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_u_64(id: ReducerCallbackId) { + DeletePkU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_8_reducer.rs new file mode 100644 index 00000000000..e3bcd592cef --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeletePkU8Args { + pub n: u8, +} + +impl Reducer for DeletePkU8Args { + const REDUCER_NAME: &'static str = "delete_pk_u8"; +} + +#[allow(unused)] +pub fn delete_pk_u_8(n: u8) { + DeletePkU8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_pk_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_pk_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + DeletePkU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeletePkU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_pk_u_8(id: ReducerCallbackId) { + DeletePkU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_address_reducer.rs new file mode 100644 index 00000000000..86ea01e6118 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueAddressArgs { + pub a: Address, +} + +impl Reducer for DeleteUniqueAddressArgs { + const REDUCER_NAME: &'static str = "delete_unique_address"; +} + +#[allow(unused)] +pub fn delete_unique_address(a: Address) { + DeleteUniqueAddressArgs { a }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_address(id: ReducerCallbackId) { + DeleteUniqueAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_bool_reducer.rs new file mode 100644 index 00000000000..e30cf442005 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_bool_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueBoolArgs { + pub b: bool, +} + +impl Reducer for DeleteUniqueBoolArgs { + const REDUCER_NAME: &'static str = "delete_unique_bool"; +} + +#[allow(unused)] +pub fn delete_unique_bool(b: bool) { + DeleteUniqueBoolArgs { b }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_bool(id: ReducerCallbackId) { + DeleteUniqueBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_128_reducer.rs new file mode 100644 index 00000000000..f807cb13a48 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueI128Args { + pub n: i128, +} + +impl Reducer for DeleteUniqueI128Args { + const REDUCER_NAME: &'static str = "delete_unique_i128"; +} + +#[allow(unused)] +pub fn delete_unique_i_128(n: i128) { + DeleteUniqueI128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_i_128(id: ReducerCallbackId) { + DeleteUniqueI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_16_reducer.rs new file mode 100644 index 00000000000..b210c6e4e66 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueI16Args { + pub n: i16, +} + +impl Reducer for DeleteUniqueI16Args { + const REDUCER_NAME: &'static str = "delete_unique_i16"; +} + +#[allow(unused)] +pub fn delete_unique_i_16(n: i16) { + DeleteUniqueI16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_i_16(id: ReducerCallbackId) { + DeleteUniqueI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_32_reducer.rs new file mode 100644 index 00000000000..077c27d1c84 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueI32Args { + pub n: i32, +} + +impl Reducer for DeleteUniqueI32Args { + const REDUCER_NAME: &'static str = "delete_unique_i32"; +} + +#[allow(unused)] +pub fn delete_unique_i_32(n: i32) { + DeleteUniqueI32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_i_32(id: ReducerCallbackId) { + DeleteUniqueI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_64_reducer.rs new file mode 100644 index 00000000000..6be70e4c76d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueI64Args { + pub n: i64, +} + +impl Reducer for DeleteUniqueI64Args { + const REDUCER_NAME: &'static str = "delete_unique_i64"; +} + +#[allow(unused)] +pub fn delete_unique_i_64(n: i64) { + DeleteUniqueI64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_i_64(id: ReducerCallbackId) { + DeleteUniqueI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_8_reducer.rs new file mode 100644 index 00000000000..6d8c32813f4 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueI8Args { + pub n: i8, +} + +impl Reducer for DeleteUniqueI8Args { + const REDUCER_NAME: &'static str = "delete_unique_i8"; +} + +#[allow(unused)] +pub fn delete_unique_i_8(n: i8) { + DeleteUniqueI8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_i_8(id: ReducerCallbackId) { + DeleteUniqueI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_identity_reducer.rs new file mode 100644 index 00000000000..de9e89268ee --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueIdentityArgs { + pub i: Identity, +} + +impl Reducer for DeleteUniqueIdentityArgs { + const REDUCER_NAME: &'static str = "delete_unique_identity"; +} + +#[allow(unused)] +pub fn delete_unique_identity(i: Identity) { + DeleteUniqueIdentityArgs { i }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_identity(id: ReducerCallbackId) { + DeleteUniqueIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_string_reducer.rs new file mode 100644 index 00000000000..e40a6553027 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_string_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueStringArgs { + pub s: String, +} + +impl Reducer for DeleteUniqueStringArgs { + const REDUCER_NAME: &'static str = "delete_unique_string"; +} + +#[allow(unused)] +pub fn delete_unique_string(s: String) { + DeleteUniqueStringArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_string(id: ReducerCallbackId) { + DeleteUniqueStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_128_reducer.rs new file mode 100644 index 00000000000..15e33b66fd5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueU128Args { + pub n: u128, +} + +impl Reducer for DeleteUniqueU128Args { + const REDUCER_NAME: &'static str = "delete_unique_u128"; +} + +#[allow(unused)] +pub fn delete_unique_u_128(n: u128) { + DeleteUniqueU128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_u_128(id: ReducerCallbackId) { + DeleteUniqueU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_16_reducer.rs new file mode 100644 index 00000000000..0294a0339fe --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueU16Args { + pub n: u16, +} + +impl Reducer for DeleteUniqueU16Args { + const REDUCER_NAME: &'static str = "delete_unique_u16"; +} + +#[allow(unused)] +pub fn delete_unique_u_16(n: u16) { + DeleteUniqueU16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_u_16(id: ReducerCallbackId) { + DeleteUniqueU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_32_reducer.rs new file mode 100644 index 00000000000..f95403ce5b1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueU32Args { + pub n: u32, +} + +impl Reducer for DeleteUniqueU32Args { + const REDUCER_NAME: &'static str = "delete_unique_u32"; +} + +#[allow(unused)] +pub fn delete_unique_u_32(n: u32) { + DeleteUniqueU32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_u_32(id: ReducerCallbackId) { + DeleteUniqueU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_64_reducer.rs new file mode 100644 index 00000000000..7065c9ed647 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueU64Args { + pub n: u64, +} + +impl Reducer for DeleteUniqueU64Args { + const REDUCER_NAME: &'static str = "delete_unique_u64"; +} + +#[allow(unused)] +pub fn delete_unique_u_64(n: u64) { + DeleteUniqueU64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_u_64(id: ReducerCallbackId) { + DeleteUniqueU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_8_reducer.rs new file mode 100644 index 00000000000..c4efc91746f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct DeleteUniqueU8Args { + pub n: u8, +} + +impl Reducer for DeleteUniqueU8Args { + const REDUCER_NAME: &'static str = "delete_unique_u8"; +} + +#[allow(unused)] +pub fn delete_unique_u_8(n: u8) { + DeleteUniqueU8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_delete_unique_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_delete_unique_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + DeleteUniqueU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let DeleteUniqueU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_delete_unique_u_8(id: ReducerCallbackId) { + DeleteUniqueU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/enum_with_payload.rs b/crates/sdk/tests/test-client/src/module_bindings/enum_with_payload.rs new file mode 100644 index 00000000000..7059a384386 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/enum_with_payload.rs @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::simple_enum::SimpleEnum; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub enum EnumWithPayload { + U8(u8), + U16(u16), + U32(u32), + U64(u64), + U128(u128), + I8(i8), + I16(i16), + I32(i32), + I64(i64), + I128(i128), + Bool(bool), + F32(f32), + F64(f64), + Str(String), + Identity(Identity), + Address(Address), + Bytes(Vec), + Ints(Vec), + Strings(Vec), + SimpleEnums(Vec), +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/every_primitive_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/every_primitive_struct.rs new file mode 100644 index 00000000000..662c0932422 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/every_primitive_struct.rs @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct EveryPrimitiveStruct { + pub a: u8, + pub b: u16, + pub c: u32, + pub d: u64, + pub e: u128, + pub f: i8, + pub g: i16, + pub h: i32, + pub i: i64, + pub j: i128, + pub k: bool, + pub l: f32, + pub m: f64, + pub n: String, + pub o: Identity, + pub p: Address, +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/every_vec_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/every_vec_struct.rs new file mode 100644 index 00000000000..39c9eec94e1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/every_vec_struct.rs @@ -0,0 +1,33 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct EveryVecStruct { + pub a: Vec, + pub b: Vec, + pub c: Vec, + pub d: Vec, + pub e: Vec, + pub f: Vec, + pub g: Vec, + pub h: Vec, + pub i: Vec, + pub j: Vec, + pub k: Vec, + pub l: Vec, + pub m: Vec, + pub n: Vec, + pub o: Vec, + pub p: Vec
, +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_address_reducer.rs new file mode 100644 index 00000000000..824e4ce1c76 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_address_reducer.rs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerOneAddressArgs {} + +impl Reducer for InsertCallerOneAddressArgs { + const REDUCER_NAME: &'static str = "insert_caller_one_address"; +} + +#[allow(unused)] +pub fn insert_caller_one_address() { + InsertCallerOneAddressArgs {}.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_one_address( + mut __callback: impl FnMut(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerOneAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerOneAddressArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_one_address( + __callback: impl FnOnce(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerOneAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerOneAddressArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_one_address(id: ReducerCallbackId) { + InsertCallerOneAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_identity_reducer.rs new file mode 100644 index 00000000000..e8036693460 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_one_identity_reducer.rs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerOneIdentityArgs {} + +impl Reducer for InsertCallerOneIdentityArgs { + const REDUCER_NAME: &'static str = "insert_caller_one_identity"; +} + +#[allow(unused)] +pub fn insert_caller_one_identity() { + InsertCallerOneIdentityArgs {}.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_one_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerOneIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerOneIdentityArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_one_identity( + __callback: impl FnOnce(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerOneIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerOneIdentityArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_one_identity(id: ReducerCallbackId) { + InsertCallerOneIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_address_reducer.rs new file mode 100644 index 00000000000..da6887e62ad --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerPkAddressArgs { + pub data: i32, +} + +impl Reducer for InsertCallerPkAddressArgs { + const REDUCER_NAME: &'static str = "insert_caller_pk_address"; +} + +#[allow(unused)] +pub fn insert_caller_pk_address(data: i32) { + InsertCallerPkAddressArgs { data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_pk_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerPkAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerPkAddressArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_pk_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerPkAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerPkAddressArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_pk_address(id: ReducerCallbackId) { + InsertCallerPkAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_identity_reducer.rs new file mode 100644 index 00000000000..d8cd9f3eb8c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_pk_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerPkIdentityArgs { + pub data: i32, +} + +impl Reducer for InsertCallerPkIdentityArgs { + const REDUCER_NAME: &'static str = "insert_caller_pk_identity"; +} + +#[allow(unused)] +pub fn insert_caller_pk_identity(data: i32) { + InsertCallerPkIdentityArgs { data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_pk_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerPkIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerPkIdentityArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_pk_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerPkIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerPkIdentityArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_pk_identity(id: ReducerCallbackId) { + InsertCallerPkIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_address_reducer.rs new file mode 100644 index 00000000000..49809fd8f43 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerUniqueAddressArgs { + pub data: i32, +} + +impl Reducer for InsertCallerUniqueAddressArgs { + const REDUCER_NAME: &'static str = "insert_caller_unique_address"; +} + +#[allow(unused)] +pub fn insert_caller_unique_address(data: i32) { + InsertCallerUniqueAddressArgs { data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_unique_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerUniqueAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerUniqueAddressArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_unique_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerUniqueAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerUniqueAddressArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_unique_address(id: ReducerCallbackId) { + InsertCallerUniqueAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_identity_reducer.rs new file mode 100644 index 00000000000..e6b4d8c4a28 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_unique_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerUniqueIdentityArgs { + pub data: i32, +} + +impl Reducer for InsertCallerUniqueIdentityArgs { + const REDUCER_NAME: &'static str = "insert_caller_unique_identity"; +} + +#[allow(unused)] +pub fn insert_caller_unique_identity(data: i32) { + InsertCallerUniqueIdentityArgs { data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_unique_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerUniqueIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerUniqueIdentityArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_unique_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerUniqueIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerUniqueIdentityArgs { data } = __args; + __callback(__identity, __addr, __status, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_unique_identity(id: ReducerCallbackId) { + InsertCallerUniqueIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_address_reducer.rs new file mode 100644 index 00000000000..09ac6edc5d8 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_address_reducer.rs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerVecAddressArgs {} + +impl Reducer for InsertCallerVecAddressArgs { + const REDUCER_NAME: &'static str = "insert_caller_vec_address"; +} + +#[allow(unused)] +pub fn insert_caller_vec_address() { + InsertCallerVecAddressArgs {}.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_vec_address( + mut __callback: impl FnMut(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerVecAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerVecAddressArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_vec_address( + __callback: impl FnOnce(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerVecAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerVecAddressArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_vec_address(id: ReducerCallbackId) { + InsertCallerVecAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_identity_reducer.rs new file mode 100644 index 00000000000..3c97cfe5145 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_caller_vec_identity_reducer.rs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertCallerVecIdentityArgs {} + +impl Reducer for InsertCallerVecIdentityArgs { + const REDUCER_NAME: &'static str = "insert_caller_vec_identity"; +} + +#[allow(unused)] +pub fn insert_caller_vec_identity() { + InsertCallerVecIdentityArgs {}.invoke(); +} + +#[allow(unused)] +pub fn on_insert_caller_vec_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerVecIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerVecIdentityArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn once_on_insert_caller_vec_identity( + __callback: impl FnOnce(&Identity, Option
, &Status) + Send + 'static, +) -> ReducerCallbackId { + InsertCallerVecIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertCallerVecIdentityArgs {} = __args; + __callback(__identity, __addr, __status); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_caller_vec_identity(id: ReducerCallbackId) { + InsertCallerVecIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_large_table_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_large_table_reducer.rs new file mode 100644 index 00000000000..05be734d0cb --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_large_table_reducer.rs @@ -0,0 +1,216 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +use super::enum_with_payload::EnumWithPayload; +use super::every_primitive_struct::EveryPrimitiveStruct; +use super::every_vec_struct::EveryVecStruct; +use super::simple_enum::SimpleEnum; +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertLargeTableArgs { + pub a: u8, + pub b: u16, + pub c: u32, + pub d: u64, + pub e: u128, + pub f: i8, + pub g: i16, + pub h: i32, + pub i: i64, + pub j: i128, + pub k: bool, + pub l: f32, + pub m: f64, + pub n: String, + pub o: SimpleEnum, + pub p: EnumWithPayload, + pub q: UnitStruct, + pub r: ByteStruct, + pub s: EveryPrimitiveStruct, + pub t: EveryVecStruct, +} + +impl Reducer for InsertLargeTableArgs { + const REDUCER_NAME: &'static str = "insert_large_table"; +} + +#[allow(unused)] +pub fn insert_large_table( + a: u8, + b: u16, + c: u32, + d: u64, + e: u128, + f: i8, + g: i16, + h: i32, + i: i64, + j: i128, + k: bool, + l: f32, + m: f64, + n: String, + o: SimpleEnum, + p: EnumWithPayload, + q: UnitStruct, + r: ByteStruct, + s: EveryPrimitiveStruct, + t: EveryVecStruct, +) { + InsertLargeTableArgs { + a, + b, + c, + d, + e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q, + r, + s, + t, + } + .invoke(); +} + +#[allow(unused)] +pub fn on_insert_large_table( + mut __callback: impl FnMut( + &Identity, + Option
, + &Status, + &u8, + &u16, + &u32, + &u64, + &u128, + &i8, + &i16, + &i32, + &i64, + &i128, + &bool, + &f32, + &f64, + &String, + &SimpleEnum, + &EnumWithPayload, + &UnitStruct, + &ByteStruct, + &EveryPrimitiveStruct, + &EveryVecStruct, + ) + Send + + 'static, +) -> ReducerCallbackId { + InsertLargeTableArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertLargeTableArgs { + a, + b, + c, + d, + e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q, + r, + s, + t, + } = __args; + __callback( + __identity, __addr, __status, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, + ); + }) +} + +#[allow(unused)] +pub fn once_on_insert_large_table( + __callback: impl FnOnce( + &Identity, + Option
, + &Status, + &u8, + &u16, + &u32, + &u64, + &u128, + &i8, + &i16, + &i32, + &i64, + &i128, + &bool, + &f32, + &f64, + &String, + &SimpleEnum, + &EnumWithPayload, + &UnitStruct, + &ByteStruct, + &EveryPrimitiveStruct, + &EveryVecStruct, + ) + Send + + 'static, +) -> ReducerCallbackId { + InsertLargeTableArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertLargeTableArgs { + a, + b, + c, + d, + e, + f, + g, + h, + i, + j, + k, + l, + m, + n, + o, + p, + q, + r, + s, + t, + } = __args; + __callback( + __identity, __addr, __status, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, + ); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_large_table(id: ReducerCallbackId) { + InsertLargeTableArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_address_reducer.rs new file mode 100644 index 00000000000..eb42259f39e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneAddressArgs { + pub a: Address, +} + +impl Reducer for InsertOneAddressArgs { + const REDUCER_NAME: &'static str = "insert_one_address"; +} + +#[allow(unused)] +pub fn insert_one_address(a: Address) { + InsertOneAddressArgs { a }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + InsertOneAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address) + Send + 'static, +) -> ReducerCallbackId { + InsertOneAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_address(id: ReducerCallbackId) { + InsertOneAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_bool_reducer.rs new file mode 100644 index 00000000000..8f0ab55ea6c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_bool_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneBoolArgs { + pub b: bool, +} + +impl Reducer for InsertOneBoolArgs { + const REDUCER_NAME: &'static str = "insert_one_bool"; +} + +#[allow(unused)] +pub fn insert_one_bool(b: bool) { + InsertOneBoolArgs { b }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + InsertOneBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool) + Send + 'static, +) -> ReducerCallbackId { + InsertOneBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_bool(id: ReducerCallbackId) { + InsertOneBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_byte_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_byte_struct_reducer.rs new file mode 100644 index 00000000000..f5a64bd46ce --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_byte_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneByteStructArgs { + pub s: ByteStruct, +} + +impl Reducer for InsertOneByteStructArgs { + const REDUCER_NAME: &'static str = "insert_one_byte_struct"; +} + +#[allow(unused)] +pub fn insert_one_byte_struct(s: ByteStruct) { + InsertOneByteStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_byte_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &ByteStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneByteStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneByteStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_byte_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &ByteStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneByteStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneByteStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_byte_struct(id: ReducerCallbackId) { + InsertOneByteStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_enum_with_payload_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_enum_with_payload_reducer.rs new file mode 100644 index 00000000000..74396bb8e53 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_enum_with_payload_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::enum_with_payload::EnumWithPayload; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneEnumWithPayloadArgs { + pub e: EnumWithPayload, +} + +impl Reducer for InsertOneEnumWithPayloadArgs { + const REDUCER_NAME: &'static str = "insert_one_enum_with_payload"; +} + +#[allow(unused)] +pub fn insert_one_enum_with_payload(e: EnumWithPayload) { + InsertOneEnumWithPayloadArgs { e }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_enum_with_payload( + mut __callback: impl FnMut(&Identity, Option
, &Status, &EnumWithPayload) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEnumWithPayloadArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEnumWithPayloadArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_enum_with_payload( + __callback: impl FnOnce(&Identity, Option
, &Status, &EnumWithPayload) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEnumWithPayloadArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEnumWithPayloadArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_enum_with_payload(id: ReducerCallbackId) { + InsertOneEnumWithPayloadArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_primitive_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_primitive_struct_reducer.rs new file mode 100644 index 00000000000..248cff1dcf1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_primitive_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_primitive_struct::EveryPrimitiveStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneEveryPrimitiveStructArgs { + pub s: EveryPrimitiveStruct, +} + +impl Reducer for InsertOneEveryPrimitiveStructArgs { + const REDUCER_NAME: &'static str = "insert_one_every_primitive_struct"; +} + +#[allow(unused)] +pub fn insert_one_every_primitive_struct(s: EveryPrimitiveStruct) { + InsertOneEveryPrimitiveStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_every_primitive_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &EveryPrimitiveStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEveryPrimitiveStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEveryPrimitiveStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_every_primitive_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &EveryPrimitiveStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEveryPrimitiveStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEveryPrimitiveStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_every_primitive_struct(id: ReducerCallbackId) { + InsertOneEveryPrimitiveStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_vec_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_vec_struct_reducer.rs new file mode 100644 index 00000000000..7f08754c0e8 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_every_vec_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_vec_struct::EveryVecStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneEveryVecStructArgs { + pub s: EveryVecStruct, +} + +impl Reducer for InsertOneEveryVecStructArgs { + const REDUCER_NAME: &'static str = "insert_one_every_vec_struct"; +} + +#[allow(unused)] +pub fn insert_one_every_vec_struct(s: EveryVecStruct) { + InsertOneEveryVecStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_every_vec_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &EveryVecStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEveryVecStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEveryVecStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_every_vec_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &EveryVecStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneEveryVecStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneEveryVecStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_every_vec_struct(id: ReducerCallbackId) { + InsertOneEveryVecStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_32_reducer.rs new file mode 100644 index 00000000000..e4aa92e5533 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneF32Args { + pub f: f32, +} + +impl Reducer for InsertOneF32Args { + const REDUCER_NAME: &'static str = "insert_one_f32"; +} + +#[allow(unused)] +pub fn insert_one_f_32(f: f32) { + InsertOneF32Args { f }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_f_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &f32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneF32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneF32Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_f_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &f32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneF32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneF32Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_f_32(id: ReducerCallbackId) { + InsertOneF32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_64_reducer.rs new file mode 100644 index 00000000000..f81444bcfe1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_f_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneF64Args { + pub f: f64, +} + +impl Reducer for InsertOneF64Args { + const REDUCER_NAME: &'static str = "insert_one_f64"; +} + +#[allow(unused)] +pub fn insert_one_f_64(f: f64) { + InsertOneF64Args { f }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_f_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &f64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneF64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneF64Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_f_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &f64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneF64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneF64Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_f_64(id: ReducerCallbackId) { + InsertOneF64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_128_reducer.rs new file mode 100644 index 00000000000..ceeeb74e331 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneI128Args { + pub n: i128, +} + +impl Reducer for InsertOneI128Args { + const REDUCER_NAME: &'static str = "insert_one_i128"; +} + +#[allow(unused)] +pub fn insert_one_i_128(n: i128) { + InsertOneI128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_i_128(id: ReducerCallbackId) { + InsertOneI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_16_reducer.rs new file mode 100644 index 00000000000..7783ca3bdf4 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneI16Args { + pub n: i16, +} + +impl Reducer for InsertOneI16Args { + const REDUCER_NAME: &'static str = "insert_one_i16"; +} + +#[allow(unused)] +pub fn insert_one_i_16(n: i16) { + InsertOneI16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_i_16(id: ReducerCallbackId) { + InsertOneI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_32_reducer.rs new file mode 100644 index 00000000000..f3602f6eeb1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneI32Args { + pub n: i32, +} + +impl Reducer for InsertOneI32Args { + const REDUCER_NAME: &'static str = "insert_one_i32"; +} + +#[allow(unused)] +pub fn insert_one_i_32(n: i32) { + InsertOneI32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_i_32(id: ReducerCallbackId) { + InsertOneI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_64_reducer.rs new file mode 100644 index 00000000000..4861260f92a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneI64Args { + pub n: i64, +} + +impl Reducer for InsertOneI64Args { + const REDUCER_NAME: &'static str = "insert_one_i64"; +} + +#[allow(unused)] +pub fn insert_one_i_64(n: i64) { + InsertOneI64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_i_64(id: ReducerCallbackId) { + InsertOneI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_8_reducer.rs new file mode 100644 index 00000000000..626a0d2bd01 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneI8Args { + pub n: i8, +} + +impl Reducer for InsertOneI8Args { + const REDUCER_NAME: &'static str = "insert_one_i8"; +} + +#[allow(unused)] +pub fn insert_one_i_8(n: i8) { + InsertOneI8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8) + Send + 'static, +) -> ReducerCallbackId { + InsertOneI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_i_8(id: ReducerCallbackId) { + InsertOneI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_identity_reducer.rs new file mode 100644 index 00000000000..52be9939f76 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneIdentityArgs { + pub i: Identity, +} + +impl Reducer for InsertOneIdentityArgs { + const REDUCER_NAME: &'static str = "insert_one_identity"; +} + +#[allow(unused)] +pub fn insert_one_identity(i: Identity) { + InsertOneIdentityArgs { i }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + InsertOneIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity) + Send + 'static, +) -> ReducerCallbackId { + InsertOneIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_identity(id: ReducerCallbackId) { + InsertOneIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_simple_enum_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_simple_enum_reducer.rs new file mode 100644 index 00000000000..4033adbdc9a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_simple_enum_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::simple_enum::SimpleEnum; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneSimpleEnumArgs { + pub e: SimpleEnum, +} + +impl Reducer for InsertOneSimpleEnumArgs { + const REDUCER_NAME: &'static str = "insert_one_simple_enum"; +} + +#[allow(unused)] +pub fn insert_one_simple_enum(e: SimpleEnum) { + InsertOneSimpleEnumArgs { e }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_simple_enum( + mut __callback: impl FnMut(&Identity, Option
, &Status, &SimpleEnum) + Send + 'static, +) -> ReducerCallbackId { + InsertOneSimpleEnumArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneSimpleEnumArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_simple_enum( + __callback: impl FnOnce(&Identity, Option
, &Status, &SimpleEnum) + Send + 'static, +) -> ReducerCallbackId { + InsertOneSimpleEnumArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneSimpleEnumArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_simple_enum(id: ReducerCallbackId) { + InsertOneSimpleEnumArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_string_reducer.rs new file mode 100644 index 00000000000..ae2b4e92872 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_string_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneStringArgs { + pub s: String, +} + +impl Reducer for InsertOneStringArgs { + const REDUCER_NAME: &'static str = "insert_one_string"; +} + +#[allow(unused)] +pub fn insert_one_string(s: String) { + InsertOneStringArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + InsertOneStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String) + Send + 'static, +) -> ReducerCallbackId { + InsertOneStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_string(id: ReducerCallbackId) { + InsertOneStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_128_reducer.rs new file mode 100644 index 00000000000..9f2f27b2afc --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneU128Args { + pub n: u128, +} + +impl Reducer for InsertOneU128Args { + const REDUCER_NAME: &'static str = "insert_one_u128"; +} + +#[allow(unused)] +pub fn insert_one_u_128(n: u128) { + InsertOneU128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_u_128(id: ReducerCallbackId) { + InsertOneU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_16_reducer.rs new file mode 100644 index 00000000000..5f0e5d0d047 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneU16Args { + pub n: u16, +} + +impl Reducer for InsertOneU16Args { + const REDUCER_NAME: &'static str = "insert_one_u16"; +} + +#[allow(unused)] +pub fn insert_one_u_16(n: u16) { + InsertOneU16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_u_16(id: ReducerCallbackId) { + InsertOneU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_32_reducer.rs new file mode 100644 index 00000000000..a8edbbb0ab0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneU32Args { + pub n: u32, +} + +impl Reducer for InsertOneU32Args { + const REDUCER_NAME: &'static str = "insert_one_u32"; +} + +#[allow(unused)] +pub fn insert_one_u_32(n: u32) { + InsertOneU32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_u_32(id: ReducerCallbackId) { + InsertOneU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_64_reducer.rs new file mode 100644 index 00000000000..05cea601b55 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneU64Args { + pub n: u64, +} + +impl Reducer for InsertOneU64Args { + const REDUCER_NAME: &'static str = "insert_one_u64"; +} + +#[allow(unused)] +pub fn insert_one_u_64(n: u64) { + InsertOneU64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_u_64(id: ReducerCallbackId) { + InsertOneU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_8_reducer.rs new file mode 100644 index 00000000000..7d204d11433 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneU8Args { + pub n: u8, +} + +impl Reducer for InsertOneU8Args { + const REDUCER_NAME: &'static str = "insert_one_u8"; +} + +#[allow(unused)] +pub fn insert_one_u_8(n: u8) { + InsertOneU8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8) + Send + 'static, +) -> ReducerCallbackId { + InsertOneU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_u_8(id: ReducerCallbackId) { + InsertOneU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_unit_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_unit_struct_reducer.rs new file mode 100644 index 00000000000..c6eb66048ac --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_unit_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertOneUnitStructArgs { + pub s: UnitStruct, +} + +impl Reducer for InsertOneUnitStructArgs { + const REDUCER_NAME: &'static str = "insert_one_unit_struct"; +} + +#[allow(unused)] +pub fn insert_one_unit_struct(s: UnitStruct) { + InsertOneUnitStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_one_unit_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &UnitStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneUnitStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneUnitStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_one_unit_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &UnitStruct) + Send + 'static, +) -> ReducerCallbackId { + InsertOneUnitStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertOneUnitStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_one_unit_struct(id: ReducerCallbackId) { + InsertOneUnitStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_address_reducer.rs new file mode 100644 index 00000000000..33cc23fdf1f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_address_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkAddressArgs { + pub a: Address, + pub data: i32, +} + +impl Reducer for InsertPkAddressArgs { + const REDUCER_NAME: &'static str = "insert_pk_address"; +} + +#[allow(unused)] +pub fn insert_pk_address(a: Address, data: i32) { + InsertPkAddressArgs { a, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_address(id: ReducerCallbackId) { + InsertPkAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_bool_reducer.rs new file mode 100644 index 00000000000..81ac8bb6905 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_bool_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkBoolArgs { + pub b: bool, + pub data: i32, +} + +impl Reducer for InsertPkBoolArgs { + const REDUCER_NAME: &'static str = "insert_pk_bool"; +} + +#[allow(unused)] +pub fn insert_pk_bool(b: bool, data: i32) { + InsertPkBoolArgs { b, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_bool(id: ReducerCallbackId) { + InsertPkBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_128_reducer.rs new file mode 100644 index 00000000000..9706c891326 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkI128Args { + pub n: i128, + pub data: i32, +} + +impl Reducer for InsertPkI128Args { + const REDUCER_NAME: &'static str = "insert_pk_i128"; +} + +#[allow(unused)] +pub fn insert_pk_i_128(n: i128, data: i32) { + InsertPkI128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_i_128(id: ReducerCallbackId) { + InsertPkI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_16_reducer.rs new file mode 100644 index 00000000000..3532c608627 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkI16Args { + pub n: i16, + pub data: i32, +} + +impl Reducer for InsertPkI16Args { + const REDUCER_NAME: &'static str = "insert_pk_i16"; +} + +#[allow(unused)] +pub fn insert_pk_i_16(n: i16, data: i32) { + InsertPkI16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_i_16(id: ReducerCallbackId) { + InsertPkI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_32_reducer.rs new file mode 100644 index 00000000000..ab13d28e2f1 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkI32Args { + pub n: i32, + pub data: i32, +} + +impl Reducer for InsertPkI32Args { + const REDUCER_NAME: &'static str = "insert_pk_i32"; +} + +#[allow(unused)] +pub fn insert_pk_i_32(n: i32, data: i32) { + InsertPkI32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_i_32(id: ReducerCallbackId) { + InsertPkI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_64_reducer.rs new file mode 100644 index 00000000000..a0e77b36d41 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkI64Args { + pub n: i64, + pub data: i32, +} + +impl Reducer for InsertPkI64Args { + const REDUCER_NAME: &'static str = "insert_pk_i64"; +} + +#[allow(unused)] +pub fn insert_pk_i_64(n: i64, data: i32) { + InsertPkI64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_i_64(id: ReducerCallbackId) { + InsertPkI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_8_reducer.rs new file mode 100644 index 00000000000..80e4cb0fc93 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkI8Args { + pub n: i8, + pub data: i32, +} + +impl Reducer for InsertPkI8Args { + const REDUCER_NAME: &'static str = "insert_pk_i8"; +} + +#[allow(unused)] +pub fn insert_pk_i_8(n: i8, data: i32) { + InsertPkI8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_i_8(id: ReducerCallbackId) { + InsertPkI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_identity_reducer.rs new file mode 100644 index 00000000000..9ebecf0d044 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_identity_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkIdentityArgs { + pub i: Identity, + pub data: i32, +} + +impl Reducer for InsertPkIdentityArgs { + const REDUCER_NAME: &'static str = "insert_pk_identity"; +} + +#[allow(unused)] +pub fn insert_pk_identity(i: Identity, data: i32) { + InsertPkIdentityArgs { i, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_identity(id: ReducerCallbackId) { + InsertPkIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_string_reducer.rs new file mode 100644 index 00000000000..5ed42302c6c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_string_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkStringArgs { + pub s: String, + pub data: i32, +} + +impl Reducer for InsertPkStringArgs { + const REDUCER_NAME: &'static str = "insert_pk_string"; +} + +#[allow(unused)] +pub fn insert_pk_string(s: String, data: i32) { + InsertPkStringArgs { s, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_string(id: ReducerCallbackId) { + InsertPkStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_128_reducer.rs new file mode 100644 index 00000000000..8a5a1f247f4 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkU128Args { + pub n: u128, + pub data: i32, +} + +impl Reducer for InsertPkU128Args { + const REDUCER_NAME: &'static str = "insert_pk_u128"; +} + +#[allow(unused)] +pub fn insert_pk_u_128(n: u128, data: i32) { + InsertPkU128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_u_128(id: ReducerCallbackId) { + InsertPkU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_16_reducer.rs new file mode 100644 index 00000000000..7dc2f7fa553 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkU16Args { + pub n: u16, + pub data: i32, +} + +impl Reducer for InsertPkU16Args { + const REDUCER_NAME: &'static str = "insert_pk_u16"; +} + +#[allow(unused)] +pub fn insert_pk_u_16(n: u16, data: i32) { + InsertPkU16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_u_16(id: ReducerCallbackId) { + InsertPkU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_32_reducer.rs new file mode 100644 index 00000000000..7a35811295c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkU32Args { + pub n: u32, + pub data: i32, +} + +impl Reducer for InsertPkU32Args { + const REDUCER_NAME: &'static str = "insert_pk_u32"; +} + +#[allow(unused)] +pub fn insert_pk_u_32(n: u32, data: i32) { + InsertPkU32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_u_32(id: ReducerCallbackId) { + InsertPkU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_64_reducer.rs new file mode 100644 index 00000000000..40408b2c2c4 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkU64Args { + pub n: u64, + pub data: i32, +} + +impl Reducer for InsertPkU64Args { + const REDUCER_NAME: &'static str = "insert_pk_u64"; +} + +#[allow(unused)] +pub fn insert_pk_u_64(n: u64, data: i32) { + InsertPkU64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_u_64(id: ReducerCallbackId) { + InsertPkU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_8_reducer.rs new file mode 100644 index 00000000000..0907edcb403 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertPkU8Args { + pub n: u8, + pub data: i32, +} + +impl Reducer for InsertPkU8Args { + const REDUCER_NAME: &'static str = "insert_pk_u8"; +} + +#[allow(unused)] +pub fn insert_pk_u_8(n: u8, data: i32) { + InsertPkU8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_pk_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_pk_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertPkU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertPkU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_pk_u_8(id: ReducerCallbackId) { + InsertPkU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_table_holds_table_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_table_holds_table_reducer.rs new file mode 100644 index 00000000000..59fd0886160 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_table_holds_table_reducer.rs @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::one_u_8::OneU8; +use super::vec_u_8::VecU8; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertTableHoldsTableArgs { + pub a: OneU8, + pub b: VecU8, +} + +impl Reducer for InsertTableHoldsTableArgs { + const REDUCER_NAME: &'static str = "insert_table_holds_table"; +} + +#[allow(unused)] +pub fn insert_table_holds_table(a: OneU8, b: VecU8) { + InsertTableHoldsTableArgs { a, b }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_table_holds_table( + mut __callback: impl FnMut(&Identity, Option
, &Status, &OneU8, &VecU8) + Send + 'static, +) -> ReducerCallbackId { + InsertTableHoldsTableArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertTableHoldsTableArgs { a, b } = __args; + __callback(__identity, __addr, __status, a, b); + }) +} + +#[allow(unused)] +pub fn once_on_insert_table_holds_table( + __callback: impl FnOnce(&Identity, Option
, &Status, &OneU8, &VecU8) + Send + 'static, +) -> ReducerCallbackId { + InsertTableHoldsTableArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertTableHoldsTableArgs { a, b } = __args; + __callback(__identity, __addr, __status, a, b); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_table_holds_table(id: ReducerCallbackId) { + InsertTableHoldsTableArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_address_reducer.rs new file mode 100644 index 00000000000..1219f101f2e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_address_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueAddressArgs { + pub a: Address, + pub data: i32, +} + +impl Reducer for InsertUniqueAddressArgs { + const REDUCER_NAME: &'static str = "insert_unique_address"; +} + +#[allow(unused)] +pub fn insert_unique_address(a: Address, data: i32) { + InsertUniqueAddressArgs { a, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_address(id: ReducerCallbackId) { + InsertUniqueAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_bool_reducer.rs new file mode 100644 index 00000000000..df05bde6b1f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_bool_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueBoolArgs { + pub b: bool, + pub data: i32, +} + +impl Reducer for InsertUniqueBoolArgs { + const REDUCER_NAME: &'static str = "insert_unique_bool"; +} + +#[allow(unused)] +pub fn insert_unique_bool(b: bool, data: i32) { + InsertUniqueBoolArgs { b, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_bool(id: ReducerCallbackId) { + InsertUniqueBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_128_reducer.rs new file mode 100644 index 00000000000..78e3f3e3a01 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueI128Args { + pub n: i128, + pub data: i32, +} + +impl Reducer for InsertUniqueI128Args { + const REDUCER_NAME: &'static str = "insert_unique_i128"; +} + +#[allow(unused)] +pub fn insert_unique_i_128(n: i128, data: i32) { + InsertUniqueI128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_i_128(id: ReducerCallbackId) { + InsertUniqueI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_16_reducer.rs new file mode 100644 index 00000000000..e0d57456a53 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueI16Args { + pub n: i16, + pub data: i32, +} + +impl Reducer for InsertUniqueI16Args { + const REDUCER_NAME: &'static str = "insert_unique_i16"; +} + +#[allow(unused)] +pub fn insert_unique_i_16(n: i16, data: i32) { + InsertUniqueI16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_i_16(id: ReducerCallbackId) { + InsertUniqueI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_32_reducer.rs new file mode 100644 index 00000000000..8561ccccccb --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueI32Args { + pub n: i32, + pub data: i32, +} + +impl Reducer for InsertUniqueI32Args { + const REDUCER_NAME: &'static str = "insert_unique_i32"; +} + +#[allow(unused)] +pub fn insert_unique_i_32(n: i32, data: i32) { + InsertUniqueI32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_i_32(id: ReducerCallbackId) { + InsertUniqueI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_64_reducer.rs new file mode 100644 index 00000000000..e6113bfa8b0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueI64Args { + pub n: i64, + pub data: i32, +} + +impl Reducer for InsertUniqueI64Args { + const REDUCER_NAME: &'static str = "insert_unique_i64"; +} + +#[allow(unused)] +pub fn insert_unique_i_64(n: i64, data: i32) { + InsertUniqueI64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_i_64(id: ReducerCallbackId) { + InsertUniqueI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_8_reducer.rs new file mode 100644 index 00000000000..16693b07346 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueI8Args { + pub n: i8, + pub data: i32, +} + +impl Reducer for InsertUniqueI8Args { + const REDUCER_NAME: &'static str = "insert_unique_i8"; +} + +#[allow(unused)] +pub fn insert_unique_i_8(n: i8, data: i32) { + InsertUniqueI8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_i_8(id: ReducerCallbackId) { + InsertUniqueI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_identity_reducer.rs new file mode 100644 index 00000000000..2a91eb9a28a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_identity_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueIdentityArgs { + pub i: Identity, + pub data: i32, +} + +impl Reducer for InsertUniqueIdentityArgs { + const REDUCER_NAME: &'static str = "insert_unique_identity"; +} + +#[allow(unused)] +pub fn insert_unique_identity(i: Identity, data: i32) { + InsertUniqueIdentityArgs { i, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_identity(id: ReducerCallbackId) { + InsertUniqueIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_string_reducer.rs new file mode 100644 index 00000000000..eedc068d7fe --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_string_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueStringArgs { + pub s: String, + pub data: i32, +} + +impl Reducer for InsertUniqueStringArgs { + const REDUCER_NAME: &'static str = "insert_unique_string"; +} + +#[allow(unused)] +pub fn insert_unique_string(s: String, data: i32) { + InsertUniqueStringArgs { s, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_string(id: ReducerCallbackId) { + InsertUniqueStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_128_reducer.rs new file mode 100644 index 00000000000..5eae8efbae0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueU128Args { + pub n: u128, + pub data: i32, +} + +impl Reducer for InsertUniqueU128Args { + const REDUCER_NAME: &'static str = "insert_unique_u128"; +} + +#[allow(unused)] +pub fn insert_unique_u_128(n: u128, data: i32) { + InsertUniqueU128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_u_128(id: ReducerCallbackId) { + InsertUniqueU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_16_reducer.rs new file mode 100644 index 00000000000..724b69794cc --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueU16Args { + pub n: u16, + pub data: i32, +} + +impl Reducer for InsertUniqueU16Args { + const REDUCER_NAME: &'static str = "insert_unique_u16"; +} + +#[allow(unused)] +pub fn insert_unique_u_16(n: u16, data: i32) { + InsertUniqueU16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_u_16(id: ReducerCallbackId) { + InsertUniqueU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_32_reducer.rs new file mode 100644 index 00000000000..efa57025bee --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueU32Args { + pub n: u32, + pub data: i32, +} + +impl Reducer for InsertUniqueU32Args { + const REDUCER_NAME: &'static str = "insert_unique_u32"; +} + +#[allow(unused)] +pub fn insert_unique_u_32(n: u32, data: i32) { + InsertUniqueU32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_u_32(id: ReducerCallbackId) { + InsertUniqueU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_64_reducer.rs new file mode 100644 index 00000000000..3654d43a05d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueU64Args { + pub n: u64, + pub data: i32, +} + +impl Reducer for InsertUniqueU64Args { + const REDUCER_NAME: &'static str = "insert_unique_u64"; +} + +#[allow(unused)] +pub fn insert_unique_u_64(n: u64, data: i32) { + InsertUniqueU64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_u_64(id: ReducerCallbackId) { + InsertUniqueU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_8_reducer.rs new file mode 100644 index 00000000000..f65763a6c9c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertUniqueU8Args { + pub n: u8, + pub data: i32, +} + +impl Reducer for InsertUniqueU8Args { + const REDUCER_NAME: &'static str = "insert_unique_u8"; +} + +#[allow(unused)] +pub fn insert_unique_u_8(n: u8, data: i32) { + InsertUniqueU8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_unique_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_insert_unique_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + InsertUniqueU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertUniqueU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_unique_u_8(id: ReducerCallbackId) { + InsertUniqueU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_address_reducer.rs new file mode 100644 index 00000000000..8d64d02b2a0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_address_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecAddressArgs { + pub a: Vec
, +} + +impl Reducer for InsertVecAddressArgs { + const REDUCER_NAME: &'static str = "insert_vec_address"; +} + +#[allow(unused)] +pub fn insert_vec_address(a: Vec
) { + InsertVecAddressArgs { a }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec
) + Send + 'static, +) -> ReducerCallbackId { + InsertVecAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec
) + Send + 'static, +) -> ReducerCallbackId { + InsertVecAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecAddressArgs { a } = __args; + __callback(__identity, __addr, __status, a); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_address(id: ReducerCallbackId) { + InsertVecAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_bool_reducer.rs new file mode 100644 index 00000000000..6acc9495fc8 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_bool_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecBoolArgs { + pub b: Vec, +} + +impl Reducer for InsertVecBoolArgs { + const REDUCER_NAME: &'static str = "insert_vec_bool"; +} + +#[allow(unused)] +pub fn insert_vec_bool(b: Vec) { + InsertVecBoolArgs { b }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecBoolArgs { b } = __args; + __callback(__identity, __addr, __status, b); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_bool(id: ReducerCallbackId) { + InsertVecBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_byte_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_byte_struct_reducer.rs new file mode 100644 index 00000000000..cea1bd0765f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_byte_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecByteStructArgs { + pub s: Vec, +} + +impl Reducer for InsertVecByteStructArgs { + const REDUCER_NAME: &'static str = "insert_vec_byte_struct"; +} + +#[allow(unused)] +pub fn insert_vec_byte_struct(s: Vec) { + InsertVecByteStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_byte_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecByteStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecByteStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_byte_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecByteStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecByteStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_byte_struct(id: ReducerCallbackId) { + InsertVecByteStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_enum_with_payload_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_enum_with_payload_reducer.rs new file mode 100644 index 00000000000..5e0434a581b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_enum_with_payload_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::enum_with_payload::EnumWithPayload; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecEnumWithPayloadArgs { + pub e: Vec, +} + +impl Reducer for InsertVecEnumWithPayloadArgs { + const REDUCER_NAME: &'static str = "insert_vec_enum_with_payload"; +} + +#[allow(unused)] +pub fn insert_vec_enum_with_payload(e: Vec) { + InsertVecEnumWithPayloadArgs { e }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_enum_with_payload( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEnumWithPayloadArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEnumWithPayloadArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_enum_with_payload( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEnumWithPayloadArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEnumWithPayloadArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_enum_with_payload(id: ReducerCallbackId) { + InsertVecEnumWithPayloadArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_primitive_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_primitive_struct_reducer.rs new file mode 100644 index 00000000000..10586e34ff7 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_primitive_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_primitive_struct::EveryPrimitiveStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecEveryPrimitiveStructArgs { + pub s: Vec, +} + +impl Reducer for InsertVecEveryPrimitiveStructArgs { + const REDUCER_NAME: &'static str = "insert_vec_every_primitive_struct"; +} + +#[allow(unused)] +pub fn insert_vec_every_primitive_struct(s: Vec) { + InsertVecEveryPrimitiveStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_every_primitive_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEveryPrimitiveStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEveryPrimitiveStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_every_primitive_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEveryPrimitiveStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEveryPrimitiveStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_every_primitive_struct(id: ReducerCallbackId) { + InsertVecEveryPrimitiveStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_vec_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_vec_struct_reducer.rs new file mode 100644 index 00000000000..8f244581ad2 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_every_vec_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_vec_struct::EveryVecStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecEveryVecStructArgs { + pub s: Vec, +} + +impl Reducer for InsertVecEveryVecStructArgs { + const REDUCER_NAME: &'static str = "insert_vec_every_vec_struct"; +} + +#[allow(unused)] +pub fn insert_vec_every_vec_struct(s: Vec) { + InsertVecEveryVecStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_every_vec_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEveryVecStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEveryVecStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_every_vec_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecEveryVecStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecEveryVecStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_every_vec_struct(id: ReducerCallbackId) { + InsertVecEveryVecStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_32_reducer.rs new file mode 100644 index 00000000000..805f7c66654 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecF32Args { + pub f: Vec, +} + +impl Reducer for InsertVecF32Args { + const REDUCER_NAME: &'static str = "insert_vec_f32"; +} + +#[allow(unused)] +pub fn insert_vec_f_32(f: Vec) { + InsertVecF32Args { f }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_f_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecF32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecF32Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_f_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecF32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecF32Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_f_32(id: ReducerCallbackId) { + InsertVecF32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_64_reducer.rs new file mode 100644 index 00000000000..ee4e8b7fce0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_f_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecF64Args { + pub f: Vec, +} + +impl Reducer for InsertVecF64Args { + const REDUCER_NAME: &'static str = "insert_vec_f64"; +} + +#[allow(unused)] +pub fn insert_vec_f_64(f: Vec) { + InsertVecF64Args { f }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_f_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecF64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecF64Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_f_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecF64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecF64Args { f } = __args; + __callback(__identity, __addr, __status, f); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_f_64(id: ReducerCallbackId) { + InsertVecF64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_128_reducer.rs new file mode 100644 index 00000000000..e5ae15061a5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecI128Args { + pub n: Vec, +} + +impl Reducer for InsertVecI128Args { + const REDUCER_NAME: &'static str = "insert_vec_i128"; +} + +#[allow(unused)] +pub fn insert_vec_i_128(n: Vec) { + InsertVecI128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_i_128(id: ReducerCallbackId) { + InsertVecI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_16_reducer.rs new file mode 100644 index 00000000000..ffe017c5a48 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecI16Args { + pub n: Vec, +} + +impl Reducer for InsertVecI16Args { + const REDUCER_NAME: &'static str = "insert_vec_i16"; +} + +#[allow(unused)] +pub fn insert_vec_i_16(n: Vec) { + InsertVecI16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_i_16(id: ReducerCallbackId) { + InsertVecI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_32_reducer.rs new file mode 100644 index 00000000000..9de8417c504 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecI32Args { + pub n: Vec, +} + +impl Reducer for InsertVecI32Args { + const REDUCER_NAME: &'static str = "insert_vec_i32"; +} + +#[allow(unused)] +pub fn insert_vec_i_32(n: Vec) { + InsertVecI32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_i_32(id: ReducerCallbackId) { + InsertVecI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_64_reducer.rs new file mode 100644 index 00000000000..5b479615b0a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecI64Args { + pub n: Vec, +} + +impl Reducer for InsertVecI64Args { + const REDUCER_NAME: &'static str = "insert_vec_i64"; +} + +#[allow(unused)] +pub fn insert_vec_i_64(n: Vec) { + InsertVecI64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_i_64(id: ReducerCallbackId) { + InsertVecI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_8_reducer.rs new file mode 100644 index 00000000000..65c30fe1a34 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecI8Args { + pub n: Vec, +} + +impl Reducer for InsertVecI8Args { + const REDUCER_NAME: &'static str = "insert_vec_i8"; +} + +#[allow(unused)] +pub fn insert_vec_i_8(n: Vec) { + InsertVecI8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecI8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_i_8(id: ReducerCallbackId) { + InsertVecI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_identity_reducer.rs new file mode 100644 index 00000000000..ddc94493792 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_identity_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecIdentityArgs { + pub i: Vec, +} + +impl Reducer for InsertVecIdentityArgs { + const REDUCER_NAME: &'static str = "insert_vec_identity"; +} + +#[allow(unused)] +pub fn insert_vec_identity(i: Vec) { + InsertVecIdentityArgs { i }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecIdentityArgs { i } = __args; + __callback(__identity, __addr, __status, i); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_identity(id: ReducerCallbackId) { + InsertVecIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_simple_enum_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_simple_enum_reducer.rs new file mode 100644 index 00000000000..6b0025e69ef --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_simple_enum_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::simple_enum::SimpleEnum; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecSimpleEnumArgs { + pub e: Vec, +} + +impl Reducer for InsertVecSimpleEnumArgs { + const REDUCER_NAME: &'static str = "insert_vec_simple_enum"; +} + +#[allow(unused)] +pub fn insert_vec_simple_enum(e: Vec) { + InsertVecSimpleEnumArgs { e }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_simple_enum( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecSimpleEnumArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecSimpleEnumArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_simple_enum( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecSimpleEnumArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecSimpleEnumArgs { e } = __args; + __callback(__identity, __addr, __status, e); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_simple_enum(id: ReducerCallbackId) { + InsertVecSimpleEnumArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_string_reducer.rs new file mode 100644 index 00000000000..6894fd63fd6 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_string_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecStringArgs { + pub s: Vec, +} + +impl Reducer for InsertVecStringArgs { + const REDUCER_NAME: &'static str = "insert_vec_string"; +} + +#[allow(unused)] +pub fn insert_vec_string(s: Vec) { + InsertVecStringArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecStringArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_string(id: ReducerCallbackId) { + InsertVecStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_128_reducer.rs new file mode 100644 index 00000000000..8342b79c648 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_128_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecU128Args { + pub n: Vec, +} + +impl Reducer for InsertVecU128Args { + const REDUCER_NAME: &'static str = "insert_vec_u128"; +} + +#[allow(unused)] +pub fn insert_vec_u_128(n: Vec) { + InsertVecU128Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU128Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_u_128(id: ReducerCallbackId) { + InsertVecU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_16_reducer.rs new file mode 100644 index 00000000000..b510eab7f90 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_16_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecU16Args { + pub n: Vec, +} + +impl Reducer for InsertVecU16Args { + const REDUCER_NAME: &'static str = "insert_vec_u16"; +} + +#[allow(unused)] +pub fn insert_vec_u_16(n: Vec) { + InsertVecU16Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU16Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_u_16(id: ReducerCallbackId) { + InsertVecU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_32_reducer.rs new file mode 100644 index 00000000000..8f48f7a854c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_32_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecU32Args { + pub n: Vec, +} + +impl Reducer for InsertVecU32Args { + const REDUCER_NAME: &'static str = "insert_vec_u32"; +} + +#[allow(unused)] +pub fn insert_vec_u_32(n: Vec) { + InsertVecU32Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU32Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_u_32(id: ReducerCallbackId) { + InsertVecU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_64_reducer.rs new file mode 100644 index 00000000000..61f3006309e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_64_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecU64Args { + pub n: Vec, +} + +impl Reducer for InsertVecU64Args { + const REDUCER_NAME: &'static str = "insert_vec_u64"; +} + +#[allow(unused)] +pub fn insert_vec_u_64(n: Vec) { + InsertVecU64Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU64Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_u_64(id: ReducerCallbackId) { + InsertVecU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_8_reducer.rs new file mode 100644 index 00000000000..4d72067bbe3 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_8_reducer.rs @@ -0,0 +1,52 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecU8Args { + pub n: Vec, +} + +impl Reducer for InsertVecU8Args { + const REDUCER_NAME: &'static str = "insert_vec_u8"; +} + +#[allow(unused)] +pub fn insert_vec_u_8(n: Vec) { + InsertVecU8Args { n }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecU8Args { n } = __args; + __callback(__identity, __addr, __status, n); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_u_8(id: ReducerCallbackId) { + InsertVecU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_unit_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_unit_struct_reducer.rs new file mode 100644 index 00000000000..345c0c4b63c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_unit_struct_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct InsertVecUnitStructArgs { + pub s: Vec, +} + +impl Reducer for InsertVecUnitStructArgs { + const REDUCER_NAME: &'static str = "insert_vec_unit_struct"; +} + +#[allow(unused)] +pub fn insert_vec_unit_struct(s: Vec) { + InsertVecUnitStructArgs { s }.invoke(); +} + +#[allow(unused)] +pub fn on_insert_vec_unit_struct( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecUnitStructArgs::on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecUnitStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn once_on_insert_vec_unit_struct( + __callback: impl FnOnce(&Identity, Option
, &Status, &Vec) + Send + 'static, +) -> ReducerCallbackId { + InsertVecUnitStructArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let InsertVecUnitStructArgs { s } = __args; + __callback(__identity, __addr, __status, s); + }) +} + +#[allow(unused)] +pub fn remove_on_insert_vec_unit_struct(id: ReducerCallbackId) { + InsertVecUnitStructArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/large_table.rs b/crates/sdk/tests/test-client/src/module_bindings/large_table.rs new file mode 100644 index 00000000000..be95fef7b7f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/large_table.rs @@ -0,0 +1,131 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +use super::enum_with_payload::EnumWithPayload; +use super::every_primitive_struct::EveryPrimitiveStruct; +use super::every_vec_struct::EveryVecStruct; +use super::simple_enum::SimpleEnum; +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct LargeTable { + pub a: u8, + pub b: u16, + pub c: u32, + pub d: u64, + pub e: u128, + pub f: i8, + pub g: i16, + pub h: i32, + pub i: i64, + pub j: i128, + pub k: bool, + pub l: f32, + pub m: f64, + pub n: String, + pub o: SimpleEnum, + pub p: EnumWithPayload, + pub q: UnitStruct, + pub r: ByteStruct, + pub s: EveryPrimitiveStruct, + pub t: EveryVecStruct, +} + +impl TableType for LargeTable { + const TABLE_NAME: &'static str = "LargeTable"; + type ReducerEvent = super::ReducerEvent; +} + +impl LargeTable { + #[allow(unused)] + pub fn filter_by_a(a: u8) -> TableIter { + Self::filter(|row| row.a == a) + } + #[allow(unused)] + pub fn filter_by_b(b: u16) -> TableIter { + Self::filter(|row| row.b == b) + } + #[allow(unused)] + pub fn filter_by_c(c: u32) -> TableIter { + Self::filter(|row| row.c == c) + } + #[allow(unused)] + pub fn filter_by_d(d: u64) -> TableIter { + Self::filter(|row| row.d == d) + } + #[allow(unused)] + pub fn filter_by_e(e: u128) -> TableIter { + Self::filter(|row| row.e == e) + } + #[allow(unused)] + pub fn filter_by_f(f: i8) -> TableIter { + Self::filter(|row| row.f == f) + } + #[allow(unused)] + pub fn filter_by_g(g: i16) -> TableIter { + Self::filter(|row| row.g == g) + } + #[allow(unused)] + pub fn filter_by_h(h: i32) -> TableIter { + Self::filter(|row| row.h == h) + } + #[allow(unused)] + pub fn filter_by_i(i: i64) -> TableIter { + Self::filter(|row| row.i == i) + } + #[allow(unused)] + pub fn filter_by_j(j: i128) -> TableIter { + Self::filter(|row| row.j == j) + } + #[allow(unused)] + pub fn filter_by_k(k: bool) -> TableIter { + Self::filter(|row| row.k == k) + } + #[allow(unused)] + pub fn filter_by_l(l: f32) -> TableIter { + Self::filter(|row| row.l == l) + } + #[allow(unused)] + pub fn filter_by_m(m: f64) -> TableIter { + Self::filter(|row| row.m == m) + } + #[allow(unused)] + pub fn filter_by_n(n: String) -> TableIter { + Self::filter(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_o(o: SimpleEnum) -> TableIter { + Self::filter(|row| row.o == o) + } + #[allow(unused)] + pub fn filter_by_p(p: EnumWithPayload) -> TableIter { + Self::filter(|row| row.p == p) + } + #[allow(unused)] + pub fn filter_by_q(q: UnitStruct) -> TableIter { + Self::filter(|row| row.q == q) + } + #[allow(unused)] + pub fn filter_by_r(r: ByteStruct) -> TableIter { + Self::filter(|row| row.r == r) + } + #[allow(unused)] + pub fn filter_by_s(s: EveryPrimitiveStruct) -> TableIter { + Self::filter(|row| row.s == s) + } + #[allow(unused)] + pub fn filter_by_t(t: EveryVecStruct) -> TableIter { + Self::filter(|row| row.t == t) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/mod.rs b/crates/sdk/tests/test-client/src/module_bindings/mod.rs new file mode 100644 index 00000000000..e2167506ca7 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/mod.rs @@ -0,0 +1,1139 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use spacetimedb_sdk::callbacks::{DbCallbacks, ReducerCallbacks}; +use spacetimedb_sdk::client_api_messages::{Event, TableUpdate}; +use spacetimedb_sdk::client_cache::{ClientCache, RowCallbackReminders}; +use spacetimedb_sdk::global_connection::with_connection_mut; +use spacetimedb_sdk::identity::Credentials; +use spacetimedb_sdk::reducer::AnyReducerEvent; +use spacetimedb_sdk::spacetime_module::SpacetimeModule; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; +use std::sync::Arc; + +pub mod byte_struct; +pub mod delete_pk_address_reducer; +pub mod delete_pk_bool_reducer; +pub mod delete_pk_i_128_reducer; +pub mod delete_pk_i_16_reducer; +pub mod delete_pk_i_32_reducer; +pub mod delete_pk_i_64_reducer; +pub mod delete_pk_i_8_reducer; +pub mod delete_pk_identity_reducer; +pub mod delete_pk_string_reducer; +pub mod delete_pk_u_128_reducer; +pub mod delete_pk_u_16_reducer; +pub mod delete_pk_u_32_reducer; +pub mod delete_pk_u_64_reducer; +pub mod delete_pk_u_8_reducer; +pub mod delete_unique_address_reducer; +pub mod delete_unique_bool_reducer; +pub mod delete_unique_i_128_reducer; +pub mod delete_unique_i_16_reducer; +pub mod delete_unique_i_32_reducer; +pub mod delete_unique_i_64_reducer; +pub mod delete_unique_i_8_reducer; +pub mod delete_unique_identity_reducer; +pub mod delete_unique_string_reducer; +pub mod delete_unique_u_128_reducer; +pub mod delete_unique_u_16_reducer; +pub mod delete_unique_u_32_reducer; +pub mod delete_unique_u_64_reducer; +pub mod delete_unique_u_8_reducer; +pub mod enum_with_payload; +pub mod every_primitive_struct; +pub mod every_vec_struct; +pub mod insert_caller_one_address_reducer; +pub mod insert_caller_one_identity_reducer; +pub mod insert_caller_pk_address_reducer; +pub mod insert_caller_pk_identity_reducer; +pub mod insert_caller_unique_address_reducer; +pub mod insert_caller_unique_identity_reducer; +pub mod insert_caller_vec_address_reducer; +pub mod insert_caller_vec_identity_reducer; +pub mod insert_large_table_reducer; +pub mod insert_one_address_reducer; +pub mod insert_one_bool_reducer; +pub mod insert_one_byte_struct_reducer; +pub mod insert_one_enum_with_payload_reducer; +pub mod insert_one_every_primitive_struct_reducer; +pub mod insert_one_every_vec_struct_reducer; +pub mod insert_one_f_32_reducer; +pub mod insert_one_f_64_reducer; +pub mod insert_one_i_128_reducer; +pub mod insert_one_i_16_reducer; +pub mod insert_one_i_32_reducer; +pub mod insert_one_i_64_reducer; +pub mod insert_one_i_8_reducer; +pub mod insert_one_identity_reducer; +pub mod insert_one_simple_enum_reducer; +pub mod insert_one_string_reducer; +pub mod insert_one_u_128_reducer; +pub mod insert_one_u_16_reducer; +pub mod insert_one_u_32_reducer; +pub mod insert_one_u_64_reducer; +pub mod insert_one_u_8_reducer; +pub mod insert_one_unit_struct_reducer; +pub mod insert_pk_address_reducer; +pub mod insert_pk_bool_reducer; +pub mod insert_pk_i_128_reducer; +pub mod insert_pk_i_16_reducer; +pub mod insert_pk_i_32_reducer; +pub mod insert_pk_i_64_reducer; +pub mod insert_pk_i_8_reducer; +pub mod insert_pk_identity_reducer; +pub mod insert_pk_string_reducer; +pub mod insert_pk_u_128_reducer; +pub mod insert_pk_u_16_reducer; +pub mod insert_pk_u_32_reducer; +pub mod insert_pk_u_64_reducer; +pub mod insert_pk_u_8_reducer; +pub mod insert_table_holds_table_reducer; +pub mod insert_unique_address_reducer; +pub mod insert_unique_bool_reducer; +pub mod insert_unique_i_128_reducer; +pub mod insert_unique_i_16_reducer; +pub mod insert_unique_i_32_reducer; +pub mod insert_unique_i_64_reducer; +pub mod insert_unique_i_8_reducer; +pub mod insert_unique_identity_reducer; +pub mod insert_unique_string_reducer; +pub mod insert_unique_u_128_reducer; +pub mod insert_unique_u_16_reducer; +pub mod insert_unique_u_32_reducer; +pub mod insert_unique_u_64_reducer; +pub mod insert_unique_u_8_reducer; +pub mod insert_vec_address_reducer; +pub mod insert_vec_bool_reducer; +pub mod insert_vec_byte_struct_reducer; +pub mod insert_vec_enum_with_payload_reducer; +pub mod insert_vec_every_primitive_struct_reducer; +pub mod insert_vec_every_vec_struct_reducer; +pub mod insert_vec_f_32_reducer; +pub mod insert_vec_f_64_reducer; +pub mod insert_vec_i_128_reducer; +pub mod insert_vec_i_16_reducer; +pub mod insert_vec_i_32_reducer; +pub mod insert_vec_i_64_reducer; +pub mod insert_vec_i_8_reducer; +pub mod insert_vec_identity_reducer; +pub mod insert_vec_simple_enum_reducer; +pub mod insert_vec_string_reducer; +pub mod insert_vec_u_128_reducer; +pub mod insert_vec_u_16_reducer; +pub mod insert_vec_u_32_reducer; +pub mod insert_vec_u_64_reducer; +pub mod insert_vec_u_8_reducer; +pub mod insert_vec_unit_struct_reducer; +pub mod large_table; +pub mod one_address; +pub mod one_bool; +pub mod one_byte_struct; +pub mod one_enum_with_payload; +pub mod one_every_primitive_struct; +pub mod one_every_vec_struct; +pub mod one_f_32; +pub mod one_f_64; +pub mod one_i_128; +pub mod one_i_16; +pub mod one_i_32; +pub mod one_i_64; +pub mod one_i_8; +pub mod one_identity; +pub mod one_simple_enum; +pub mod one_string; +pub mod one_u_128; +pub mod one_u_16; +pub mod one_u_32; +pub mod one_u_64; +pub mod one_u_8; +pub mod one_unit_struct; +pub mod pk_address; +pub mod pk_bool; +pub mod pk_i_128; +pub mod pk_i_16; +pub mod pk_i_32; +pub mod pk_i_64; +pub mod pk_i_8; +pub mod pk_identity; +pub mod pk_string; +pub mod pk_u_128; +pub mod pk_u_16; +pub mod pk_u_32; +pub mod pk_u_64; +pub mod pk_u_8; +pub mod simple_enum; +pub mod table_holds_table; +pub mod unique_address; +pub mod unique_bool; +pub mod unique_i_128; +pub mod unique_i_16; +pub mod unique_i_32; +pub mod unique_i_64; +pub mod unique_i_8; +pub mod unique_identity; +pub mod unique_string; +pub mod unique_u_128; +pub mod unique_u_16; +pub mod unique_u_32; +pub mod unique_u_64; +pub mod unique_u_8; +pub mod unit_struct; +pub mod update_pk_address_reducer; +pub mod update_pk_bool_reducer; +pub mod update_pk_i_128_reducer; +pub mod update_pk_i_16_reducer; +pub mod update_pk_i_32_reducer; +pub mod update_pk_i_64_reducer; +pub mod update_pk_i_8_reducer; +pub mod update_pk_identity_reducer; +pub mod update_pk_string_reducer; +pub mod update_pk_u_128_reducer; +pub mod update_pk_u_16_reducer; +pub mod update_pk_u_32_reducer; +pub mod update_pk_u_64_reducer; +pub mod update_pk_u_8_reducer; +pub mod update_unique_address_reducer; +pub mod update_unique_bool_reducer; +pub mod update_unique_i_128_reducer; +pub mod update_unique_i_16_reducer; +pub mod update_unique_i_32_reducer; +pub mod update_unique_i_64_reducer; +pub mod update_unique_i_8_reducer; +pub mod update_unique_identity_reducer; +pub mod update_unique_string_reducer; +pub mod update_unique_u_128_reducer; +pub mod update_unique_u_16_reducer; +pub mod update_unique_u_32_reducer; +pub mod update_unique_u_64_reducer; +pub mod update_unique_u_8_reducer; +pub mod vec_address; +pub mod vec_bool; +pub mod vec_byte_struct; +pub mod vec_enum_with_payload; +pub mod vec_every_primitive_struct; +pub mod vec_every_vec_struct; +pub mod vec_f_32; +pub mod vec_f_64; +pub mod vec_i_128; +pub mod vec_i_16; +pub mod vec_i_32; +pub mod vec_i_64; +pub mod vec_i_8; +pub mod vec_identity; +pub mod vec_simple_enum; +pub mod vec_string; +pub mod vec_u_128; +pub mod vec_u_16; +pub mod vec_u_32; +pub mod vec_u_64; +pub mod vec_u_8; +pub mod vec_unit_struct; + +pub use byte_struct::*; +pub use delete_pk_address_reducer::*; +pub use delete_pk_bool_reducer::*; +pub use delete_pk_i_128_reducer::*; +pub use delete_pk_i_16_reducer::*; +pub use delete_pk_i_32_reducer::*; +pub use delete_pk_i_64_reducer::*; +pub use delete_pk_i_8_reducer::*; +pub use delete_pk_identity_reducer::*; +pub use delete_pk_string_reducer::*; +pub use delete_pk_u_128_reducer::*; +pub use delete_pk_u_16_reducer::*; +pub use delete_pk_u_32_reducer::*; +pub use delete_pk_u_64_reducer::*; +pub use delete_pk_u_8_reducer::*; +pub use delete_unique_address_reducer::*; +pub use delete_unique_bool_reducer::*; +pub use delete_unique_i_128_reducer::*; +pub use delete_unique_i_16_reducer::*; +pub use delete_unique_i_32_reducer::*; +pub use delete_unique_i_64_reducer::*; +pub use delete_unique_i_8_reducer::*; +pub use delete_unique_identity_reducer::*; +pub use delete_unique_string_reducer::*; +pub use delete_unique_u_128_reducer::*; +pub use delete_unique_u_16_reducer::*; +pub use delete_unique_u_32_reducer::*; +pub use delete_unique_u_64_reducer::*; +pub use delete_unique_u_8_reducer::*; +pub use enum_with_payload::*; +pub use every_primitive_struct::*; +pub use every_vec_struct::*; +pub use insert_caller_one_address_reducer::*; +pub use insert_caller_one_identity_reducer::*; +pub use insert_caller_pk_address_reducer::*; +pub use insert_caller_pk_identity_reducer::*; +pub use insert_caller_unique_address_reducer::*; +pub use insert_caller_unique_identity_reducer::*; +pub use insert_caller_vec_address_reducer::*; +pub use insert_caller_vec_identity_reducer::*; +pub use insert_large_table_reducer::*; +pub use insert_one_address_reducer::*; +pub use insert_one_bool_reducer::*; +pub use insert_one_byte_struct_reducer::*; +pub use insert_one_enum_with_payload_reducer::*; +pub use insert_one_every_primitive_struct_reducer::*; +pub use insert_one_every_vec_struct_reducer::*; +pub use insert_one_f_32_reducer::*; +pub use insert_one_f_64_reducer::*; +pub use insert_one_i_128_reducer::*; +pub use insert_one_i_16_reducer::*; +pub use insert_one_i_32_reducer::*; +pub use insert_one_i_64_reducer::*; +pub use insert_one_i_8_reducer::*; +pub use insert_one_identity_reducer::*; +pub use insert_one_simple_enum_reducer::*; +pub use insert_one_string_reducer::*; +pub use insert_one_u_128_reducer::*; +pub use insert_one_u_16_reducer::*; +pub use insert_one_u_32_reducer::*; +pub use insert_one_u_64_reducer::*; +pub use insert_one_u_8_reducer::*; +pub use insert_one_unit_struct_reducer::*; +pub use insert_pk_address_reducer::*; +pub use insert_pk_bool_reducer::*; +pub use insert_pk_i_128_reducer::*; +pub use insert_pk_i_16_reducer::*; +pub use insert_pk_i_32_reducer::*; +pub use insert_pk_i_64_reducer::*; +pub use insert_pk_i_8_reducer::*; +pub use insert_pk_identity_reducer::*; +pub use insert_pk_string_reducer::*; +pub use insert_pk_u_128_reducer::*; +pub use insert_pk_u_16_reducer::*; +pub use insert_pk_u_32_reducer::*; +pub use insert_pk_u_64_reducer::*; +pub use insert_pk_u_8_reducer::*; +pub use insert_table_holds_table_reducer::*; +pub use insert_unique_address_reducer::*; +pub use insert_unique_bool_reducer::*; +pub use insert_unique_i_128_reducer::*; +pub use insert_unique_i_16_reducer::*; +pub use insert_unique_i_32_reducer::*; +pub use insert_unique_i_64_reducer::*; +pub use insert_unique_i_8_reducer::*; +pub use insert_unique_identity_reducer::*; +pub use insert_unique_string_reducer::*; +pub use insert_unique_u_128_reducer::*; +pub use insert_unique_u_16_reducer::*; +pub use insert_unique_u_32_reducer::*; +pub use insert_unique_u_64_reducer::*; +pub use insert_unique_u_8_reducer::*; +pub use insert_vec_address_reducer::*; +pub use insert_vec_bool_reducer::*; +pub use insert_vec_byte_struct_reducer::*; +pub use insert_vec_enum_with_payload_reducer::*; +pub use insert_vec_every_primitive_struct_reducer::*; +pub use insert_vec_every_vec_struct_reducer::*; +pub use insert_vec_f_32_reducer::*; +pub use insert_vec_f_64_reducer::*; +pub use insert_vec_i_128_reducer::*; +pub use insert_vec_i_16_reducer::*; +pub use insert_vec_i_32_reducer::*; +pub use insert_vec_i_64_reducer::*; +pub use insert_vec_i_8_reducer::*; +pub use insert_vec_identity_reducer::*; +pub use insert_vec_simple_enum_reducer::*; +pub use insert_vec_string_reducer::*; +pub use insert_vec_u_128_reducer::*; +pub use insert_vec_u_16_reducer::*; +pub use insert_vec_u_32_reducer::*; +pub use insert_vec_u_64_reducer::*; +pub use insert_vec_u_8_reducer::*; +pub use insert_vec_unit_struct_reducer::*; +pub use large_table::*; +pub use one_address::*; +pub use one_bool::*; +pub use one_byte_struct::*; +pub use one_enum_with_payload::*; +pub use one_every_primitive_struct::*; +pub use one_every_vec_struct::*; +pub use one_f_32::*; +pub use one_f_64::*; +pub use one_i_128::*; +pub use one_i_16::*; +pub use one_i_32::*; +pub use one_i_64::*; +pub use one_i_8::*; +pub use one_identity::*; +pub use one_simple_enum::*; +pub use one_string::*; +pub use one_u_128::*; +pub use one_u_16::*; +pub use one_u_32::*; +pub use one_u_64::*; +pub use one_u_8::*; +pub use one_unit_struct::*; +pub use pk_address::*; +pub use pk_bool::*; +pub use pk_i_128::*; +pub use pk_i_16::*; +pub use pk_i_32::*; +pub use pk_i_64::*; +pub use pk_i_8::*; +pub use pk_identity::*; +pub use pk_string::*; +pub use pk_u_128::*; +pub use pk_u_16::*; +pub use pk_u_32::*; +pub use pk_u_64::*; +pub use pk_u_8::*; +pub use simple_enum::*; +pub use table_holds_table::*; +pub use unique_address::*; +pub use unique_bool::*; +pub use unique_i_128::*; +pub use unique_i_16::*; +pub use unique_i_32::*; +pub use unique_i_64::*; +pub use unique_i_8::*; +pub use unique_identity::*; +pub use unique_string::*; +pub use unique_u_128::*; +pub use unique_u_16::*; +pub use unique_u_32::*; +pub use unique_u_64::*; +pub use unique_u_8::*; +pub use unit_struct::*; +pub use update_pk_address_reducer::*; +pub use update_pk_bool_reducer::*; +pub use update_pk_i_128_reducer::*; +pub use update_pk_i_16_reducer::*; +pub use update_pk_i_32_reducer::*; +pub use update_pk_i_64_reducer::*; +pub use update_pk_i_8_reducer::*; +pub use update_pk_identity_reducer::*; +pub use update_pk_string_reducer::*; +pub use update_pk_u_128_reducer::*; +pub use update_pk_u_16_reducer::*; +pub use update_pk_u_32_reducer::*; +pub use update_pk_u_64_reducer::*; +pub use update_pk_u_8_reducer::*; +pub use update_unique_address_reducer::*; +pub use update_unique_bool_reducer::*; +pub use update_unique_i_128_reducer::*; +pub use update_unique_i_16_reducer::*; +pub use update_unique_i_32_reducer::*; +pub use update_unique_i_64_reducer::*; +pub use update_unique_i_8_reducer::*; +pub use update_unique_identity_reducer::*; +pub use update_unique_string_reducer::*; +pub use update_unique_u_128_reducer::*; +pub use update_unique_u_16_reducer::*; +pub use update_unique_u_32_reducer::*; +pub use update_unique_u_64_reducer::*; +pub use update_unique_u_8_reducer::*; +pub use vec_address::*; +pub use vec_bool::*; +pub use vec_byte_struct::*; +pub use vec_enum_with_payload::*; +pub use vec_every_primitive_struct::*; +pub use vec_every_vec_struct::*; +pub use vec_f_32::*; +pub use vec_f_64::*; +pub use vec_i_128::*; +pub use vec_i_16::*; +pub use vec_i_32::*; +pub use vec_i_64::*; +pub use vec_i_8::*; +pub use vec_identity::*; +pub use vec_simple_enum::*; +pub use vec_string::*; +pub use vec_u_128::*; +pub use vec_u_16::*; +pub use vec_u_32::*; +pub use vec_u_64::*; +pub use vec_u_8::*; +pub use vec_unit_struct::*; + +#[allow(unused)] +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub enum ReducerEvent { + DeletePkAddress(delete_pk_address_reducer::DeletePkAddressArgs), + DeletePkBool(delete_pk_bool_reducer::DeletePkBoolArgs), + DeletePkI128(delete_pk_i_128_reducer::DeletePkI128Args), + DeletePkI16(delete_pk_i_16_reducer::DeletePkI16Args), + DeletePkI32(delete_pk_i_32_reducer::DeletePkI32Args), + DeletePkI64(delete_pk_i_64_reducer::DeletePkI64Args), + DeletePkI8(delete_pk_i_8_reducer::DeletePkI8Args), + DeletePkIdentity(delete_pk_identity_reducer::DeletePkIdentityArgs), + DeletePkString(delete_pk_string_reducer::DeletePkStringArgs), + DeletePkU128(delete_pk_u_128_reducer::DeletePkU128Args), + DeletePkU16(delete_pk_u_16_reducer::DeletePkU16Args), + DeletePkU32(delete_pk_u_32_reducer::DeletePkU32Args), + DeletePkU64(delete_pk_u_64_reducer::DeletePkU64Args), + DeletePkU8(delete_pk_u_8_reducer::DeletePkU8Args), + DeleteUniqueAddress(delete_unique_address_reducer::DeleteUniqueAddressArgs), + DeleteUniqueBool(delete_unique_bool_reducer::DeleteUniqueBoolArgs), + DeleteUniqueI128(delete_unique_i_128_reducer::DeleteUniqueI128Args), + DeleteUniqueI16(delete_unique_i_16_reducer::DeleteUniqueI16Args), + DeleteUniqueI32(delete_unique_i_32_reducer::DeleteUniqueI32Args), + DeleteUniqueI64(delete_unique_i_64_reducer::DeleteUniqueI64Args), + DeleteUniqueI8(delete_unique_i_8_reducer::DeleteUniqueI8Args), + DeleteUniqueIdentity(delete_unique_identity_reducer::DeleteUniqueIdentityArgs), + DeleteUniqueString(delete_unique_string_reducer::DeleteUniqueStringArgs), + DeleteUniqueU128(delete_unique_u_128_reducer::DeleteUniqueU128Args), + DeleteUniqueU16(delete_unique_u_16_reducer::DeleteUniqueU16Args), + DeleteUniqueU32(delete_unique_u_32_reducer::DeleteUniqueU32Args), + DeleteUniqueU64(delete_unique_u_64_reducer::DeleteUniqueU64Args), + DeleteUniqueU8(delete_unique_u_8_reducer::DeleteUniqueU8Args), + InsertCallerOneAddress(insert_caller_one_address_reducer::InsertCallerOneAddressArgs), + InsertCallerOneIdentity(insert_caller_one_identity_reducer::InsertCallerOneIdentityArgs), + InsertCallerPkAddress(insert_caller_pk_address_reducer::InsertCallerPkAddressArgs), + InsertCallerPkIdentity(insert_caller_pk_identity_reducer::InsertCallerPkIdentityArgs), + InsertCallerUniqueAddress(insert_caller_unique_address_reducer::InsertCallerUniqueAddressArgs), + InsertCallerUniqueIdentity(insert_caller_unique_identity_reducer::InsertCallerUniqueIdentityArgs), + InsertCallerVecAddress(insert_caller_vec_address_reducer::InsertCallerVecAddressArgs), + InsertCallerVecIdentity(insert_caller_vec_identity_reducer::InsertCallerVecIdentityArgs), + InsertLargeTable(insert_large_table_reducer::InsertLargeTableArgs), + InsertOneAddress(insert_one_address_reducer::InsertOneAddressArgs), + InsertOneBool(insert_one_bool_reducer::InsertOneBoolArgs), + InsertOneByteStruct(insert_one_byte_struct_reducer::InsertOneByteStructArgs), + InsertOneEnumWithPayload(insert_one_enum_with_payload_reducer::InsertOneEnumWithPayloadArgs), + InsertOneEveryPrimitiveStruct(insert_one_every_primitive_struct_reducer::InsertOneEveryPrimitiveStructArgs), + InsertOneEveryVecStruct(insert_one_every_vec_struct_reducer::InsertOneEveryVecStructArgs), + InsertOneF32(insert_one_f_32_reducer::InsertOneF32Args), + InsertOneF64(insert_one_f_64_reducer::InsertOneF64Args), + InsertOneI128(insert_one_i_128_reducer::InsertOneI128Args), + InsertOneI16(insert_one_i_16_reducer::InsertOneI16Args), + InsertOneI32(insert_one_i_32_reducer::InsertOneI32Args), + InsertOneI64(insert_one_i_64_reducer::InsertOneI64Args), + InsertOneI8(insert_one_i_8_reducer::InsertOneI8Args), + InsertOneIdentity(insert_one_identity_reducer::InsertOneIdentityArgs), + InsertOneSimpleEnum(insert_one_simple_enum_reducer::InsertOneSimpleEnumArgs), + InsertOneString(insert_one_string_reducer::InsertOneStringArgs), + InsertOneU128(insert_one_u_128_reducer::InsertOneU128Args), + InsertOneU16(insert_one_u_16_reducer::InsertOneU16Args), + InsertOneU32(insert_one_u_32_reducer::InsertOneU32Args), + InsertOneU64(insert_one_u_64_reducer::InsertOneU64Args), + InsertOneU8(insert_one_u_8_reducer::InsertOneU8Args), + InsertOneUnitStruct(insert_one_unit_struct_reducer::InsertOneUnitStructArgs), + InsertPkAddress(insert_pk_address_reducer::InsertPkAddressArgs), + InsertPkBool(insert_pk_bool_reducer::InsertPkBoolArgs), + InsertPkI128(insert_pk_i_128_reducer::InsertPkI128Args), + InsertPkI16(insert_pk_i_16_reducer::InsertPkI16Args), + InsertPkI32(insert_pk_i_32_reducer::InsertPkI32Args), + InsertPkI64(insert_pk_i_64_reducer::InsertPkI64Args), + InsertPkI8(insert_pk_i_8_reducer::InsertPkI8Args), + InsertPkIdentity(insert_pk_identity_reducer::InsertPkIdentityArgs), + InsertPkString(insert_pk_string_reducer::InsertPkStringArgs), + InsertPkU128(insert_pk_u_128_reducer::InsertPkU128Args), + InsertPkU16(insert_pk_u_16_reducer::InsertPkU16Args), + InsertPkU32(insert_pk_u_32_reducer::InsertPkU32Args), + InsertPkU64(insert_pk_u_64_reducer::InsertPkU64Args), + InsertPkU8(insert_pk_u_8_reducer::InsertPkU8Args), + InsertTableHoldsTable(insert_table_holds_table_reducer::InsertTableHoldsTableArgs), + InsertUniqueAddress(insert_unique_address_reducer::InsertUniqueAddressArgs), + InsertUniqueBool(insert_unique_bool_reducer::InsertUniqueBoolArgs), + InsertUniqueI128(insert_unique_i_128_reducer::InsertUniqueI128Args), + InsertUniqueI16(insert_unique_i_16_reducer::InsertUniqueI16Args), + InsertUniqueI32(insert_unique_i_32_reducer::InsertUniqueI32Args), + InsertUniqueI64(insert_unique_i_64_reducer::InsertUniqueI64Args), + InsertUniqueI8(insert_unique_i_8_reducer::InsertUniqueI8Args), + InsertUniqueIdentity(insert_unique_identity_reducer::InsertUniqueIdentityArgs), + InsertUniqueString(insert_unique_string_reducer::InsertUniqueStringArgs), + InsertUniqueU128(insert_unique_u_128_reducer::InsertUniqueU128Args), + InsertUniqueU16(insert_unique_u_16_reducer::InsertUniqueU16Args), + InsertUniqueU32(insert_unique_u_32_reducer::InsertUniqueU32Args), + InsertUniqueU64(insert_unique_u_64_reducer::InsertUniqueU64Args), + InsertUniqueU8(insert_unique_u_8_reducer::InsertUniqueU8Args), + InsertVecAddress(insert_vec_address_reducer::InsertVecAddressArgs), + InsertVecBool(insert_vec_bool_reducer::InsertVecBoolArgs), + InsertVecByteStruct(insert_vec_byte_struct_reducer::InsertVecByteStructArgs), + InsertVecEnumWithPayload(insert_vec_enum_with_payload_reducer::InsertVecEnumWithPayloadArgs), + InsertVecEveryPrimitiveStruct(insert_vec_every_primitive_struct_reducer::InsertVecEveryPrimitiveStructArgs), + InsertVecEveryVecStruct(insert_vec_every_vec_struct_reducer::InsertVecEveryVecStructArgs), + InsertVecF32(insert_vec_f_32_reducer::InsertVecF32Args), + InsertVecF64(insert_vec_f_64_reducer::InsertVecF64Args), + InsertVecI128(insert_vec_i_128_reducer::InsertVecI128Args), + InsertVecI16(insert_vec_i_16_reducer::InsertVecI16Args), + InsertVecI32(insert_vec_i_32_reducer::InsertVecI32Args), + InsertVecI64(insert_vec_i_64_reducer::InsertVecI64Args), + InsertVecI8(insert_vec_i_8_reducer::InsertVecI8Args), + InsertVecIdentity(insert_vec_identity_reducer::InsertVecIdentityArgs), + InsertVecSimpleEnum(insert_vec_simple_enum_reducer::InsertVecSimpleEnumArgs), + InsertVecString(insert_vec_string_reducer::InsertVecStringArgs), + InsertVecU128(insert_vec_u_128_reducer::InsertVecU128Args), + InsertVecU16(insert_vec_u_16_reducer::InsertVecU16Args), + InsertVecU32(insert_vec_u_32_reducer::InsertVecU32Args), + InsertVecU64(insert_vec_u_64_reducer::InsertVecU64Args), + InsertVecU8(insert_vec_u_8_reducer::InsertVecU8Args), + InsertVecUnitStruct(insert_vec_unit_struct_reducer::InsertVecUnitStructArgs), + UpdatePkAddress(update_pk_address_reducer::UpdatePkAddressArgs), + UpdatePkBool(update_pk_bool_reducer::UpdatePkBoolArgs), + UpdatePkI128(update_pk_i_128_reducer::UpdatePkI128Args), + UpdatePkI16(update_pk_i_16_reducer::UpdatePkI16Args), + UpdatePkI32(update_pk_i_32_reducer::UpdatePkI32Args), + UpdatePkI64(update_pk_i_64_reducer::UpdatePkI64Args), + UpdatePkI8(update_pk_i_8_reducer::UpdatePkI8Args), + UpdatePkIdentity(update_pk_identity_reducer::UpdatePkIdentityArgs), + UpdatePkString(update_pk_string_reducer::UpdatePkStringArgs), + UpdatePkU128(update_pk_u_128_reducer::UpdatePkU128Args), + UpdatePkU16(update_pk_u_16_reducer::UpdatePkU16Args), + UpdatePkU32(update_pk_u_32_reducer::UpdatePkU32Args), + UpdatePkU64(update_pk_u_64_reducer::UpdatePkU64Args), + UpdatePkU8(update_pk_u_8_reducer::UpdatePkU8Args), + UpdateUniqueAddress(update_unique_address_reducer::UpdateUniqueAddressArgs), + UpdateUniqueBool(update_unique_bool_reducer::UpdateUniqueBoolArgs), + UpdateUniqueI128(update_unique_i_128_reducer::UpdateUniqueI128Args), + UpdateUniqueI16(update_unique_i_16_reducer::UpdateUniqueI16Args), + UpdateUniqueI32(update_unique_i_32_reducer::UpdateUniqueI32Args), + UpdateUniqueI64(update_unique_i_64_reducer::UpdateUniqueI64Args), + UpdateUniqueI8(update_unique_i_8_reducer::UpdateUniqueI8Args), + UpdateUniqueIdentity(update_unique_identity_reducer::UpdateUniqueIdentityArgs), + UpdateUniqueString(update_unique_string_reducer::UpdateUniqueStringArgs), + UpdateUniqueU128(update_unique_u_128_reducer::UpdateUniqueU128Args), + UpdateUniqueU16(update_unique_u_16_reducer::UpdateUniqueU16Args), + UpdateUniqueU32(update_unique_u_32_reducer::UpdateUniqueU32Args), + UpdateUniqueU64(update_unique_u_64_reducer::UpdateUniqueU64Args), + UpdateUniqueU8(update_unique_u_8_reducer::UpdateUniqueU8Args), +} + +#[allow(unused)] +pub struct Module; +impl SpacetimeModule for Module { + fn handle_table_update( + &self, + table_update: TableUpdate, + client_cache: &mut ClientCache, + callbacks: &mut RowCallbackReminders, + ) { + let table_name = &table_update.table_name[..]; + match table_name { + "LargeTable" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "OneAddress" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "OneBool" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneByteStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "OneEnumWithPayload" => client_cache + .handle_table_update_no_primary_key::( + callbacks, + table_update, + ), + "OneEveryPrimitiveStruct" => client_cache + .handle_table_update_no_primary_key::( + callbacks, + table_update, + ), + "OneEveryVecStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "OneF32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneF64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneI128" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneI16" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneI32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneI64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneI8" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneIdentity" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "OneSimpleEnum" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "OneString" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "OneU128" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneU16" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneU32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneU64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneU8" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "OneUnitStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "PkAddress" => { + client_cache.handle_table_update_with_primary_key::(callbacks, table_update) + } + "PkBool" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkI128" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkI16" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkI32" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkI64" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkI8" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkIdentity" => { + client_cache.handle_table_update_with_primary_key::(callbacks, table_update) + } + "PkString" => { + client_cache.handle_table_update_with_primary_key::(callbacks, table_update) + } + "PkU128" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkU16" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkU32" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkU64" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "PkU8" => client_cache.handle_table_update_with_primary_key::(callbacks, table_update), + "TableHoldsTable" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "UniqueAddress" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "UniqueBool" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueI128" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueI16" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueI32" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueI64" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueI8" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueIdentity" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "UniqueString" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueU128" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueU16" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueU32" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueU64" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "UniqueU8" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "VecAddress" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "VecBool" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecByteStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "VecEnumWithPayload" => client_cache + .handle_table_update_no_primary_key::( + callbacks, + table_update, + ), + "VecEveryPrimitiveStruct" => client_cache + .handle_table_update_no_primary_key::( + callbacks, + table_update, + ), + "VecEveryVecStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "VecF32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecF64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecI128" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecI16" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecI32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecI64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecI8" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecIdentity" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "VecSimpleEnum" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + "VecString" => { + client_cache.handle_table_update_no_primary_key::(callbacks, table_update) + } + "VecU128" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecU16" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecU32" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecU64" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecU8" => client_cache.handle_table_update_no_primary_key::(callbacks, table_update), + "VecUnitStruct" => client_cache + .handle_table_update_no_primary_key::(callbacks, table_update), + _ => spacetimedb_sdk::log::error!("TableRowOperation on unknown table {:?}", table_name), + } + } + fn invoke_row_callbacks( + &self, + reminders: &mut RowCallbackReminders, + worker: &mut DbCallbacks, + reducer_event: Option>, + state: &Arc, + ) { + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::( + worker, + &reducer_event, + state, + ); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::( + worker, + &reducer_event, + state, + ); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + reminders.invoke_callbacks::(worker, &reducer_event, state); + } + fn handle_event( + &self, + event: Event, + _reducer_callbacks: &mut ReducerCallbacks, + _state: Arc, + ) -> Option> { + let Some(function_call) = &event.function_call else { + spacetimedb_sdk::log::warn!("Received Event with None function_call"); + return None; + }; + #[allow(clippy::match_single_binding)] + match &function_call.reducer[..] { + "delete_pk_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkAddress), + "delete_pk_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkBool), + "delete_pk_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkI128), + "delete_pk_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkI16), + "delete_pk_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkI32), + "delete_pk_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkI64), + "delete_pk_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkI8), + "delete_pk_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkIdentity), + "delete_pk_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkString), + "delete_pk_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkU128), + "delete_pk_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkU16), + "delete_pk_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkU32), + "delete_pk_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkU64), + "delete_pk_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeletePkU8), + "delete_unique_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueAddress), + "delete_unique_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueBool), + "delete_unique_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueI128), + "delete_unique_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueI16), + "delete_unique_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueI32), + "delete_unique_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueI64), + "delete_unique_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueI8), + "delete_unique_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueIdentity), + "delete_unique_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueString), + "delete_unique_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueU128), + "delete_unique_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueU16), + "delete_unique_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueU32), + "delete_unique_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueU64), + "delete_unique_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::DeleteUniqueU8), + "insert_caller_one_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerOneAddress), + "insert_caller_one_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerOneIdentity), + "insert_caller_pk_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerPkAddress), + "insert_caller_pk_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerPkIdentity), + "insert_caller_unique_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerUniqueAddress), + "insert_caller_unique_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerUniqueIdentity), + "insert_caller_vec_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerVecAddress), + "insert_caller_vec_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertCallerVecIdentity), + "insert_large_table" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertLargeTable), + "insert_one_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneAddress), + "insert_one_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneBool), + "insert_one_byte_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneByteStruct), + "insert_one_enum_with_payload" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneEnumWithPayload), + "insert_one_every_primitive_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneEveryPrimitiveStruct), + "insert_one_every_vec_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneEveryVecStruct), + "insert_one_f32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneF32), + "insert_one_f64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneF64), + "insert_one_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneI128), + "insert_one_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneI16), + "insert_one_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneI32), + "insert_one_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneI64), + "insert_one_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneI8), + "insert_one_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneIdentity), + "insert_one_simple_enum" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneSimpleEnum), + "insert_one_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneString), + "insert_one_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneU128), + "insert_one_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneU16), + "insert_one_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneU32), + "insert_one_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneU64), + "insert_one_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneU8), + "insert_one_unit_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertOneUnitStruct), + "insert_pk_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkAddress), + "insert_pk_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkBool), + "insert_pk_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkI128), + "insert_pk_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkI16), + "insert_pk_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkI32), + "insert_pk_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkI64), + "insert_pk_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkI8), + "insert_pk_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkIdentity), + "insert_pk_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkString), + "insert_pk_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkU128), + "insert_pk_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkU16), + "insert_pk_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkU32), + "insert_pk_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkU64), + "insert_pk_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertPkU8), + "insert_table_holds_table" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertTableHoldsTable), + "insert_unique_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueAddress), + "insert_unique_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueBool), + "insert_unique_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueI128), + "insert_unique_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueI16), + "insert_unique_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueI32), + "insert_unique_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueI64), + "insert_unique_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueI8), + "insert_unique_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueIdentity), + "insert_unique_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueString), + "insert_unique_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueU128), + "insert_unique_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueU16), + "insert_unique_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueU32), + "insert_unique_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueU64), + "insert_unique_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertUniqueU8), + "insert_vec_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecAddress), + "insert_vec_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecBool), + "insert_vec_byte_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecByteStruct), + "insert_vec_enum_with_payload" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecEnumWithPayload), + "insert_vec_every_primitive_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecEveryPrimitiveStruct), + "insert_vec_every_vec_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecEveryVecStruct), + "insert_vec_f32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecF32), + "insert_vec_f64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecF64), + "insert_vec_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecI128), + "insert_vec_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecI16), + "insert_vec_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecI32), + "insert_vec_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecI64), + "insert_vec_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecI8), + "insert_vec_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecIdentity), + "insert_vec_simple_enum" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecSimpleEnum), + "insert_vec_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecString), + "insert_vec_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecU128), + "insert_vec_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecU16), + "insert_vec_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecU32), + "insert_vec_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecU64), + "insert_vec_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecU8), + "insert_vec_unit_struct" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::InsertVecUnitStruct), + "update_pk_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkAddress), + "update_pk_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkBool), + "update_pk_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkI128), + "update_pk_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkI16), + "update_pk_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkI32), + "update_pk_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkI64), + "update_pk_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkI8), + "update_pk_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkIdentity), + "update_pk_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkString), + "update_pk_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkU128), + "update_pk_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkU16), + "update_pk_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkU32), + "update_pk_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkU64), + "update_pk_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdatePkU8), + "update_unique_address" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueAddress), + "update_unique_bool" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueBool), + "update_unique_i128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueI128), + "update_unique_i16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueI16), + "update_unique_i32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueI32), + "update_unique_i64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueI64), + "update_unique_i8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueI8), + "update_unique_identity" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueIdentity), + "update_unique_string" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueString), + "update_unique_u128" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueU128), + "update_unique_u16" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueU16), + "update_unique_u32" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueU32), + "update_unique_u64" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueU64), + "update_unique_u8" => _reducer_callbacks.handle_event_of_type::(event, _state, ReducerEvent::UpdateUniqueU8), + unknown => { spacetimedb_sdk::log::error!("Event on an unknown reducer: {:?}", unknown); None } + } + } + fn handle_resubscribe( + &self, + new_subs: TableUpdate, + client_cache: &mut ClientCache, + callbacks: &mut RowCallbackReminders, + ) { + let table_name = &new_subs.table_name[..]; + match table_name { + "LargeTable" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneAddress" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneBool" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneByteStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "OneEnumWithPayload" => client_cache + .handle_resubscribe_for_type::(callbacks, new_subs), + "OneEveryPrimitiveStruct" => client_cache + .handle_resubscribe_for_type::( + callbacks, new_subs, + ), + "OneEveryVecStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "OneF32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneF64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneI128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneI16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneI32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneI64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneI8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneIdentity" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneSimpleEnum" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "OneString" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneU128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneU16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneU32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneU64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneU8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "OneUnitStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "PkAddress" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkBool" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkI128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkI16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkI32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkI64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkI8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkIdentity" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkString" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkU128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkU16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkU32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkU64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "PkU8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "TableHoldsTable" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "UniqueAddress" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "UniqueBool" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueI128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueI16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueI32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueI64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueI8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueIdentity" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "UniqueString" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "UniqueU128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueU16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueU32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueU64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "UniqueU8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecAddress" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecBool" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecByteStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "VecEnumWithPayload" => client_cache + .handle_resubscribe_for_type::(callbacks, new_subs), + "VecEveryPrimitiveStruct" => client_cache + .handle_resubscribe_for_type::( + callbacks, new_subs, + ), + "VecEveryVecStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "VecF32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecF64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecI128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecI16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecI32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecI64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecI8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecIdentity" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecSimpleEnum" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + "VecString" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecU128" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecU16" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecU32" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecU64" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecU8" => client_cache.handle_resubscribe_for_type::(callbacks, new_subs), + "VecUnitStruct" => { + client_cache.handle_resubscribe_for_type::(callbacks, new_subs) + } + _ => spacetimedb_sdk::log::error!("TableRowOperation on unknown table {:?}", table_name), + } + } +} + +/// Connect to a database named `db_name` accessible over the internet at the URI `spacetimedb_uri`. +/// +/// If `credentials` are supplied, they will be passed to the new connection to +/// identify and authenticate the user. Otherwise, a set of `Credentials` will be +/// generated by the server. +pub fn connect(spacetimedb_uri: IntoUri, db_name: &str, credentials: Option) -> Result<()> +where + IntoUri: TryInto, + >::Error: std::error::Error + Send + Sync + 'static, +{ + with_connection_mut(|connection| { + connection.connect(spacetimedb_uri, db_name, credentials, Arc::new(Module))?; + Ok(()) + }) +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_address.rs b/crates/sdk/tests/test-client/src/module_bindings/one_address.rs new file mode 100644 index 00000000000..5940a792bc2 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_address.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneAddress { + pub a: Address, +} + +impl TableType for OneAddress { + const TABLE_NAME: &'static str = "OneAddress"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneAddress { + #[allow(unused)] + pub fn filter_by_a(a: Address) -> TableIter { + Self::filter(|row| row.a == a) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_bool.rs b/crates/sdk/tests/test-client/src/module_bindings/one_bool.rs new file mode 100644 index 00000000000..be8f1e4d768 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_bool.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneBool { + pub b: bool, +} + +impl TableType for OneBool { + const TABLE_NAME: &'static str = "OneBool"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneBool { + #[allow(unused)] + pub fn filter_by_b(b: bool) -> TableIter { + Self::filter(|row| row.b == b) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct.rs new file mode 100644 index 00000000000..88f548caf0b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_byte_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneByteStruct { + pub s: ByteStruct, +} + +impl TableType for OneByteStruct { + const TABLE_NAME: &'static str = "OneByteStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneByteStruct { + #[allow(unused)] + pub fn filter_by_s(s: ByteStruct) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload.rs b/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload.rs new file mode 100644 index 00000000000..10017cc5395 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_enum_with_payload.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::enum_with_payload::EnumWithPayload; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneEnumWithPayload { + pub e: EnumWithPayload, +} + +impl TableType for OneEnumWithPayload { + const TABLE_NAME: &'static str = "OneEnumWithPayload"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneEnumWithPayload { + #[allow(unused)] + pub fn filter_by_e(e: EnumWithPayload) -> TableIter { + Self::filter(|row| row.e == e) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct.rs new file mode 100644 index 00000000000..57c4c2e950c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_every_primitive_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_primitive_struct::EveryPrimitiveStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneEveryPrimitiveStruct { + pub s: EveryPrimitiveStruct, +} + +impl TableType for OneEveryPrimitiveStruct { + const TABLE_NAME: &'static str = "OneEveryPrimitiveStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneEveryPrimitiveStruct { + #[allow(unused)] + pub fn filter_by_s(s: EveryPrimitiveStruct) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct.rs new file mode 100644 index 00000000000..18ac6cceef8 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_every_vec_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_vec_struct::EveryVecStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneEveryVecStruct { + pub s: EveryVecStruct, +} + +impl TableType for OneEveryVecStruct { + const TABLE_NAME: &'static str = "OneEveryVecStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneEveryVecStruct { + #[allow(unused)] + pub fn filter_by_s(s: EveryVecStruct) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_f_32.rs b/crates/sdk/tests/test-client/src/module_bindings/one_f_32.rs new file mode 100644 index 00000000000..6d5598e9f39 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_f_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneF32 { + pub f: f32, +} + +impl TableType for OneF32 { + const TABLE_NAME: &'static str = "OneF32"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneF32 { + #[allow(unused)] + pub fn filter_by_f(f: f32) -> TableIter { + Self::filter(|row| row.f == f) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_f_64.rs b/crates/sdk/tests/test-client/src/module_bindings/one_f_64.rs new file mode 100644 index 00000000000..7a1af0e543d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_f_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneF64 { + pub f: f64, +} + +impl TableType for OneF64 { + const TABLE_NAME: &'static str = "OneF64"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneF64 { + #[allow(unused)] + pub fn filter_by_f(f: f64) -> TableIter { + Self::filter(|row| row.f == f) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_128.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_128.rs new file mode 100644 index 00000000000..5157a435b61 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_128.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneI128 { + pub n: i128, +} + +impl TableType for OneI128 { + const TABLE_NAME: &'static str = "OneI128"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneI128 { + #[allow(unused)] + pub fn filter_by_n(n: i128) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_16.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_16.rs new file mode 100644 index 00000000000..bf029ca2c40 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_16.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneI16 { + pub n: i16, +} + +impl TableType for OneI16 { + const TABLE_NAME: &'static str = "OneI16"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneI16 { + #[allow(unused)] + pub fn filter_by_n(n: i16) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_32.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_32.rs new file mode 100644 index 00000000000..2f855984931 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneI32 { + pub n: i32, +} + +impl TableType for OneI32 { + const TABLE_NAME: &'static str = "OneI32"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneI32 { + #[allow(unused)] + pub fn filter_by_n(n: i32) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_64.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_64.rs new file mode 100644 index 00000000000..1ff19c3a309 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneI64 { + pub n: i64, +} + +impl TableType for OneI64 { + const TABLE_NAME: &'static str = "OneI64"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneI64 { + #[allow(unused)] + pub fn filter_by_n(n: i64) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_i_8.rs b/crates/sdk/tests/test-client/src/module_bindings/one_i_8.rs new file mode 100644 index 00000000000..dc56e872a06 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_i_8.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneI8 { + pub n: i8, +} + +impl TableType for OneI8 { + const TABLE_NAME: &'static str = "OneI8"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneI8 { + #[allow(unused)] + pub fn filter_by_n(n: i8) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_identity.rs b/crates/sdk/tests/test-client/src/module_bindings/one_identity.rs new file mode 100644 index 00000000000..99f2b3db48a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_identity.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneIdentity { + pub i: Identity, +} + +impl TableType for OneIdentity { + const TABLE_NAME: &'static str = "OneIdentity"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneIdentity { + #[allow(unused)] + pub fn filter_by_i(i: Identity) -> TableIter { + Self::filter(|row| row.i == i) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum.rs b/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum.rs new file mode 100644 index 00000000000..2365bd16dab --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_simple_enum.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::simple_enum::SimpleEnum; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneSimpleEnum { + pub e: SimpleEnum, +} + +impl TableType for OneSimpleEnum { + const TABLE_NAME: &'static str = "OneSimpleEnum"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneSimpleEnum { + #[allow(unused)] + pub fn filter_by_e(e: SimpleEnum) -> TableIter { + Self::filter(|row| row.e == e) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_string.rs b/crates/sdk/tests/test-client/src/module_bindings/one_string.rs new file mode 100644 index 00000000000..75811c58e26 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_string.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneString { + pub s: String, +} + +impl TableType for OneString { + const TABLE_NAME: &'static str = "OneString"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneString { + #[allow(unused)] + pub fn filter_by_s(s: String) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_128.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_128.rs new file mode 100644 index 00000000000..3ce0046999b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_128.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneU128 { + pub n: u128, +} + +impl TableType for OneU128 { + const TABLE_NAME: &'static str = "OneU128"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneU128 { + #[allow(unused)] + pub fn filter_by_n(n: u128) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_16.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_16.rs new file mode 100644 index 00000000000..f9008ee3ae2 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_16.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneU16 { + pub n: u16, +} + +impl TableType for OneU16 { + const TABLE_NAME: &'static str = "OneU16"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneU16 { + #[allow(unused)] + pub fn filter_by_n(n: u16) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_32.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_32.rs new file mode 100644 index 00000000000..8ee122033a0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneU32 { + pub n: u32, +} + +impl TableType for OneU32 { + const TABLE_NAME: &'static str = "OneU32"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneU32 { + #[allow(unused)] + pub fn filter_by_n(n: u32) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_64.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_64.rs new file mode 100644 index 00000000000..0894aed3c07 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneU64 { + pub n: u64, +} + +impl TableType for OneU64 { + const TABLE_NAME: &'static str = "OneU64"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneU64 { + #[allow(unused)] + pub fn filter_by_n(n: u64) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_u_8.rs b/crates/sdk/tests/test-client/src/module_bindings/one_u_8.rs new file mode 100644 index 00000000000..2dcdcd5fd57 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_u_8.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneU8 { + pub n: u8, +} + +impl TableType for OneU8 { + const TABLE_NAME: &'static str = "OneU8"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneU8 { + #[allow(unused)] + pub fn filter_by_n(n: u8) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct.rs new file mode 100644 index 00000000000..6e398e7877d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/one_unit_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct OneUnitStruct { + pub s: UnitStruct, +} + +impl TableType for OneUnitStruct { + const TABLE_NAME: &'static str = "OneUnitStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl OneUnitStruct { + #[allow(unused)] + pub fn filter_by_s(s: UnitStruct) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_address.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_address.rs new file mode 100644 index 00000000000..39af2a83619 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_address.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkAddress { + pub a: Address, + pub data: i32, +} + +impl TableType for PkAddress { + const TABLE_NAME: &'static str = "PkAddress"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkAddress { + type PrimaryKey = Address; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.a + } +} + +impl PkAddress { + #[allow(unused)] + pub fn filter_by_a(a: Address) -> Option { + Self::find(|row| row.a == a) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_bool.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_bool.rs new file mode 100644 index 00000000000..404b314aa7d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_bool.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkBool { + pub b: bool, + pub data: i32, +} + +impl TableType for PkBool { + const TABLE_NAME: &'static str = "PkBool"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkBool { + type PrimaryKey = bool; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.b + } +} + +impl PkBool { + #[allow(unused)] + pub fn filter_by_b(b: bool) -> Option { + Self::find(|row| row.b == b) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_128.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_128.rs new file mode 100644 index 00000000000..5f709b9447c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_128.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkI128 { + pub n: i128, + pub data: i32, +} + +impl TableType for PkI128 { + const TABLE_NAME: &'static str = "PkI128"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkI128 { + type PrimaryKey = i128; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkI128 { + #[allow(unused)] + pub fn filter_by_n(n: i128) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_16.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_16.rs new file mode 100644 index 00000000000..f93ccb3b8a6 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_16.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkI16 { + pub n: i16, + pub data: i32, +} + +impl TableType for PkI16 { + const TABLE_NAME: &'static str = "PkI16"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkI16 { + type PrimaryKey = i16; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkI16 { + #[allow(unused)] + pub fn filter_by_n(n: i16) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_32.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_32.rs new file mode 100644 index 00000000000..54c51b19e15 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_32.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkI32 { + pub n: i32, + pub data: i32, +} + +impl TableType for PkI32 { + const TABLE_NAME: &'static str = "PkI32"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkI32 { + type PrimaryKey = i32; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkI32 { + #[allow(unused)] + pub fn filter_by_n(n: i32) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_64.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_64.rs new file mode 100644 index 00000000000..3edfe88f1b0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_64.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkI64 { + pub n: i64, + pub data: i32, +} + +impl TableType for PkI64 { + const TABLE_NAME: &'static str = "PkI64"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkI64 { + type PrimaryKey = i64; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkI64 { + #[allow(unused)] + pub fn filter_by_n(n: i64) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_i_8.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_i_8.rs new file mode 100644 index 00000000000..07f639d3e76 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_i_8.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkI8 { + pub n: i8, + pub data: i32, +} + +impl TableType for PkI8 { + const TABLE_NAME: &'static str = "PkI8"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkI8 { + type PrimaryKey = i8; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkI8 { + #[allow(unused)] + pub fn filter_by_n(n: i8) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_identity.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_identity.rs new file mode 100644 index 00000000000..11e100c4850 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_identity.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkIdentity { + pub i: Identity, + pub data: i32, +} + +impl TableType for PkIdentity { + const TABLE_NAME: &'static str = "PkIdentity"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkIdentity { + type PrimaryKey = Identity; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.i + } +} + +impl PkIdentity { + #[allow(unused)] + pub fn filter_by_i(i: Identity) -> Option { + Self::find(|row| row.i == i) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_string.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_string.rs new file mode 100644 index 00000000000..1aad611a63f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_string.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkString { + pub s: String, + pub data: i32, +} + +impl TableType for PkString { + const TABLE_NAME: &'static str = "PkString"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkString { + type PrimaryKey = String; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.s + } +} + +impl PkString { + #[allow(unused)] + pub fn filter_by_s(s: String) -> Option { + Self::find(|row| row.s == s) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_128.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_128.rs new file mode 100644 index 00000000000..5bbf944a310 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_128.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkU128 { + pub n: u128, + pub data: i32, +} + +impl TableType for PkU128 { + const TABLE_NAME: &'static str = "PkU128"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkU128 { + type PrimaryKey = u128; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkU128 { + #[allow(unused)] + pub fn filter_by_n(n: u128) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_16.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_16.rs new file mode 100644 index 00000000000..bff27d2ec33 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_16.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkU16 { + pub n: u16, + pub data: i32, +} + +impl TableType for PkU16 { + const TABLE_NAME: &'static str = "PkU16"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkU16 { + type PrimaryKey = u16; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkU16 { + #[allow(unused)] + pub fn filter_by_n(n: u16) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_32.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_32.rs new file mode 100644 index 00000000000..f816a990fef --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_32.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkU32 { + pub n: u32, + pub data: i32, +} + +impl TableType for PkU32 { + const TABLE_NAME: &'static str = "PkU32"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkU32 { + type PrimaryKey = u32; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkU32 { + #[allow(unused)] + pub fn filter_by_n(n: u32) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_64.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_64.rs new file mode 100644 index 00000000000..ba7f930151e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_64.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkU64 { + pub n: u64, + pub data: i32, +} + +impl TableType for PkU64 { + const TABLE_NAME: &'static str = "PkU64"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkU64 { + type PrimaryKey = u64; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkU64 { + #[allow(unused)] + pub fn filter_by_n(n: u64) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/pk_u_8.rs b/crates/sdk/tests/test-client/src/module_bindings/pk_u_8.rs new file mode 100644 index 00000000000..b73d003f530 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/pk_u_8.rs @@ -0,0 +1,42 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct PkU8 { + pub n: u8, + pub data: i32, +} + +impl TableType for PkU8 { + const TABLE_NAME: &'static str = "PkU8"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableWithPrimaryKey for PkU8 { + type PrimaryKey = u8; + fn primary_key(&self) -> &Self::PrimaryKey { + &self.n + } +} + +impl PkU8 { + #[allow(unused)] + pub fn filter_by_n(n: u8) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/simple_enum.rs b/crates/sdk/tests/test-client/src/module_bindings/simple_enum.rs new file mode 100644 index 00000000000..2e6080e23a2 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/simple_enum.rs @@ -0,0 +1,22 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub enum SimpleEnum { + Zero, + + One, + + Two, +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/table_holds_table.rs b/crates/sdk/tests/test-client/src/module_bindings/table_holds_table.rs new file mode 100644 index 00000000000..7ecd24f4d7e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/table_holds_table.rs @@ -0,0 +1,37 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::one_u_8::OneU8; +use super::vec_u_8::VecU8; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct TableHoldsTable { + pub a: OneU8, + pub b: VecU8, +} + +impl TableType for TableHoldsTable { + const TABLE_NAME: &'static str = "TableHoldsTable"; + type ReducerEvent = super::ReducerEvent; +} + +impl TableHoldsTable { + #[allow(unused)] + pub fn filter_by_a(a: OneU8) -> TableIter { + Self::filter(|row| row.a == a) + } + #[allow(unused)] + pub fn filter_by_b(b: VecU8) -> TableIter { + Self::filter(|row| row.b == b) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_address.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_address.rs new file mode 100644 index 00000000000..e1dca2ec050 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_address.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueAddress { + pub a: Address, + pub data: i32, +} + +impl TableType for UniqueAddress { + const TABLE_NAME: &'static str = "UniqueAddress"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueAddress { + #[allow(unused)] + pub fn filter_by_a(a: Address) -> Option { + Self::find(|row| row.a == a) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_bool.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_bool.rs new file mode 100644 index 00000000000..ddb1cb406b9 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_bool.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueBool { + pub b: bool, + pub data: i32, +} + +impl TableType for UniqueBool { + const TABLE_NAME: &'static str = "UniqueBool"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueBool { + #[allow(unused)] + pub fn filter_by_b(b: bool) -> Option { + Self::find(|row| row.b == b) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_128.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_128.rs new file mode 100644 index 00000000000..f8d7853d50e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_128.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueI128 { + pub n: i128, + pub data: i32, +} + +impl TableType for UniqueI128 { + const TABLE_NAME: &'static str = "UniqueI128"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueI128 { + #[allow(unused)] + pub fn filter_by_n(n: i128) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_16.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_16.rs new file mode 100644 index 00000000000..c2f959b3887 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_16.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueI16 { + pub n: i16, + pub data: i32, +} + +impl TableType for UniqueI16 { + const TABLE_NAME: &'static str = "UniqueI16"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueI16 { + #[allow(unused)] + pub fn filter_by_n(n: i16) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_32.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_32.rs new file mode 100644 index 00000000000..76813a911e5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_32.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueI32 { + pub n: i32, + pub data: i32, +} + +impl TableType for UniqueI32 { + const TABLE_NAME: &'static str = "UniqueI32"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueI32 { + #[allow(unused)] + pub fn filter_by_n(n: i32) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_64.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_64.rs new file mode 100644 index 00000000000..e5489ec803b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_64.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueI64 { + pub n: i64, + pub data: i32, +} + +impl TableType for UniqueI64 { + const TABLE_NAME: &'static str = "UniqueI64"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueI64 { + #[allow(unused)] + pub fn filter_by_n(n: i64) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_i_8.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_i_8.rs new file mode 100644 index 00000000000..2e8c58a0300 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_i_8.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueI8 { + pub n: i8, + pub data: i32, +} + +impl TableType for UniqueI8 { + const TABLE_NAME: &'static str = "UniqueI8"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueI8 { + #[allow(unused)] + pub fn filter_by_n(n: i8) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_identity.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_identity.rs new file mode 100644 index 00000000000..857dd3b1702 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_identity.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueIdentity { + pub i: Identity, + pub data: i32, +} + +impl TableType for UniqueIdentity { + const TABLE_NAME: &'static str = "UniqueIdentity"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueIdentity { + #[allow(unused)] + pub fn filter_by_i(i: Identity) -> Option { + Self::find(|row| row.i == i) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_string.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_string.rs new file mode 100644 index 00000000000..a7e85bc00d9 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_string.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueString { + pub s: String, + pub data: i32, +} + +impl TableType for UniqueString { + const TABLE_NAME: &'static str = "UniqueString"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueString { + #[allow(unused)] + pub fn filter_by_s(s: String) -> Option { + Self::find(|row| row.s == s) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_128.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_128.rs new file mode 100644 index 00000000000..343fef29a10 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_128.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueU128 { + pub n: u128, + pub data: i32, +} + +impl TableType for UniqueU128 { + const TABLE_NAME: &'static str = "UniqueU128"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueU128 { + #[allow(unused)] + pub fn filter_by_n(n: u128) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_16.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_16.rs new file mode 100644 index 00000000000..b08d4d9d395 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_16.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueU16 { + pub n: u16, + pub data: i32, +} + +impl TableType for UniqueU16 { + const TABLE_NAME: &'static str = "UniqueU16"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueU16 { + #[allow(unused)] + pub fn filter_by_n(n: u16) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_32.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_32.rs new file mode 100644 index 00000000000..65a8c3e8f6a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_32.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueU32 { + pub n: u32, + pub data: i32, +} + +impl TableType for UniqueU32 { + const TABLE_NAME: &'static str = "UniqueU32"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueU32 { + #[allow(unused)] + pub fn filter_by_n(n: u32) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_64.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_64.rs new file mode 100644 index 00000000000..fdb4fd9657c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_64.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueU64 { + pub n: u64, + pub data: i32, +} + +impl TableType for UniqueU64 { + const TABLE_NAME: &'static str = "UniqueU64"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueU64 { + #[allow(unused)] + pub fn filter_by_n(n: u64) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unique_u_8.rs b/crates/sdk/tests/test-client/src/module_bindings/unique_u_8.rs new file mode 100644 index 00000000000..f36f21ad22e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unique_u_8.rs @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UniqueU8 { + pub n: u8, + pub data: i32, +} + +impl TableType for UniqueU8 { + const TABLE_NAME: &'static str = "UniqueU8"; + type ReducerEvent = super::ReducerEvent; +} + +impl UniqueU8 { + #[allow(unused)] + pub fn filter_by_n(n: u8) -> Option { + Self::find(|row| row.n == n) + } + #[allow(unused)] + pub fn filter_by_data(data: i32) -> TableIter { + Self::filter(|row| row.data == data) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/unit_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/unit_struct.rs new file mode 100644 index 00000000000..50ad8662331 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/unit_struct.rs @@ -0,0 +1,16 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UnitStruct {} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_address_reducer.rs new file mode 100644 index 00000000000..cc832483368 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_address_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkAddressArgs { + pub a: Address, + pub data: i32, +} + +impl Reducer for UpdatePkAddressArgs { + const REDUCER_NAME: &'static str = "update_pk_address"; +} + +#[allow(unused)] +pub fn update_pk_address(a: Address, data: i32) { + UpdatePkAddressArgs { a, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_address(id: ReducerCallbackId) { + UpdatePkAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_bool_reducer.rs new file mode 100644 index 00000000000..cd2395a4f88 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_bool_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkBoolArgs { + pub b: bool, + pub data: i32, +} + +impl Reducer for UpdatePkBoolArgs { + const REDUCER_NAME: &'static str = "update_pk_bool"; +} + +#[allow(unused)] +pub fn update_pk_bool(b: bool, data: i32) { + UpdatePkBoolArgs { b, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_bool(id: ReducerCallbackId) { + UpdatePkBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_128_reducer.rs new file mode 100644 index 00000000000..9a6198e415d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkI128Args { + pub n: i128, + pub data: i32, +} + +impl Reducer for UpdatePkI128Args { + const REDUCER_NAME: &'static str = "update_pk_i128"; +} + +#[allow(unused)] +pub fn update_pk_i_128(n: i128, data: i32) { + UpdatePkI128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_i_128(id: ReducerCallbackId) { + UpdatePkI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_16_reducer.rs new file mode 100644 index 00000000000..c576ee185a4 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkI16Args { + pub n: i16, + pub data: i32, +} + +impl Reducer for UpdatePkI16Args { + const REDUCER_NAME: &'static str = "update_pk_i16"; +} + +#[allow(unused)] +pub fn update_pk_i_16(n: i16, data: i32) { + UpdatePkI16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_i_16(id: ReducerCallbackId) { + UpdatePkI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_32_reducer.rs new file mode 100644 index 00000000000..89daf3ed722 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkI32Args { + pub n: i32, + pub data: i32, +} + +impl Reducer for UpdatePkI32Args { + const REDUCER_NAME: &'static str = "update_pk_i32"; +} + +#[allow(unused)] +pub fn update_pk_i_32(n: i32, data: i32) { + UpdatePkI32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_i_32(id: ReducerCallbackId) { + UpdatePkI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_64_reducer.rs new file mode 100644 index 00000000000..c8ac9af446f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkI64Args { + pub n: i64, + pub data: i32, +} + +impl Reducer for UpdatePkI64Args { + const REDUCER_NAME: &'static str = "update_pk_i64"; +} + +#[allow(unused)] +pub fn update_pk_i_64(n: i64, data: i32) { + UpdatePkI64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_i_64(id: ReducerCallbackId) { + UpdatePkI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_8_reducer.rs new file mode 100644 index 00000000000..7c57c5f8b5f --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkI8Args { + pub n: i8, + pub data: i32, +} + +impl Reducer for UpdatePkI8Args { + const REDUCER_NAME: &'static str = "update_pk_i8"; +} + +#[allow(unused)] +pub fn update_pk_i_8(n: i8, data: i32) { + UpdatePkI8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_i_8(id: ReducerCallbackId) { + UpdatePkI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_identity_reducer.rs new file mode 100644 index 00000000000..dc35d53b597 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_identity_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkIdentityArgs { + pub i: Identity, + pub data: i32, +} + +impl Reducer for UpdatePkIdentityArgs { + const REDUCER_NAME: &'static str = "update_pk_identity"; +} + +#[allow(unused)] +pub fn update_pk_identity(i: Identity, data: i32) { + UpdatePkIdentityArgs { i, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_identity(id: ReducerCallbackId) { + UpdatePkIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_string_reducer.rs new file mode 100644 index 00000000000..c4ee4b1abe0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_string_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkStringArgs { + pub s: String, + pub data: i32, +} + +impl Reducer for UpdatePkStringArgs { + const REDUCER_NAME: &'static str = "update_pk_string"; +} + +#[allow(unused)] +pub fn update_pk_string(s: String, data: i32) { + UpdatePkStringArgs { s, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_string(id: ReducerCallbackId) { + UpdatePkStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_128_reducer.rs new file mode 100644 index 00000000000..366cba20e31 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkU128Args { + pub n: u128, + pub data: i32, +} + +impl Reducer for UpdatePkU128Args { + const REDUCER_NAME: &'static str = "update_pk_u128"; +} + +#[allow(unused)] +pub fn update_pk_u_128(n: u128, data: i32) { + UpdatePkU128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_u_128(id: ReducerCallbackId) { + UpdatePkU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_16_reducer.rs new file mode 100644 index 00000000000..ad92e05661c --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkU16Args { + pub n: u16, + pub data: i32, +} + +impl Reducer for UpdatePkU16Args { + const REDUCER_NAME: &'static str = "update_pk_u16"; +} + +#[allow(unused)] +pub fn update_pk_u_16(n: u16, data: i32) { + UpdatePkU16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_u_16(id: ReducerCallbackId) { + UpdatePkU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_32_reducer.rs new file mode 100644 index 00000000000..fa8713c6d6a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkU32Args { + pub n: u32, + pub data: i32, +} + +impl Reducer for UpdatePkU32Args { + const REDUCER_NAME: &'static str = "update_pk_u32"; +} + +#[allow(unused)] +pub fn update_pk_u_32(n: u32, data: i32) { + UpdatePkU32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_u_32(id: ReducerCallbackId) { + UpdatePkU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_64_reducer.rs new file mode 100644 index 00000000000..731b440b3f3 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkU64Args { + pub n: u64, + pub data: i32, +} + +impl Reducer for UpdatePkU64Args { + const REDUCER_NAME: &'static str = "update_pk_u64"; +} + +#[allow(unused)] +pub fn update_pk_u_64(n: u64, data: i32) { + UpdatePkU64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_u_64(id: ReducerCallbackId) { + UpdatePkU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_8_reducer.rs new file mode 100644 index 00000000000..126260c9b10 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdatePkU8Args { + pub n: u8, + pub data: i32, +} + +impl Reducer for UpdatePkU8Args { + const REDUCER_NAME: &'static str = "update_pk_u8"; +} + +#[allow(unused)] +pub fn update_pk_u_8(n: u8, data: i32) { + UpdatePkU8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_pk_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_pk_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdatePkU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdatePkU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_pk_u_8(id: ReducerCallbackId) { + UpdatePkU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_address_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_address_reducer.rs new file mode 100644 index 00000000000..195b30a4d00 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_address_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueAddressArgs { + pub a: Address, + pub data: i32, +} + +impl Reducer for UpdateUniqueAddressArgs { + const REDUCER_NAME: &'static str = "update_unique_address"; +} + +#[allow(unused)] +pub fn update_unique_address(a: Address, data: i32) { + UpdateUniqueAddressArgs { a, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_address( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueAddressArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_address( + __callback: impl FnOnce(&Identity, Option
, &Status, &Address, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueAddressArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueAddressArgs { a, data } = __args; + __callback(__identity, __addr, __status, a, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_address(id: ReducerCallbackId) { + UpdateUniqueAddressArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_bool_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_bool_reducer.rs new file mode 100644 index 00000000000..d58d4b8a02a --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_bool_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueBoolArgs { + pub b: bool, + pub data: i32, +} + +impl Reducer for UpdateUniqueBoolArgs { + const REDUCER_NAME: &'static str = "update_unique_bool"; +} + +#[allow(unused)] +pub fn update_unique_bool(b: bool, data: i32) { + UpdateUniqueBoolArgs { b, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_bool( + mut __callback: impl FnMut(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueBoolArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_bool( + __callback: impl FnOnce(&Identity, Option
, &Status, &bool, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueBoolArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueBoolArgs { b, data } = __args; + __callback(__identity, __addr, __status, b, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_bool(id: ReducerCallbackId) { + UpdateUniqueBoolArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_128_reducer.rs new file mode 100644 index 00000000000..8bf28ce8dfc --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueI128Args { + pub n: i128, + pub data: i32, +} + +impl Reducer for UpdateUniqueI128Args { + const REDUCER_NAME: &'static str = "update_unique_i128"; +} + +#[allow(unused)] +pub fn update_unique_i_128(n: i128, data: i32) { + UpdateUniqueI128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_i_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI128Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_i_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &i128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_i_128(id: ReducerCallbackId) { + UpdateUniqueI128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_16_reducer.rs new file mode 100644 index 00000000000..3a77c23ebb0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueI16Args { + pub n: i16, + pub data: i32, +} + +impl Reducer for UpdateUniqueI16Args { + const REDUCER_NAME: &'static str = "update_unique_i16"; +} + +#[allow(unused)] +pub fn update_unique_i_16(n: i16, data: i32) { + UpdateUniqueI16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_i_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI16Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_i_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &i16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_i_16(id: ReducerCallbackId) { + UpdateUniqueI16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_32_reducer.rs new file mode 100644 index 00000000000..870b0241ce5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueI32Args { + pub n: i32, + pub data: i32, +} + +impl Reducer for UpdateUniqueI32Args { + const REDUCER_NAME: &'static str = "update_unique_i32"; +} + +#[allow(unused)] +pub fn update_unique_i_32(n: i32, data: i32) { + UpdateUniqueI32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_i_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI32Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_i_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &i32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_i_32(id: ReducerCallbackId) { + UpdateUniqueI32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_64_reducer.rs new file mode 100644 index 00000000000..b670dd6fd54 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueI64Args { + pub n: i64, + pub data: i32, +} + +impl Reducer for UpdateUniqueI64Args { + const REDUCER_NAME: &'static str = "update_unique_i64"; +} + +#[allow(unused)] +pub fn update_unique_i_64(n: i64, data: i32) { + UpdateUniqueI64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_i_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI64Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_i_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &i64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_i_64(id: ReducerCallbackId) { + UpdateUniqueI64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_8_reducer.rs new file mode 100644 index 00000000000..d0bf204e52d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueI8Args { + pub n: i8, + pub data: i32, +} + +impl Reducer for UpdateUniqueI8Args { + const REDUCER_NAME: &'static str = "update_unique_i8"; +} + +#[allow(unused)] +pub fn update_unique_i_8(n: i8, data: i32) { + UpdateUniqueI8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_i_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI8Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_i_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &i8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueI8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueI8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_i_8(id: ReducerCallbackId) { + UpdateUniqueI8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_identity_reducer.rs new file mode 100644 index 00000000000..54689271dac --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_identity_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueIdentityArgs { + pub i: Identity, + pub data: i32, +} + +impl Reducer for UpdateUniqueIdentityArgs { + const REDUCER_NAME: &'static str = "update_unique_identity"; +} + +#[allow(unused)] +pub fn update_unique_identity(i: Identity, data: i32) { + UpdateUniqueIdentityArgs { i, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_identity( + mut __callback: impl FnMut(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueIdentityArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_identity( + __callback: impl FnOnce(&Identity, Option
, &Status, &Identity, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueIdentityArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueIdentityArgs { i, data } = __args; + __callback(__identity, __addr, __status, i, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_identity(id: ReducerCallbackId) { + UpdateUniqueIdentityArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_string_reducer.rs new file mode 100644 index 00000000000..1deb571b817 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_string_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueStringArgs { + pub s: String, + pub data: i32, +} + +impl Reducer for UpdateUniqueStringArgs { + const REDUCER_NAME: &'static str = "update_unique_string"; +} + +#[allow(unused)] +pub fn update_unique_string(s: String, data: i32) { + UpdateUniqueStringArgs { s, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_string( + mut __callback: impl FnMut(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueStringArgs::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_string( + __callback: impl FnOnce(&Identity, Option
, &Status, &String, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueStringArgs::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueStringArgs { s, data } = __args; + __callback(__identity, __addr, __status, s, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_string(id: ReducerCallbackId) { + UpdateUniqueStringArgs::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_128_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_128_reducer.rs new file mode 100644 index 00000000000..9df0078c4ce --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_128_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueU128Args { + pub n: u128, + pub data: i32, +} + +impl Reducer for UpdateUniqueU128Args { + const REDUCER_NAME: &'static str = "update_unique_u128"; +} + +#[allow(unused)] +pub fn update_unique_u_128(n: u128, data: i32) { + UpdateUniqueU128Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_u_128( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU128Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_u_128( + __callback: impl FnOnce(&Identity, Option
, &Status, &u128, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU128Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU128Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_u_128(id: ReducerCallbackId) { + UpdateUniqueU128Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_16_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_16_reducer.rs new file mode 100644 index 00000000000..930191683d0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_16_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueU16Args { + pub n: u16, + pub data: i32, +} + +impl Reducer for UpdateUniqueU16Args { + const REDUCER_NAME: &'static str = "update_unique_u16"; +} + +#[allow(unused)] +pub fn update_unique_u_16(n: u16, data: i32) { + UpdateUniqueU16Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_u_16( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU16Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_u_16( + __callback: impl FnOnce(&Identity, Option
, &Status, &u16, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU16Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU16Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_u_16(id: ReducerCallbackId) { + UpdateUniqueU16Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_32_reducer.rs new file mode 100644 index 00000000000..4504d16bc56 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_32_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueU32Args { + pub n: u32, + pub data: i32, +} + +impl Reducer for UpdateUniqueU32Args { + const REDUCER_NAME: &'static str = "update_unique_u32"; +} + +#[allow(unused)] +pub fn update_unique_u_32(n: u32, data: i32) { + UpdateUniqueU32Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_u_32( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU32Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_u_32( + __callback: impl FnOnce(&Identity, Option
, &Status, &u32, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU32Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU32Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_u_32(id: ReducerCallbackId) { + UpdateUniqueU32Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_64_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_64_reducer.rs new file mode 100644 index 00000000000..b00be3c7c49 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_64_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueU64Args { + pub n: u64, + pub data: i32, +} + +impl Reducer for UpdateUniqueU64Args { + const REDUCER_NAME: &'static str = "update_unique_u64"; +} + +#[allow(unused)] +pub fn update_unique_u_64(n: u64, data: i32) { + UpdateUniqueU64Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_u_64( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU64Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_u_64( + __callback: impl FnOnce(&Identity, Option
, &Status, &u64, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU64Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU64Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_u_64(id: ReducerCallbackId) { + UpdateUniqueU64Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_8_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_8_reducer.rs new file mode 100644 index 00000000000..7f74a15c398 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_8_reducer.rs @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct UpdateUniqueU8Args { + pub n: u8, + pub data: i32, +} + +impl Reducer for UpdateUniqueU8Args { + const REDUCER_NAME: &'static str = "update_unique_u8"; +} + +#[allow(unused)] +pub fn update_unique_u_8(n: u8, data: i32) { + UpdateUniqueU8Args { n, data }.invoke(); +} + +#[allow(unused)] +pub fn on_update_unique_u_8( + mut __callback: impl FnMut(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU8Args::on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn once_on_update_unique_u_8( + __callback: impl FnOnce(&Identity, Option
, &Status, &u8, &i32) + Send + 'static, +) -> ReducerCallbackId { + UpdateUniqueU8Args::once_on_reducer(move |__identity, __addr, __status, __args| { + let UpdateUniqueU8Args { n, data } = __args; + __callback(__identity, __addr, __status, n, data); + }) +} + +#[allow(unused)] +pub fn remove_on_update_unique_u_8(id: ReducerCallbackId) { + UpdateUniqueU8Args::remove_on_reducer(id); +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_address.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_address.rs new file mode 100644 index 00000000000..b8b568ee4a9 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_address.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecAddress { + pub a: Vec
, +} + +impl TableType for VecAddress { + const TABLE_NAME: &'static str = "VecAddress"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecAddress { + #[allow(unused)] + pub fn filter_by_a(a: Vec
) -> TableIter { + Self::filter(|row| row.a == a) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_bool.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_bool.rs new file mode 100644 index 00000000000..24b18a0282d --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_bool.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecBool { + pub b: Vec, +} + +impl TableType for VecBool { + const TABLE_NAME: &'static str = "VecBool"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecBool { + #[allow(unused)] + pub fn filter_by_b(b: Vec) -> TableIter { + Self::filter(|row| row.b == b) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct.rs new file mode 100644 index 00000000000..bb10fd82122 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_byte_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::byte_struct::ByteStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecByteStruct { + pub s: Vec, +} + +impl TableType for VecByteStruct { + const TABLE_NAME: &'static str = "VecByteStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecByteStruct { + #[allow(unused)] + pub fn filter_by_s(s: Vec) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload.rs new file mode 100644 index 00000000000..4e128c5dd06 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_enum_with_payload.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::enum_with_payload::EnumWithPayload; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecEnumWithPayload { + pub e: Vec, +} + +impl TableType for VecEnumWithPayload { + const TABLE_NAME: &'static str = "VecEnumWithPayload"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecEnumWithPayload { + #[allow(unused)] + pub fn filter_by_e(e: Vec) -> TableIter { + Self::filter(|row| row.e == e) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct.rs new file mode 100644 index 00000000000..6aacac44e7b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_every_primitive_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_primitive_struct::EveryPrimitiveStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecEveryPrimitiveStruct { + pub s: Vec, +} + +impl TableType for VecEveryPrimitiveStruct { + const TABLE_NAME: &'static str = "VecEveryPrimitiveStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecEveryPrimitiveStruct { + #[allow(unused)] + pub fn filter_by_s(s: Vec) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct.rs new file mode 100644 index 00000000000..dd2c2b5cfd3 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_every_vec_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::every_vec_struct::EveryVecStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecEveryVecStruct { + pub s: Vec, +} + +impl TableType for VecEveryVecStruct { + const TABLE_NAME: &'static str = "VecEveryVecStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecEveryVecStruct { + #[allow(unused)] + pub fn filter_by_s(s: Vec) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_f_32.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_f_32.rs new file mode 100644 index 00000000000..039528387ed --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_f_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecF32 { + pub f: Vec, +} + +impl TableType for VecF32 { + const TABLE_NAME: &'static str = "VecF32"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecF32 { + #[allow(unused)] + pub fn filter_by_f(f: Vec) -> TableIter { + Self::filter(|row| row.f == f) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_f_64.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_f_64.rs new file mode 100644 index 00000000000..488ecb7f426 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_f_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecF64 { + pub f: Vec, +} + +impl TableType for VecF64 { + const TABLE_NAME: &'static str = "VecF64"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecF64 { + #[allow(unused)] + pub fn filter_by_f(f: Vec) -> TableIter { + Self::filter(|row| row.f == f) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_128.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_128.rs new file mode 100644 index 00000000000..044eeff3f77 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_128.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecI128 { + pub n: Vec, +} + +impl TableType for VecI128 { + const TABLE_NAME: &'static str = "VecI128"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecI128 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_16.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_16.rs new file mode 100644 index 00000000000..86e4c4bbcb5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_16.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecI16 { + pub n: Vec, +} + +impl TableType for VecI16 { + const TABLE_NAME: &'static str = "VecI16"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecI16 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_32.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_32.rs new file mode 100644 index 00000000000..e9ddde6c5f5 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecI32 { + pub n: Vec, +} + +impl TableType for VecI32 { + const TABLE_NAME: &'static str = "VecI32"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecI32 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_64.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_64.rs new file mode 100644 index 00000000000..4193a0c8416 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecI64 { + pub n: Vec, +} + +impl TableType for VecI64 { + const TABLE_NAME: &'static str = "VecI64"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecI64 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_i_8.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_i_8.rs new file mode 100644 index 00000000000..a3df8b0716b --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_i_8.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecI8 { + pub n: Vec, +} + +impl TableType for VecI8 { + const TABLE_NAME: &'static str = "VecI8"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecI8 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_identity.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_identity.rs new file mode 100644 index 00000000000..40920ec06f7 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_identity.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecIdentity { + pub i: Vec, +} + +impl TableType for VecIdentity { + const TABLE_NAME: &'static str = "VecIdentity"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecIdentity { + #[allow(unused)] + pub fn filter_by_i(i: Vec) -> TableIter { + Self::filter(|row| row.i == i) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum.rs new file mode 100644 index 00000000000..ec871a26dec --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_simple_enum.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::simple_enum::SimpleEnum; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecSimpleEnum { + pub e: Vec, +} + +impl TableType for VecSimpleEnum { + const TABLE_NAME: &'static str = "VecSimpleEnum"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecSimpleEnum { + #[allow(unused)] + pub fn filter_by_e(e: Vec) -> TableIter { + Self::filter(|row| row.e == e) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_string.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_string.rs new file mode 100644 index 00000000000..e8ab3517606 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_string.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecString { + pub s: Vec, +} + +impl TableType for VecString { + const TABLE_NAME: &'static str = "VecString"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecString { + #[allow(unused)] + pub fn filter_by_s(s: Vec) -> TableIter { + Self::filter(|row| row.s == s) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_128.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_128.rs new file mode 100644 index 00000000000..876946f33d0 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_128.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecU128 { + pub n: Vec, +} + +impl TableType for VecU128 { + const TABLE_NAME: &'static str = "VecU128"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecU128 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_16.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_16.rs new file mode 100644 index 00000000000..f7c6bfe9429 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_16.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecU16 { + pub n: Vec, +} + +impl TableType for VecU16 { + const TABLE_NAME: &'static str = "VecU16"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecU16 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_32.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_32.rs new file mode 100644 index 00000000000..4d96197087e --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_32.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecU32 { + pub n: Vec, +} + +impl TableType for VecU32 { + const TABLE_NAME: &'static str = "VecU32"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecU32 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_64.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_64.rs new file mode 100644 index 00000000000..4fdc260cbfa --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_64.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecU64 { + pub n: Vec, +} + +impl TableType for VecU64 { + const TABLE_NAME: &'static str = "VecU64"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecU64 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_u_8.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_u_8.rs new file mode 100644 index 00000000000..3572788ee60 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_u_8.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecU8 { + pub n: Vec, +} + +impl TableType for VecU8 { + const TABLE_NAME: &'static str = "VecU8"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecU8 { + #[allow(unused)] + pub fn filter_by_n(n: Vec) -> TableIter { + Self::filter(|row| row.n == n) + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct.rs b/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct.rs new file mode 100644 index 00000000000..3f85482cd64 --- /dev/null +++ b/crates/sdk/tests/test-client/src/module_bindings/vec_unit_struct.rs @@ -0,0 +1,31 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN RUST INSTEAD. + +use super::unit_struct::UnitStruct; +#[allow(unused)] +use spacetimedb_sdk::{ + anyhow::{anyhow, Result}, + identity::Identity, + reducer::{Reducer, ReducerCallbackId, Status}, + sats::{de::Deserialize, ser::Serialize}, + spacetimedb_lib, + table::{TableIter, TableType, TableWithPrimaryKey}, + Address, +}; + +#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] +pub struct VecUnitStruct { + pub s: Vec, +} + +impl TableType for VecUnitStruct { + const TABLE_NAME: &'static str = "VecUnitStruct"; + type ReducerEvent = super::ReducerEvent; +} + +impl VecUnitStruct { + #[allow(unused)] + pub fn filter_by_s(s: Vec) -> TableIter { + Self::filter(|row| row.s == s) + } +}