From 212e049b29f5cc43130443367fc5ecb98de04a3a Mon Sep 17 00:00:00 2001 From: James Gilles Date: Thu, 31 Oct 2024 16:44:20 -0400 Subject: [PATCH 01/12] Be more careful about endianness with Identity and Address --- crates/bindings/src/rt.rs | 12 +- crates/client-api/src/routes/identity.rs | 2 +- .../core/src/host/wasmtime/wasmtime_module.rs | 2 +- crates/lib/proptest-regressions/identity.txt | 7 ++ crates/lib/src/address.rs | 82 +++++++++++-- crates/lib/src/identity.rs | 114 ++++++++++++++++-- crates/standalone/src/control_db.rs | 12 +- 7 files changed, 200 insertions(+), 31 deletions(-) create mode 100644 crates/lib/proptest-regressions/identity.txt diff --git a/crates/bindings/src/rt.rs b/crates/bindings/src/rt.rs index 1d9d53111a8..5618823accd 100644 --- a/crates/bindings/src/rt.rs +++ b/crates/bindings/src/rt.rs @@ -437,17 +437,21 @@ extern "C" fn __describe_module__(description: BytesSink) { /// when the `sender` calls the reducer identified by `id` at `timestamp` with `args`. /// /// The `sender_{0-3}` are the pieces of a `[u8; 32]` (`u256`) representing the sender's `Identity`. -/// They are encoded as follows (assuming `identity.identity_bytes: [u8; 32]`): +/// They are encoded as follows (assuming `identity.to_byte_array(): [u8; 32]`): /// - `sender_0` contains bytes `[0 ..8 ]`. /// - `sender_1` contains bytes `[8 ..16]`. /// - `sender_2` contains bytes `[16..24]`. /// - `sender_3` contains bytes `[24..32]`. /// +/// Note that `to_byte_array` uses LITTLE-ENDIAN order! This matches most host systems. +/// /// The `address_{0-1}` are the pieces of a `[u8; 16]` (`u128`) representing the callers's `Address`. -/// They are encoded as follows (assuming `address.__address__: u128`): +/// They are encoded as follows (assuming `address.as_byte_array(): [u8; 16]`): /// - `address_0` contains bytes `[0 ..8 ]`. /// - `address_1` contains bytes `[8 ..16]`. /// +/// Again, note that `to_byte_array` uses LITTLE-ENDIAN order! This matches most host systems. +/// /// The `args` is a `BytesSource`, registered on the host side, /// which can be read with `bytes_source_read`. /// The contents of the buffer are the BSATN-encoding of the arguments to the reducer. @@ -475,13 +479,13 @@ extern "C" fn __call_reducer__( // Piece together `sender_i` into an `Identity`. let sender = [sender_0, sender_1, sender_2, sender_3]; let sender: [u8; 32] = bytemuck::must_cast(sender); - let sender = Identity::from_byte_array(sender); + let sender = Identity::from_byte_array(sender); // The LITTLE-ENDIAN constructor. // Piece together `address_i` into an `Address`. // The all-zeros `address` (`Address::__DUMMY`) is interpreted as `None`. let address = [address_0, address_1]; let address: [u8; 16] = bytemuck::must_cast(address); - let address = Address::from_byte_array(address); + let address = Address::from_byte_array(address); // The LITTLE-ENDIAN constructor. let address = (address != Address::__DUMMY).then_some(address); // Assemble the `ReducerContext`. diff --git a/crates/client-api/src/routes/identity.rs b/crates/client-api/src/routes/identity.rs index 8ab1e8c4a71..9169a8fd3d0 100644 --- a/crates/client-api/src/routes/identity.rs +++ b/crates/client-api/src/routes/identity.rs @@ -58,7 +58,7 @@ impl IdentityForUrl { impl<'de> serde::Deserialize<'de> for IdentityForUrl { fn deserialize>(de: D) -> Result { - <_>::deserialize(de).map(|DeserializeWrapper(b)| IdentityForUrl(Identity::from_byte_array(b))) + <_>::deserialize(de).map(|DeserializeWrapper(b)| IdentityForUrl(Identity::from_be_byte_array(b))) } } diff --git a/crates/core/src/host/wasmtime/wasmtime_module.rs b/crates/core/src/host/wasmtime/wasmtime_module.rs index 888693df989..1b539d2e8ad 100644 --- a/crates/core/src/host/wasmtime/wasmtime_module.rs +++ b/crates/core/src/host/wasmtime/wasmtime_module.rs @@ -193,7 +193,7 @@ impl module_host_actor::WasmInstance for WasmtimeInstance { // otherwise, we'd return something like `used: i128::MAX - u64::MAX`, which is inaccurate. set_store_fuel(store, budget.into()); - // Prepare sender identity and address. + // Prepare sender identity and address, as LITTLE-ENDIAN byte arrays. let [sender_0, sender_1, sender_2, sender_3] = bytemuck::must_cast(op.caller_identity.to_byte_array()); let [address_0, address_1] = bytemuck::must_cast(op.caller_address.as_byte_array()); diff --git a/crates/lib/proptest-regressions/identity.txt b/crates/lib/proptest-regressions/identity.txt new file mode 100644 index 00000000000..dbada4842a4 --- /dev/null +++ b/crates/lib/proptest-regressions/identity.txt @@ -0,0 +1,7 @@ +# Seeds for failure cases proptest has generated in the past. It is +# automatically read and these particular cases re-run before any +# novel cases are generated. +# +# It is recommended to check this file in to source control so that +# everyone who runs the test benefits from these saved cases. +cc 28ebdabf28ac09f38e0e0ddd728d32273f0dcffd43fa53bf1eaa8a01d1b38d90 # shrinks to w0 = 0, w1 = 1 diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index f08f14b7b90..8ce34128b27 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -60,37 +60,66 @@ impl Address { self.__address__ } + /// Create an `Address` from a LITTLE-ENDIAN byte array. + /// + /// If you are parsing an `Address` from a string, you probably want `from_be_byte_array` instead. pub const fn from_byte_array(arr: [u8; 16]) -> Self { Self::from_u128(u128::from_le_bytes(arr)) } + /// Create an `Address` from a BIG-ENDIAN byte array. + /// + /// This method is the correct choice if you have converted the bytes of a hexadecimal-formatted `Address` + /// to a byte array in the following way: + /// ```ignore + /// "0xb0b1b2..." + /// -> + /// [0xb0, 0xb1, 0xb2, ...] + /// ``` + pub const fn from_be_byte_array(arr: [u8; 16]) -> Self { + Self::from_u128(u128::from_be_bytes(arr)) + } + + /// Convert an address to a LITTLE-ENDIAN byte array. + /// If you are converting to a hexadecimal string, use `as_be_byte_array` instead. pub const fn as_byte_array(&self) -> [u8; 16] { self.__address__.to_le_bytes() } + /// Convert an address to a BIG-ENDIAN byte array. + /// This is a format suitable for printing as a hexadecimal string. + pub const fn as_be_byte_array(&self) -> [u8; 16] { + self.__address__.to_be_bytes() + } + pub fn from_hex(hex: &str) -> Result { from_hex_pad::<[u8; 16], _>(hex) .context("Addresses must be 32 hex characters (16 bytes) in length.") - .map(Self::from_byte_array) + .map(Self::from_be_byte_array) } + /// Convert this `Address` to a hexadecimal string. pub fn to_hex(self) -> HexString<16> { - spacetimedb_sats::hex::encode(&self.as_byte_array()) + spacetimedb_sats::hex::encode(&self.as_be_byte_array()) } + /// Extract the first 8 bytes of this `Address` as if it was stored in BIG-ENDIAN + /// format. (That is, the most significant bytes.) pub fn abbreviate(&self) -> [u8; 8] { - self.as_byte_array()[..8].try_into().unwrap() + self.as_be_byte_array()[..8].try_into().unwrap() } + /// Extract the first 16 characters of this `Address`'s hexadecimal representation. pub fn to_abbreviated_hex(self) -> HexString<8> { spacetimedb_sats::hex::encode(&self.abbreviate()) } + /// Create an `Address` from a slice, assumed to be in big-endian format. pub fn from_slice(slice: impl AsRef<[u8]>) -> Self { let slice = slice.as_ref(); let mut dst = [0u8; 16]; dst.copy_from_slice(slice); - Self::from_byte_array(dst) + Self::from_be_byte_array(dst) } pub fn to_ipv6(self) -> Ipv6Addr { @@ -147,7 +176,7 @@ impl serde::Serialize for AddressForUrl { where S: serde::Serializer, { - spacetimedb_sats::ser::serde::serialize_to(&Address::from(*self).as_byte_array(), serializer) + spacetimedb_sats::ser::serde::serialize_to(&Address::from(*self).as_be_byte_array(), serializer) } } @@ -158,7 +187,7 @@ impl<'de> serde::Deserialize<'de> for AddressForUrl { D: serde::Deserializer<'de>, { let arr = spacetimedb_sats::de::serde::deserialize_from(deserializer)?; - Ok(Address::from_byte_array(arr).into()) + Ok(Address::from_be_byte_array(arr).into()) } } @@ -168,7 +197,7 @@ impl serde::Serialize for Address { where S: serde::Serializer, { - spacetimedb_sats::ser::serde::serialize_to(&self.as_byte_array(), serializer) + spacetimedb_sats::ser::serde::serialize_to(&self.as_be_byte_array(), serializer) } } @@ -179,7 +208,7 @@ impl<'de> serde::Deserialize<'de> for Address { D: serde::Deserializer<'de>, { let arr = spacetimedb_sats::de::serde::deserialize_from(deserializer)?; - Ok(Address::from_byte_array(arr)) + Ok(Address::from_be_byte_array(arr)) } } @@ -188,8 +217,36 @@ mod tests { use super::*; use proptest::prelude::*; use spacetimedb_sats::bsatn; + use spacetimedb_sats::ser::serde::SerializeWrapper; use spacetimedb_sats::GroundSpacetimeType as _; + #[test] + fn address_json_serialization_big_endian() { + let addr = Address::from_be_byte_array([0xff, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); + + let hex = addr.to_hex(); + let json1 = serde_json::to_string(&addr).unwrap(); + let json2 = serde_json::to_string(&AddressForUrl::from(addr)).unwrap(); + + assert!( + json1.contains(hex.as_str()), + "expected {json1} to contain {hex} but it didn't" + ); + assert!( + json2.contains(hex.as_str()), + "expected {json2} to contain {hex} but it didn't" + ); + + // Serde made the slightly choice to serialize u128 as decimals in JSON. + // So we have an incompatibility between our formats here :/ + let decimal = addr.to_u128().to_string(); + let json3 = serde_json::to_string(SerializeWrapper::from_ref(&addr)).unwrap(); + assert!( + json3.contains(decimal.as_str()), + "expected {json3} to contain {hex} but it didn't" + ); + } + proptest! { #[test] fn test_bsatn_roundtrip(val: u128) { @@ -198,6 +255,15 @@ mod tests { let de = bsatn::from_slice(&ser).unwrap(); assert_eq!(addr, de); } + + #[test] + fn address_conversions(a: u128) { + let v = Address::from_u128(a); + + prop_assert_eq!(Address::from_byte_array(v.as_byte_array()), v); + prop_assert_eq!(Address::from_be_byte_array(v.as_be_byte_array()), v); + prop_assert_eq!(Address::from_hex(v.to_hex().as_str()).unwrap(), v); + } } #[test] diff --git a/crates/lib/src/identity.rs b/crates/lib/src/identity.rs index eed44fa74ee..5c4bda15193 100644 --- a/crates/lib/src/identity.rs +++ b/crates/lib/src/identity.rs @@ -31,9 +31,22 @@ impl AuthCtx { } } -/// An identifier for something interacting with the database. +/// An `Identity` for something interacting with the database. /// -/// This is a special type. +/// An `Identity` is a 256-bit unsigned integer. These are encoded in various ways. +/// - In JSON, an `Identity` is represented as a hexadecimal number wrapped in a string, `"0x[64 hex characters]"`. +/// - In BSATN, an `Identity` is represented as a LITTLE-ENDIAN number 32 bytes long. +/// - In memory, an `Identity` is stored as a 256-bit number with the endianness of the host system. +/// +/// If you are manually converting a hexadecimal string to a byte array like so: +/// ```ignore +/// "0xb0b1b2..." +/// -> +/// [0xb0, 0xb1, 0xb2, ...] +/// ``` +/// Make sure you call `Identity::from_be_byte_array` and NOT `Identity::from_byte_array`. +/// The standard way of writing hexadecimal numbers follows a big-endian convention, if you +/// index the characters in written text in increasing order from left to right. #[derive(Default, Eq, PartialEq, PartialOrd, Ord, Clone, Copy, Hash, Serialize, Deserialize)] pub struct Identity { __identity__: u256, @@ -51,13 +64,31 @@ impl spacetimedb_metrics::typed_prometheus::AsPrometheusLabel for Identity { impl Identity { pub const ZERO: Self = Self::from_u256(u256::ZERO); - /// Returns an `Identity` defined as the given `bytes` byte array. + /// Create an `Identity` from a LITTLE-ENDIAN byte array. + /// + /// If you are parsing an `Identity` from a string, you probably want `from_be_byte_array` instead. pub const fn from_byte_array(bytes: [u8; 32]) -> Self { - // SAFETY: The transmute is an implementation of `u256::from_ne_bytes`, + // SAFETY: The transmute is an implementation of `u256::from_le_bytes`, // but works in a const context. Self::from_u256(u256::from_le(unsafe { mem::transmute(bytes) })) } + /// Create an `Identity` from a BIG-ENDIAN byte array. + /// + /// This method is the correct choice if you have converted the bytes of a hexadecimal-formatted `Identity` + /// to a byte array in the following way: + /// ```ignore + /// "0xb0b1b2..." + /// -> + /// [0xb0, 0xb1, 0xb2, ...] + /// ``` + /// If you have created the byte array from a hexadecimal string, use `from_be_byte_array` instead! + pub const fn from_be_byte_array(bytes: [u8; 32]) -> Self { + // SAFETY: The transmute is an implementation of `u256::from_le_bytes`, + // but works in a const context. + Self::from_u256(u256::from_be(unsafe { mem::transmute(bytes) })) + } + /// Converts `__identity__: u256` to `Identity`. pub const fn from_u256(__identity__: u256) -> Self { Self { __identity__ } @@ -69,8 +100,9 @@ impl Identity { } /// Returns an `Identity` defined as the given byte `slice`. + /// Slice is assumed to be in LITTLE-ENDIAN format. pub fn from_slice(slice: &[u8]) -> Self { - Self::from_byte_array(slice.try_into().unwrap()) + Self::from_be_byte_array(slice.try_into().unwrap()) } #[doc(hidden)] @@ -94,7 +126,11 @@ impl Identity { final_bytes[1] = 0x00; final_bytes[2..6].copy_from_slice(&checksum_hash.as_bytes()[..4]); final_bytes[6..].copy_from_slice(id_hash); - Identity::from_byte_array(final_bytes) + + // We want the leading two bytes of the Identity to be `c200` when formatted. + // This means that these should be the MOST significant bytes. + // This corresponds to a BIG-ENDIAN byte order of our buffer above. + Identity::from_be_byte_array(final_bytes) } /// Returns this `Identity` as a byte array. @@ -102,14 +138,23 @@ impl Identity { self.__identity__.to_le_bytes() } + /// Convert this `Identity` to a BIG-ENDIAN byte array. + pub fn to_be_byte_array(&self) -> [u8; 32] { + self.__identity__.to_be_bytes() + } + + /// Convert this `Identity` to a hexadecimal string. pub fn to_hex(&self) -> HexString<32> { - spacetimedb_sats::hex::encode(&self.to_byte_array()) + spacetimedb_sats::hex::encode(&self.to_be_byte_array()) } + /// Extract the first 8 bytes of this `Identity` as if it was stored in BIG-ENDIAN + /// format. (That is, the most significant bytes.) pub fn abbreviate(&self) -> [u8; 8] { - self.to_byte_array()[..8].try_into().unwrap() + self.to_be_byte_array()[..8].try_into().unwrap() } + /// Extract the first 16 characters of this `Identity`'s hexadecimal representation. pub fn to_abbreviated_hex(&self) -> HexString<8> { spacetimedb_sats::hex::encode(&self.abbreviate()) } @@ -139,7 +184,7 @@ impl hex::FromHex for Identity { type Error = hex::FromHexError; fn from_hex>(hex: T) -> Result { - from_hex_pad(hex).map(Identity::from_byte_array) + from_hex_pad(hex).map(Identity::from_be_byte_array) } } @@ -160,7 +205,7 @@ impl From for AlgebraicValue { #[cfg(feature = "serde")] impl serde::Serialize for Identity { fn serialize(&self, serializer: S) -> Result { - spacetimedb_sats::ser::serde::serialize_to(&self.to_byte_array(), serializer) + spacetimedb_sats::ser::serde::serialize_to(&self.to_be_byte_array(), serializer) } } @@ -168,17 +213,62 @@ impl serde::Serialize for Identity { impl<'de> serde::Deserialize<'de> for Identity { fn deserialize>(deserializer: D) -> Result { let arr = spacetimedb_sats::de::serde::deserialize_from(deserializer)?; - Ok(Identity::from_byte_array(arr)) + Ok(Identity::from_be_byte_array(arr)) } } #[cfg(test)] mod tests { use super::*; - use spacetimedb_sats::GroundSpacetimeType as _; + use proptest::prelude::*; + use proptest::string::string_regex; + use spacetimedb_sats::{de::serde::DeserializeWrapper, ser::serde::SerializeWrapper, GroundSpacetimeType as _}; #[test] fn identity_is_special() { assert!(Identity::get_type().is_special()); } + + #[test] + fn identity_json_serialization_big_endian() { + let id = Identity::from_be_byte_array([ + 0xff, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, + ]); + + let hex = id.to_hex(); + let json1 = serde_json::to_string(&id).unwrap(); + let json2 = serde_json::to_string(SerializeWrapper::from_ref(&id)).unwrap(); + + assert!( + json1.contains(hex.as_str()), + "expected {json1} to contain {hex} but it didn't" + ); + assert!( + json2.contains(hex.as_str()), + "expected {json2} to contain {hex} but it didn't" + ); + } + + proptest! { + #[test] + fn identity_conversions(w0: u128, w1: u128) { + let v = Identity::from_u256(u256::from_words(w0, w1)); + + prop_assert_eq!(Identity::from_byte_array(v.to_byte_array()), v); + prop_assert_eq!(Identity::from_be_byte_array(v.to_be_byte_array()), v); + prop_assert_eq!(Identity::from_hex(v.to_hex()).unwrap(), v); + + let de1: Identity = serde_json::from_str(&serde_json::to_string(&v).unwrap()).unwrap(); + prop_assert_eq!(de1, v); + let DeserializeWrapper(de2): DeserializeWrapper = serde_json::from_str(&serde_json::to_string(SerializeWrapper::from_ref(&v)).unwrap()).unwrap(); + prop_assert_eq!(de2, v); + } + + #[test] + fn from_claims_formats_correctly(s1 in string_regex(r".{3,5}").unwrap(), s2 in string_regex(r".{3,5}").unwrap()) { + let id = Identity::from_claims(&s1, &s2); + prop_assert!(id.to_hex().starts_with("c200")); + } + } } diff --git a/crates/standalone/src/control_db.rs b/crates/standalone/src/control_db.rs index 4a2bfa7363d..102b1a96ae6 100644 --- a/crates/standalone/src/control_db.rs +++ b/crates/standalone/src/control_db.rs @@ -83,7 +83,9 @@ impl ControlDb { pub fn spacetime_reverse_dns(&self, database_identity: &Identity) -> Result> { let tree = self.db.open_tree("reverse_dns")?; - let value = tree.get(database_identity.to_byte_array())?; + // TODO: everywhere in this file should use `to_be_byte_array`. + // We may want to implement some sort of trait to ensure that it is used consistently. + let value = tree.get(database_identity.to_be_byte_array())?; if let Some(value) = value { let vec: Vec = serde_json::from_slice(&value[..])?; return Ok(vec); @@ -138,7 +140,7 @@ impl ControlDb { } } - let identity_bytes = database_identity.to_byte_array(); + let identity_bytes = database_identity.to_be_byte_array(); let tree = self.db.open_tree("dns")?; tree.insert(domain.to_lowercase().as_bytes(), &identity_bytes)?; @@ -179,7 +181,7 @@ impl ControlDb { } } None => { - tree.insert(key, &owner_identity.to_byte_array())?; + tree.insert(key, &owner_identity.to_be_byte_array())?; Ok(RegisterTldResult::Success { domain: tld }) } } @@ -418,7 +420,7 @@ impl ControlDb { /// `control_budget`, where a cached copy is stored along with business logic for managing it. pub fn get_energy_balance(&self, identity: &Identity) -> Result> { let tree = self.db.open_tree("energy_budget")?; - let value = tree.get(identity.to_byte_array())?; + let value = tree.get(identity.to_be_byte_array())?; if let Some(value) = value { let arr = <[u8; 16]>::try_from(value.as_ref()).map_err(|_| bsatn::DecodeError::BufferLength { for_type: "Identity".into(), @@ -437,7 +439,7 @@ impl ControlDb { /// `control_budget`, where a cached copy is stored along with business logic for managing it. pub fn set_energy_balance(&self, identity: Identity, energy_balance: energy::EnergyBalance) -> Result<()> { let tree = self.db.open_tree("energy_budget")?; - tree.insert(identity.to_byte_array(), &energy_balance.get().to_be_bytes())?; + tree.insert(identity.to_be_byte_array(), &energy_balance.get().to_be_bytes())?; Ok(()) } From 5dfacfce5f1ffacce96a3e6938d5f590fc8c5649 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Thu, 31 Oct 2024 16:59:19 -0400 Subject: [PATCH 02/12] Docs typo --- crates/lib/src/identity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/src/identity.rs b/crates/lib/src/identity.rs index 5c4bda15193..661e096b909 100644 --- a/crates/lib/src/identity.rs +++ b/crates/lib/src/identity.rs @@ -100,7 +100,7 @@ impl Identity { } /// Returns an `Identity` defined as the given byte `slice`. - /// Slice is assumed to be in LITTLE-ENDIAN format. + /// The slice is assumed to be in big-endian format. pub fn from_slice(slice: &[u8]) -> Self { Self::from_be_byte_array(slice.try_into().unwrap()) } From 91983826e955613e132c62425265fd207545c704 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Thu, 31 Oct 2024 17:00:19 -0400 Subject: [PATCH 03/12] Test typo --- crates/lib/src/address.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index 8ce34128b27..11aff7d477a 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -243,7 +243,7 @@ mod tests { let json3 = serde_json::to_string(SerializeWrapper::from_ref(&addr)).unwrap(); assert!( json3.contains(decimal.as_str()), - "expected {json3} to contain {hex} but it didn't" + "expected {json3} to contain {decimal} but it didn't" ); } From 639df72b6f6d384c547c297d19e6f70c67e08dc4 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Thu, 31 Oct 2024 17:04:01 -0400 Subject: [PATCH 04/12] One more comment fix --- crates/lib/src/address.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index 11aff7d477a..5bc7d74309f 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -237,8 +237,11 @@ mod tests { "expected {json2} to contain {hex} but it didn't" ); - // Serde made the slightly choice to serialize u128 as decimals in JSON. + // Serde made the slightly odd choice to serialize u128 as decimals in JSON. // So we have an incompatibility between our formats here :/ + // The implementation of serialization for `sats` types via `SerializeWrapper` just calls + // the `serde` implementation to serialize primitives, so we can't fix this + // unless we make a custom implementation of `Serialize` and `Deserialize` for `Address`. let decimal = addr.to_u128().to_string(); let json3 = serde_json::to_string(SerializeWrapper::from_ref(&addr)).unwrap(); assert!( From 30866da68401b19e9f5ec651e31cb8276bb30389 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Fri, 1 Nov 2024 12:28:59 -0400 Subject: [PATCH 05/12] Address review comments --- crates/lib/src/address.rs | 5 +++++ crates/lib/src/identity.rs | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index 5bc7d74309f..8e900036289 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -225,6 +225,11 @@ mod tests { let addr = Address::from_be_byte_array([0xff, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); let hex = addr.to_hex(); + assert!( + hex.as_str().starts_with("ff01"), + "expected {hex:?} to start with \"ff01\"" + ); + let json1 = serde_json::to_string(&addr).unwrap(); let json2 = serde_json::to_string(&AddressForUrl::from(addr)).unwrap(); diff --git a/crates/lib/src/identity.rs b/crates/lib/src/identity.rs index 661e096b909..84ef9fedbca 100644 --- a/crates/lib/src/identity.rs +++ b/crates/lib/src/identity.rs @@ -82,7 +82,6 @@ impl Identity { /// -> /// [0xb0, 0xb1, 0xb2, ...] /// ``` - /// If you have created the byte array from a hexadecimal string, use `from_be_byte_array` instead! pub const fn from_be_byte_array(bytes: [u8; 32]) -> Self { // SAFETY: The transmute is an implementation of `u256::from_le_bytes`, // but works in a const context. @@ -237,6 +236,11 @@ mod tests { ]); let hex = id.to_hex(); + assert!( + hex.as_str().starts_with("ff01"), + "expected {hex:?} to start with \"ff01\"" + ); + let json1 = serde_json::to_string(&id).unwrap(); let json2 = serde_json::to_string(SerializeWrapper::from_ref(&id)).unwrap(); From 105f8545310b363fa942a41c465e7248d6ffa184 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Fri, 1 Nov 2024 12:33:33 -0400 Subject: [PATCH 06/12] More detailed comments on Address --- crates/lib/src/address.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index 8e900036289..19778a47432 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -13,6 +13,21 @@ use spacetimedb_sats::{impl_deserialize, impl_serialize, impl_st, AlgebraicType, /// /// This is a special type. /// +/// An `Address` is a 128-bit unsigned integer. This can be serialized in various ways. +/// - In JSON, an `Address` is represented as a BARE DECIMAL number. This requires some care when deserializing: +/// see https://stackoverflow.com/questions/69644298/how-to-make-json-parse-to-treat-all-the-numbers-as-bigint +/// - In BSATN, an `Address` is represented as a LITTLE-ENDIAN number 16 bytes long. +/// - In memory, an `Address` is stored as a 128-bit number with the endianness of the host system. +/// +/// If you are manually converting a hexadecimal string to a byte array like so: +/// ```ignore +/// "0xb0b1b2..." +/// -> +/// [0xb0, 0xb1, 0xb2, ...] +/// ``` +/// Make sure you call `Address::from_be_byte_array` and NOT `Address::from_byte_array`. +/// The standard way of writing hexadecimal numbers follows a big-endian convention, if you +/// index the characters in written text in increasing order from left to right. // TODO: Evaluate other possible names: `DatabaseAddress`, `SPAddress` // TODO: Evaluate replacing this with a literal Ipv6Address // which is assigned permanently to a database. From 49032bd2d95332827590d0ca600803a6dd0a7e02 Mon Sep 17 00:00:00 2001 From: joshua-spacetime Date: Fri, 1 Nov 2024 14:54:48 -0700 Subject: [PATCH 07/12] chore: remove dead code (#1930) --- .../locking_tx_datastore/committed_state.rs | 31 ------ .../locking_tx_datastore/state_view.rs | 48 --------- crates/core/src/execution_context.rs | 101 ------------------ 3 files changed, 180 deletions(-) diff --git a/crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs b/crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs index dd1c01a4786..8aa66b2387b 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/committed_state.rs @@ -654,37 +654,6 @@ impl<'a> CommittedIndexIter<'a> { } } -// TODO(shub): this runs parralely for subscriptions leading to lock contention. -// commenting until we find a way to batch them without lock. -// impl Drop for CommittedIndexIter<'_> { -// fn drop(&mut self) { -// let mut metrics = self.ctx.metrics.write(); -// let get_table_name = || { -// self.committed_state -// .get_schema(&self.table_id) -// .map(|table| &*table.table_name) -// .unwrap_or_default() -// .to_string() -// }; - -// metrics.inc_by(self.table_id, MetricType::IndexSeeks, 1, get_table_name); -// // Increment number of index keys scanned -// metrics.inc_by( -// self.table_id, -// MetricType::KeysScanned, -// self.committed_rows.num_pointers_yielded(), -// get_table_name, -// ); -// // Increment number of rows fetched -// metrics.inc_by( -// self.table_id, -// MetricType::RowsFetched, -// self.num_committed_rows_fetched, -// get_table_name, -// ); -// } -// } - impl<'a> Iterator for CommittedIndexIter<'a> { type Item = RowRef<'a>; diff --git a/crates/core/src/db/datastore/locking_tx_datastore/state_view.rs b/crates/core/src/db/datastore/locking_tx_datastore/state_view.rs index 2878e339417..74d2c932346 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/state_view.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/state_view.rs @@ -154,19 +154,6 @@ pub struct Iter<'a> { num_committed_rows_fetched: u64, } -// impl Drop for Iter<'_> { -// fn drop(&mut self) { -// let mut metrics = self.ctx.metrics.write(); -// // Increment number of rows fetched -// metrics.inc_by( -// self.table_id, -// MetricType::RowsFetched, -// self.num_committed_rows_fetched, -// || self.table_name.to_string(), -// ); -// } -// } - impl<'a> Iter<'a> { pub(super) fn new( table_id: TableId, @@ -294,41 +281,6 @@ pub struct IndexSeekIterMutTxId<'a> { pub(super) num_committed_rows_fetched: u64, } -// impl Drop for IndexSeekIterMutTxId<'_> { -// fn drop(&mut self) { -// let mut metrics = self.ctx.metrics.write(); -// let get_table_name = || { -// self.committed_state -// .get_schema(&self.table_id) -// .map(|table| &*table.table_name) -// .unwrap_or_default() -// .to_string() -// }; - -// let num_pointers_yielded = self -// .committed_rows -// .as_ref() -// .map_or(0, |iter| iter.num_pointers_yielded()); - -// // Increment number of index seeks -// metrics.inc_by(self.table_id, MetricType::IndexSeeks, 1, get_table_name); -// // Increment number of index keys scanned -// metrics.inc_by( -// self.table_id, -// MetricType::KeysScanned, -// num_pointers_yielded, -// get_table_name, -// ); -// // Increment number of rows fetched -// metrics.inc_by( -// self.table_id, -// MetricType::RowsFetched, -// self.num_committed_rows_fetched, -// get_table_name, -// ); -// } -// } - impl<'a> Iterator for IndexSeekIterMutTxId<'a> { type Item = RowRef<'a>; diff --git a/crates/core/src/execution_context.rs b/crates/core/src/execution_context.rs index ee80464c241..d36ccbc3580 100644 --- a/crates/core/src/execution_context.rs +++ b/crates/core/src/execution_context.rs @@ -1,101 +1,12 @@ use std::sync::Arc; -use crate::db::db_metrics::DB_METRICS; use bytes::Bytes; use derive_more::Display; -use parking_lot::RwLock; use spacetimedb_client_api_messages::timestamp::Timestamp; use spacetimedb_commitlog::{payload::txdata, Varchar}; use spacetimedb_lib::{Address, Identity}; -use spacetimedb_primitives::TableId; use spacetimedb_sats::bsatn; -pub enum MetricType { - IndexSeeks, - KeysScanned, - RowsFetched, -} - -#[derive(Default, Clone)] -struct BufferMetric { - pub table_id: TableId, - pub index_seeks: u64, - pub keys_scanned: u64, - pub rows_fetched: u64, - pub cache_table_name: String, -} - -impl BufferMetric { - pub fn inc_by(&mut self, ty: MetricType, val: u64) { - match ty { - MetricType::IndexSeeks => { - self.index_seeks += val; - } - MetricType::KeysScanned => { - self.keys_scanned += val; - } - MetricType::RowsFetched => { - self.rows_fetched += val; - } - } - } -} - -impl BufferMetric { - pub fn new(table_id: TableId, table_name: String) -> Self { - Self { - table_id, - cache_table_name: table_name, - ..Default::default() - } - } -} - -#[derive(Default, Clone)] -pub struct Metrics(Vec); - -impl Metrics { - pub fn inc_by String>(&mut self, table_id: TableId, ty: MetricType, val: u64, get_table_name: F) { - if let Some(metric) = self.0.iter_mut().find(|x| x.table_id == table_id) { - metric.inc_by(ty, val); - } else { - let table_name = get_table_name(); - let mut metric = BufferMetric::new(table_id, table_name); - metric.inc_by(ty, val); - self.0.push(metric); - } - } - - pub fn table_exists(&self, table_id: TableId) -> bool { - self.0.iter().any(|x| x.table_id == table_id) - } - - #[allow(dead_code)] - fn flush(&mut self, workload: &WorkloadType, database_identity: &Identity, reducer: &str) { - macro_rules! flush_metric { - ($db_metric:expr, $metric:expr, $metric_field:ident) => { - if $metric.$metric_field > 0 { - $db_metric - .with_label_values( - workload, - database_identity, - reducer, - &$metric.table_id.0, - &$metric.cache_table_name, - ) - .inc_by($metric.$metric_field); - } - }; - } - - self.0.iter().for_each(|metric| { - flush_metric!(DB_METRICS.rdb_num_index_seeks, metric, index_seeks); - flush_metric!(DB_METRICS.rdb_num_keys_scanned, metric, keys_scanned); - flush_metric!(DB_METRICS.rdb_num_rows_fetched, metric, rows_fetched); - }); - } -} - /// Represents the context under which a database runtime method is executed. /// In particular it provides details about the currently executing txn to runtime operations. /// More generally it acts as a container for information that database operations may require to function correctly. @@ -107,8 +18,6 @@ pub struct ExecutionContext { reducer: Option, /// The type of workload that is being executed. workload: WorkloadType, - /// The Metrics to be reported for this transaction. - pub metrics: Arc>, } /// If an [`ExecutionContext`] is a reducer context, describes the reducer. @@ -221,7 +130,6 @@ impl ExecutionContext { database_identity, reducer, workload, - metrics: <_>::default(), } } @@ -293,12 +201,3 @@ impl ExecutionContext { self.workload } } - -impl Drop for ExecutionContext { - fn drop(&mut self) { - let workload = self.workload; - let database = self.database_identity; - let reducer = self.reducer_name(); - self.metrics.write().flush(&workload, &database, reducer); - } -} From 1657fd2d282df6ec9893fb490a36017afad7d9ba Mon Sep 17 00:00:00 2001 From: joshua-spacetime Date: Fri, 1 Nov 2024 16:05:31 -0700 Subject: [PATCH 08/12] Use previous reducer context when downgrading a tx (#1932) --- .../locking_tx_datastore/datastore.rs | 2 +- .../datastore/locking_tx_datastore/mut_tx.rs | 22 ++++++++++--------- .../db/datastore/locking_tx_datastore/tx.rs | 2 +- crates/core/src/execution_context.rs | 20 ++++++++++++++--- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/crates/core/src/db/datastore/locking_tx_datastore/datastore.rs b/crates/core/src/db/datastore/locking_tx_datastore/datastore.rs index 246e4eb830a..121a8fc79f9 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/datastore.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/datastore.rs @@ -604,7 +604,7 @@ impl MutTxDatastore for Locking { /// This utility is responsible for recording all transaction metrics. pub(super) fn record_metrics( - ctx: ExecutionContext, + ctx: &ExecutionContext, tx_timer: Instant, lock_wait_time: Duration, committed: bool, diff --git a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs index d911fbbb90a..b13b650db79 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs @@ -1028,7 +1028,7 @@ impl MutTxId { // Record metrics for the transaction at the very end, // right before we drop and release the lock. record_metrics( - self.ctx, + &self.ctx, self.timer, self.lock_wait_time, true, @@ -1038,29 +1038,30 @@ impl MutTxId { tx_data } - pub fn commit_downgrade(self, workload: Workload) -> (TxData, TxId) { + pub fn commit_downgrade(mut self, workload: Workload) -> (TxData, TxId) { let Self { mut committed_state_write_lock, tx_state, .. } = self; let tx_data = committed_state_write_lock.merge(tx_state, &self.ctx); - let database_identity = self.ctx.database_identity(); // Record metrics for the transaction at the very end, // right before we drop and release the lock. record_metrics( - self.ctx, + &self.ctx, self.timer, self.lock_wait_time, true, Some(&tx_data), Some(&committed_state_write_lock), ); + // Update the workload type of the execution context + self.ctx.workload = workload.into(); let tx = TxId { committed_state_shared_lock: SharedWriteGuard::downgrade(committed_state_write_lock), lock_wait_time: Duration::ZERO, timer: Instant::now(), - ctx: ExecutionContext::with_workload(database_identity, workload), + ctx: self.ctx, }; (tx_data, tx) } @@ -1068,19 +1069,20 @@ impl MutTxId { pub fn rollback(self) { // Record metrics for the transaction at the very end, // right before we drop and release the lock. - record_metrics(self.ctx, self.timer, self.lock_wait_time, false, None, None); + record_metrics(&self.ctx, self.timer, self.lock_wait_time, false, None, None); } - pub fn rollback_downgrade(self, workload: Workload) -> TxId { + pub fn rollback_downgrade(mut self, workload: Workload) -> TxId { // Record metrics for the transaction at the very end, // right before we drop and release the lock. - let database_identity = self.ctx.database_identity(); - record_metrics(self.ctx, self.timer, self.lock_wait_time, false, None, None); + record_metrics(&self.ctx, self.timer, self.lock_wait_time, false, None, None); + // Update the workload type of the execution context + self.ctx.workload = workload.into(); TxId { committed_state_shared_lock: SharedWriteGuard::downgrade(self.committed_state_write_lock), lock_wait_time: Duration::ZERO, timer: Instant::now(), - ctx: ExecutionContext::with_workload(database_identity, workload), + ctx: self.ctx, } } } diff --git a/crates/core/src/db/datastore/locking_tx_datastore/tx.rs b/crates/core/src/db/datastore/locking_tx_datastore/tx.rs index b428f009a87..ad5805db82b 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/tx.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/tx.rs @@ -60,7 +60,7 @@ impl StateView for TxId { impl TxId { pub(super) fn release(self) { - record_metrics(self.ctx, self.timer, self.lock_wait_time, true, None, None); + record_metrics(&self.ctx, self.timer, self.lock_wait_time, true, None, None); } /// The Number of Distinct Values (NDV) for a column or list of columns, diff --git a/crates/core/src/execution_context.rs b/crates/core/src/execution_context.rs index d36ccbc3580..fa084404b24 100644 --- a/crates/core/src/execution_context.rs +++ b/crates/core/src/execution_context.rs @@ -13,11 +13,11 @@ use spacetimedb_sats::bsatn; #[derive(Default, Clone)] pub struct ExecutionContext { /// The identity of the database on which a transaction is being executed. - database_identity: Identity, + pub database_identity: Identity, /// The reducer from which the current transaction originated. - reducer: Option, + pub reducer: Option, /// The type of workload that is being executed. - workload: WorkloadType, + pub workload: WorkloadType, } /// If an [`ExecutionContext`] is a reducer context, describes the reducer. @@ -117,6 +117,20 @@ pub enum WorkloadType { Internal, } +impl From for WorkloadType { + fn from(value: Workload) -> Self { + match value { + #[cfg(test)] + Workload::ForTests => Self::Internal, + Workload::Reducer(_) => Self::Reducer, + Workload::Sql => Self::Sql, + Workload::Subscribe => Self::Subscribe, + Workload::Update => Self::Update, + Workload::Internal => Self::Internal, + } + } +} + impl Default for WorkloadType { fn default() -> Self { Self::Internal From ac0053caab33a586cb190b5215f50f8c48a60a35 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Mon, 4 Nov 2024 16:59:11 +0100 Subject: [PATCH 09/12] Websocket API: Light transaction updates & `NoSuccessNotify` (#1812) Signed-off-by: Mazdak Farrokhzad Co-authored-by: Phoebe Goldman --- crates/cli/src/subcommands/generate/csharp.rs | 28 ++- crates/cli/src/subcommands/generate/rust.rs | 59 +++++ .../src/subcommands/generate/typescript.rs | 44 +++- crates/cli/src/subcommands/subscribe.rs | 17 +- .../snapshots/codegen__codegen_csharp.snap | 46 +++- .../snapshots/codegen__codegen_rust.snap | 238 ++++++++++++++++++ .../codegen__codegen_typescript.snap | 154 ++++++++++-- crates/client-api-messages/src/websocket.rs | 56 ++++- crates/client-api/src/routes/subscribe.rs | 23 +- crates/core/src/client.rs | 4 +- crates/core/src/client/client_connection.rs | 61 +++-- crates/core/src/client/message_handlers.rs | 5 +- crates/core/src/client/messages.rs | 43 ++-- .../src/host/wasm_common/module_host_actor.rs | 3 +- .../subscription/module_subscription_actor.rs | 21 +- .../module_subscription_manager.rs | 96 +++---- .../identity_connected_reducer.rs | 20 ++ .../identity_disconnected_reducer.rs | 20 ++ .../module_bindings/init_reducer.rs | 20 ++ .../quickstart-chat/module_bindings/mod.rs | 38 +++ .../module_bindings/send_message_reducer.rs | 20 ++ .../module_bindings/set_name_reducer.rs | 20 ++ crates/sdk/src/db_connection.rs | 92 ++++++- crates/sdk/src/db_context.rs | 9 + crates/sdk/src/event.rs | 10 +- crates/sdk/src/spacetime_module.rs | 7 + crates/sdk/src/websocket.rs | 32 ++- .../identity_connected_reducer.rs | 20 ++ .../identity_disconnected_reducer.rs | 20 ++ .../src/module_bindings/mod.rs | 38 +++ .../delete_pk_address_reducer.rs | 20 ++ .../module_bindings/delete_pk_bool_reducer.rs | 20 ++ .../delete_pk_i_128_reducer.rs | 20 ++ .../module_bindings/delete_pk_i_16_reducer.rs | 20 ++ .../delete_pk_i_256_reducer.rs | 20 ++ .../module_bindings/delete_pk_i_32_reducer.rs | 20 ++ .../module_bindings/delete_pk_i_64_reducer.rs | 20 ++ .../module_bindings/delete_pk_i_8_reducer.rs | 20 ++ .../delete_pk_identity_reducer.rs | 20 ++ .../delete_pk_string_reducer.rs | 20 ++ .../delete_pk_u_128_reducer.rs | 20 ++ .../module_bindings/delete_pk_u_16_reducer.rs | 20 ++ .../delete_pk_u_256_reducer.rs | 20 ++ .../module_bindings/delete_pk_u_32_reducer.rs | 20 ++ .../module_bindings/delete_pk_u_64_reducer.rs | 20 ++ .../module_bindings/delete_pk_u_8_reducer.rs | 20 ++ .../delete_unique_address_reducer.rs | 20 ++ .../delete_unique_bool_reducer.rs | 20 ++ .../delete_unique_i_128_reducer.rs | 20 ++ .../delete_unique_i_16_reducer.rs | 20 ++ .../delete_unique_i_256_reducer.rs | 20 ++ .../delete_unique_i_32_reducer.rs | 20 ++ .../delete_unique_i_64_reducer.rs | 20 ++ .../delete_unique_i_8_reducer.rs | 20 ++ .../delete_unique_identity_reducer.rs | 20 ++ .../delete_unique_string_reducer.rs | 20 ++ .../delete_unique_u_128_reducer.rs | 20 ++ .../delete_unique_u_16_reducer.rs | 20 ++ .../delete_unique_u_256_reducer.rs | 20 ++ .../delete_unique_u_32_reducer.rs | 20 ++ .../delete_unique_u_64_reducer.rs | 20 ++ .../delete_unique_u_8_reducer.rs | 20 ++ .../insert_caller_one_address_reducer.rs | 20 ++ .../insert_caller_one_identity_reducer.rs | 20 ++ .../insert_caller_pk_address_reducer.rs | 20 ++ .../insert_caller_pk_identity_reducer.rs | 20 ++ .../insert_caller_unique_address_reducer.rs | 20 ++ .../insert_caller_unique_identity_reducer.rs | 20 ++ .../insert_caller_vec_address_reducer.rs | 20 ++ .../insert_caller_vec_identity_reducer.rs | 20 ++ .../insert_large_table_reducer.rs | 20 ++ .../insert_one_address_reducer.rs | 20 ++ .../insert_one_bool_reducer.rs | 20 ++ .../insert_one_byte_struct_reducer.rs | 20 ++ .../insert_one_enum_with_payload_reducer.rs | 20 ++ ...sert_one_every_primitive_struct_reducer.rs | 21 ++ .../insert_one_every_vec_struct_reducer.rs | 20 ++ .../insert_one_f_32_reducer.rs | 20 ++ .../insert_one_f_64_reducer.rs | 20 ++ .../insert_one_i_128_reducer.rs | 20 ++ .../insert_one_i_16_reducer.rs | 20 ++ .../insert_one_i_256_reducer.rs | 20 ++ .../insert_one_i_32_reducer.rs | 20 ++ .../insert_one_i_64_reducer.rs | 20 ++ .../module_bindings/insert_one_i_8_reducer.rs | 20 ++ .../insert_one_identity_reducer.rs | 20 ++ .../insert_one_simple_enum_reducer.rs | 20 ++ .../insert_one_string_reducer.rs | 20 ++ .../insert_one_u_128_reducer.rs | 20 ++ .../insert_one_u_16_reducer.rs | 20 ++ .../insert_one_u_256_reducer.rs | 20 ++ .../insert_one_u_32_reducer.rs | 20 ++ .../insert_one_u_64_reducer.rs | 20 ++ .../module_bindings/insert_one_u_8_reducer.rs | 20 ++ .../insert_one_unit_struct_reducer.rs | 20 ++ ...t_option_every_primitive_struct_reducer.rs | 21 ++ .../insert_option_i_32_reducer.rs | 20 ++ .../insert_option_identity_reducer.rs | 20 ++ .../insert_option_simple_enum_reducer.rs | 20 ++ .../insert_option_string_reducer.rs | 20 ++ .../insert_option_vec_option_i_32_reducer.rs | 20 ++ .../insert_pk_address_reducer.rs | 20 ++ .../module_bindings/insert_pk_bool_reducer.rs | 20 ++ .../insert_pk_i_128_reducer.rs | 20 ++ .../module_bindings/insert_pk_i_16_reducer.rs | 20 ++ .../insert_pk_i_256_reducer.rs | 20 ++ .../module_bindings/insert_pk_i_32_reducer.rs | 20 ++ .../module_bindings/insert_pk_i_64_reducer.rs | 20 ++ .../module_bindings/insert_pk_i_8_reducer.rs | 20 ++ .../insert_pk_identity_reducer.rs | 20 ++ .../insert_pk_string_reducer.rs | 20 ++ .../insert_pk_u_128_reducer.rs | 20 ++ .../module_bindings/insert_pk_u_16_reducer.rs | 20 ++ .../insert_pk_u_256_reducer.rs | 20 ++ .../module_bindings/insert_pk_u_32_reducer.rs | 20 ++ .../module_bindings/insert_pk_u_64_reducer.rs | 20 ++ .../module_bindings/insert_pk_u_8_reducer.rs | 20 ++ .../insert_primitives_as_strings_reducer.rs | 20 ++ .../insert_table_holds_table_reducer.rs | 20 ++ .../insert_unique_address_reducer.rs | 20 ++ .../insert_unique_bool_reducer.rs | 20 ++ .../insert_unique_i_128_reducer.rs | 20 ++ .../insert_unique_i_16_reducer.rs | 20 ++ .../insert_unique_i_256_reducer.rs | 20 ++ .../insert_unique_i_32_reducer.rs | 20 ++ .../insert_unique_i_64_reducer.rs | 20 ++ .../insert_unique_i_8_reducer.rs | 20 ++ .../insert_unique_identity_reducer.rs | 20 ++ .../insert_unique_string_reducer.rs | 20 ++ .../insert_unique_u_128_reducer.rs | 20 ++ .../insert_unique_u_16_reducer.rs | 20 ++ .../insert_unique_u_256_reducer.rs | 20 ++ .../insert_unique_u_32_reducer.rs | 20 ++ .../insert_unique_u_64_reducer.rs | 20 ++ .../insert_unique_u_8_reducer.rs | 20 ++ .../insert_vec_address_reducer.rs | 20 ++ .../insert_vec_bool_reducer.rs | 20 ++ .../insert_vec_byte_struct_reducer.rs | 20 ++ .../insert_vec_enum_with_payload_reducer.rs | 20 ++ ...sert_vec_every_primitive_struct_reducer.rs | 21 ++ .../insert_vec_every_vec_struct_reducer.rs | 20 ++ .../insert_vec_f_32_reducer.rs | 20 ++ .../insert_vec_f_64_reducer.rs | 20 ++ .../insert_vec_i_128_reducer.rs | 20 ++ .../insert_vec_i_16_reducer.rs | 20 ++ .../insert_vec_i_256_reducer.rs | 20 ++ .../insert_vec_i_32_reducer.rs | 20 ++ .../insert_vec_i_64_reducer.rs | 20 ++ .../module_bindings/insert_vec_i_8_reducer.rs | 20 ++ .../insert_vec_identity_reducer.rs | 20 ++ .../insert_vec_simple_enum_reducer.rs | 20 ++ .../insert_vec_string_reducer.rs | 20 ++ .../insert_vec_u_128_reducer.rs | 20 ++ .../insert_vec_u_16_reducer.rs | 20 ++ .../insert_vec_u_256_reducer.rs | 20 ++ .../insert_vec_u_32_reducer.rs | 20 ++ .../insert_vec_u_64_reducer.rs | 20 ++ .../module_bindings/insert_vec_u_8_reducer.rs | 20 ++ .../insert_vec_unit_struct_reducer.rs | 20 ++ .../test-client/src/module_bindings/mod.rs | 38 +++ .../module_bindings/no_op_succeeds_reducer.rs | 20 ++ .../update_pk_address_reducer.rs | 20 ++ .../module_bindings/update_pk_bool_reducer.rs | 20 ++ .../update_pk_i_128_reducer.rs | 20 ++ .../module_bindings/update_pk_i_16_reducer.rs | 20 ++ .../update_pk_i_256_reducer.rs | 20 ++ .../module_bindings/update_pk_i_32_reducer.rs | 20 ++ .../module_bindings/update_pk_i_64_reducer.rs | 20 ++ .../module_bindings/update_pk_i_8_reducer.rs | 20 ++ .../update_pk_identity_reducer.rs | 20 ++ .../update_pk_string_reducer.rs | 20 ++ .../update_pk_u_128_reducer.rs | 20 ++ .../module_bindings/update_pk_u_16_reducer.rs | 20 ++ .../update_pk_u_256_reducer.rs | 20 ++ .../module_bindings/update_pk_u_32_reducer.rs | 20 ++ .../module_bindings/update_pk_u_64_reducer.rs | 20 ++ .../module_bindings/update_pk_u_8_reducer.rs | 20 ++ .../update_unique_address_reducer.rs | 20 ++ .../update_unique_bool_reducer.rs | 20 ++ .../update_unique_i_128_reducer.rs | 20 ++ .../update_unique_i_16_reducer.rs | 20 ++ .../update_unique_i_256_reducer.rs | 20 ++ .../update_unique_i_32_reducer.rs | 20 ++ .../update_unique_i_64_reducer.rs | 20 ++ .../update_unique_i_8_reducer.rs | 20 ++ .../update_unique_identity_reducer.rs | 20 ++ .../update_unique_string_reducer.rs | 20 ++ .../update_unique_u_128_reducer.rs | 20 ++ .../update_unique_u_16_reducer.rs | 20 ++ .../update_unique_u_256_reducer.rs | 20 ++ .../update_unique_u_32_reducer.rs | 20 ++ .../update_unique_u_64_reducer.rs | 20 ++ .../update_unique_u_8_reducer.rs | 20 ++ crates/testing/src/modules.rs | 24 +- .../tests/standalone_integration_test.rs | 18 +- 195 files changed, 4401 insertions(+), 186 deletions(-) diff --git a/crates/cli/src/subcommands/generate/csharp.rs b/crates/cli/src/subcommands/generate/csharp.rs index 6148a411d8f..5758bf69d60 100644 --- a/crates/cli/src/subcommands/generate/csharp.rs +++ b/crates/cli/src/subcommands/generate/csharp.rs @@ -94,7 +94,7 @@ fn default_init(ctx: &GenCtx, ty: &AlgebraicType) -> Option<&'static str> { AlgebraicType::Sum(sum_type) if sum_type.is_option() || sum_type.is_simple_enum() => None, // TODO: generate some proper default here (what would it be for tagged enums?). AlgebraicType::Sum(_) => Some("null!"), - // For product types, arrays, and maps, we can use the default constructor. + // For product types and arrays, we can use the default constructor. AlgebraicType::Product(_) | AlgebraicType::Array(_) => Some("new()"), // Strings must have explicit default value of "". AlgebraicType::String => Some(r#""""#), @@ -641,7 +641,11 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str) writeln!(output, "public sealed class RemoteReducers : RemoteBase"); indented_block(&mut output, |output| { - writeln!(output, "internal RemoteReducers(DbConnection conn) : base(conn) {{}}"); + writeln!( + output, + "internal RemoteReducers(DbConnection conn, SetReducerFlags SetReducerFlags) : base(conn) {{ this.SetCallReducerFlags = SetReducerFlags; }}" + ); + writeln!(output, "internal readonly SetReducerFlags SetCallReducerFlags;"); for reducer in &reducers { let func_name = &*reducer.name; @@ -683,7 +687,7 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str) indented_block(output, |output| { writeln!( output, - "conn.InternalCallReducer(new {func_name_pascal_case} {{ {field_inits} }});" + "conn.InternalCallReducer(new {func_name_pascal_case} {{ {field_inits} }}, this.SetCallReducerFlags.{func_name_pascal_case}Flags);" ); }); writeln!(output); @@ -716,12 +720,25 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str) }); writeln!(output); + writeln!(output, "public sealed class SetReducerFlags"); + indented_block(&mut output, |output| { + writeln!(output, "internal SetReducerFlags() {{ }}"); + for reducer in &reducers { + let func_name = &*reducer.name; + let func_name_pascal_case = func_name.to_case(Case::Pascal); + writeln!(output, "internal CallReducerFlags {func_name_pascal_case}Flags;"); + writeln!(output, "public void {func_name_pascal_case}(CallReducerFlags flags) {{ this.{func_name_pascal_case}Flags = flags; }}"); + } + }); + writeln!(output); + writeln!( output, "public partial record EventContext : DbContext, IEventContext" ); indented_block(&mut output, |output| { writeln!(output, "public readonly RemoteReducers Reducers;"); + writeln!(output, "public readonly SetReducerFlags SetReducerFlags;"); writeln!(output, "public readonly Event Event;"); writeln!(output); writeln!( @@ -730,6 +747,7 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str) ); indented_block(output, |output| { writeln!(output, "Reducers = conn.Reducers;"); + writeln!(output, "SetReducerFlags = conn.SetReducerFlags;"); writeln!(output, "Event = reducerEvent;"); }); }); @@ -755,11 +773,13 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str) indented_block(&mut output, |output| { writeln!(output, "public readonly RemoteTables Db = new();"); writeln!(output, "public readonly RemoteReducers Reducers;"); + writeln!(output, "public readonly SetReducerFlags SetReducerFlags;"); writeln!(output); writeln!(output, "public DbConnection()"); indented_block(output, |output| { - writeln!(output, "Reducers = new(this);"); + writeln!(output, "SetReducerFlags = new();"); + writeln!(output, "Reducers = new(this, this.SetReducerFlags);"); writeln!(output); for item in items { diff --git a/crates/cli/src/subcommands/generate/rust.rs b/crates/cli/src/subcommands/generate/rust.rs index 459d6a97c68..b44c9dd47b8 100644 --- a/crates/cli/src/subcommands/generate/rust.rs +++ b/crates/cli/src/subcommands/generate/rust.rs @@ -339,6 +339,7 @@ Requested namespace: {namespace}", let reducer_name = reducer.name.deref(); let func_name = reducer_function_name(reducer); + let set_reducer_flags_trait = format!("set_flags_for_{func_name}"); let args_type = reducer_args_type_name(&reducer.name); define_struct_for_product(module, out, &args_type, &reducer.params_for_generate.elements); @@ -431,6 +432,26 @@ impl {func_name} for super::RemoteReducers {{ self.imp.remove_on_reducer::<{args_type}>({reducer_name:?}, callback.0) }} }} + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `{reducer_name}`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait {set_reducer_flags_trait} {{ + /// Set the call-reducer flags for the reducer `{reducer_name}` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn {func_name}(&self, flags: __ws::CallReducerFlags); +}} + +impl {set_reducer_flags_trait} for super::SetReducerFlags {{ + fn {func_name}(&self, flags: __ws::CallReducerFlags) {{ + self.imp.set_call_reducer_flags({reducer_name:?}, flags); + }} +}} " ); @@ -985,6 +1006,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule {{ type Reducer = Reducer; type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; type DbUpdate = DbUpdate; type SubscriptionHandle = SubscriptionHandle; }} @@ -999,6 +1021,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers {{ type Module = RemoteModule; }} +#[doc(hidden)] +/// The `set_reducer_flags` field of [`DbConnection`], +/// with methods provided by extension traits for each reducer defined by the module. +/// Each method sets the flags for the reducer with the same name. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub struct SetReducerFlags {{ + imp: __sdk::db_connection::DbContextImpl, +}} + +impl __sdk::spacetime_module::InModule for SetReducerFlags {{ + type Module = RemoteModule; +}} + /// The `db` field of [`EventContext`] and [`DbConnection`], /// with methods provided by extension traits for each table defined by the module. pub struct RemoteTables {{ @@ -1030,6 +1066,12 @@ pub struct DbConnection {{ pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + #[doc(hidden)] + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, imp: __sdk::db_connection::DbContextImpl, }} @@ -1041,6 +1083,7 @@ impl __sdk::spacetime_module::InModule for DbConnection {{ impl __sdk::db_context::DbContext for DbConnection {{ type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView {{ &self.db @@ -1048,6 +1091,9 @@ impl __sdk::db_context::DbContext for DbConnection {{ fn reducers(&self) -> &Self::Reducers {{ &self.reducers }} + fn set_reducer_flags(&self) -> &Self::SetReducerFlags {{ + &self.set_reducer_flags + }} fn is_active(&self) -> bool {{ self.imp.is_active() @@ -1147,6 +1193,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection {{ Self {{ db: RemoteTables {{ imp: imp.clone() }}, reducers: RemoteReducers {{ imp: imp.clone() }}, + set_reducer_flags: SetReducerFlags {{ imp: imp.clone() }}, imp, }} }} @@ -1159,6 +1206,11 @@ pub struct EventContext {{ pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, /// The event which caused these callbacks to run. pub event: __sdk::event::Event, imp: __sdk::db_connection::DbContextImpl, @@ -1171,6 +1223,7 @@ impl __sdk::spacetime_module::InModule for EventContext {{ impl __sdk::db_context::DbContext for EventContext {{ type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView {{ &self.db @@ -1178,6 +1231,9 @@ impl __sdk::db_context::DbContext for EventContext {{ fn reducers(&self) -> &Self::Reducers {{ &self.reducers }} + fn set_reducer_flags(&self) -> &Self::SetReducerFlags {{ + &self.set_reducer_flags + }} fn is_active(&self) -> bool {{ self.imp.is_active() @@ -1209,6 +1265,7 @@ impl __sdk::spacetime_module::EventContext for EventContext {{ Self {{ db: RemoteTables {{ imp: imp.clone() }}, reducers: RemoteReducers {{ imp: imp.clone() }}, + set_reducer_flags: SetReducerFlags {{ imp: imp.clone() }}, event, imp, }} @@ -1239,11 +1296,13 @@ impl __sdk::spacetime_module::SubscriptionHandle for SubscriptionHandle {{ pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, > {{}} impl, >> RemoteDbContext for Ctx {{}} ", diff --git a/crates/cli/src/subcommands/generate/typescript.rs b/crates/cli/src/subcommands/generate/typescript.rs index efdfa09d7b8..6cbbf63584b 100644 --- a/crates/cli/src/subcommands/generate/typescript.rs +++ b/crates/cli/src/subcommands/generate/typescript.rs @@ -388,8 +388,11 @@ eventContextConstructor: (imp: DBConnectionImpl, event: Event) => {{ dbViewConstructor: (imp: DBConnectionImpl) => {{ return new RemoteTables(imp); }}, -reducersConstructor: (imp: DBConnectionImpl) => {{ - return new RemoteReducers(imp); +reducersConstructor: (imp: DBConnectionImpl, setReducerFlags: SetReducerFlags) => {{ + return new RemoteReducers(imp, setReducerFlags); +}}, +setReducerFlagsConstructor: () => {{ + return new SetReducerFlags(); }}" ); out.dedent(1); @@ -405,6 +408,10 @@ reducersConstructor: (imp: DBConnectionImpl) => {{ out.newline(); + print_set_reducer_flags(module, out); + + out.newline(); + print_remote_tables(module, out); out.newline(); @@ -415,7 +422,7 @@ reducersConstructor: (imp: DBConnectionImpl) => {{ writeln!( out, - "export type EventContext = EventContextInterface;" + "export type EventContext = EventContextInterface;" ); vec![("index.ts".to_string(), (output.into_inner()))] @@ -425,7 +432,10 @@ reducersConstructor: (imp: DBConnectionImpl) => {{ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "export class RemoteReducers {{"); out.indent(1); - writeln!(out, "constructor(private connection: DBConnectionImpl) {{}}"); + writeln!( + out, + "constructor(private connection: DBConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}" + ); out.newline(); for reducer in iter_reducers(module) { @@ -455,7 +465,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { out.with_indent(|out| { writeln!( out, - "this.connection.callReducer(\"{reducer_name}\", new Uint8Array(0));" + "this.connection.callReducer(\"{reducer_name}\", new Uint8Array(0), this.setCallReducerFlags.{reducer_function_name}Flags);" ); }); } else { @@ -468,7 +478,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { "{reducer_variant}.getTypeScriptAlgebraicType().serialize(__writer, __args);" ); writeln!(out, "let __argsBuffer = __writer.getBuffer();"); - writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer);"); + writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer, this.setCallReducerFlags.{reducer_function_name}Flags);"); }); } writeln!(out, "}}"); @@ -503,6 +513,25 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "}}"); } +fn print_set_reducer_flags(module: &ModuleDef, out: &mut Indenter) { + writeln!(out, "export class SetReducerFlags {{"); + out.indent(1); + + for reducer in iter_reducers(module) { + let reducer_function_name = reducer_function_name(reducer); + writeln!(out, "{reducer_function_name}Flags: CallReducerFlags = 'FullUpdate';"); + writeln!(out, "{reducer_function_name}(flags: CallReducerFlags) {{"); + out.with_indent(|out| { + writeln!(out, "this.{reducer_function_name}Flags = flags;"); + }); + writeln!(out, "}}"); + out.newline(); + } + + out.dedent(1); + writeln!(out, "}}"); +} + fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) { writeln!(out, "export class RemoteTables {{"); out.indent(1); @@ -533,7 +562,7 @@ fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) { fn print_db_connection(_module: &ModuleDef, out: &mut Indenter) { writeln!( out, - "export class DBConnection extends DBConnectionImpl {{" + "export class DBConnection extends DBConnectionImpl {{" ); out.indent(1); writeln!(out, "static builder = (): DBConnectionBuilder => {{"); @@ -575,6 +604,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) { "DBConnectionBuilder", "TableCache", "BinaryWriter", + "CallReducerFlags", "EventContextInterface", "BinaryReader", "DBConnectionImpl", diff --git a/crates/cli/src/subcommands/subscribe.rs b/crates/cli/src/subcommands/subscribe.rs index 29cbf984e81..ca67d8d0e62 100644 --- a/crates/cli/src/subcommands/subscribe.rs +++ b/crates/cli/src/subcommands/subscribe.rs @@ -196,6 +196,8 @@ where S: TryStream + Unpin, S::Error: std::error::Error + Send + Sync + 'static, { + const RECV_TX_UPDATE: &str = "protocol error: received transaction update before initial subscription update"; + while let Some(msg) = ws.try_next().await? { let Some(msg) = parse_msg_json(&msg) else { continue }; match msg { @@ -207,12 +209,12 @@ where } break; } - ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { status, .. }) => { - let message = match status { - ws::UpdateStatus::Failed(msg) => msg, - _ => "protocol error: received transaction update before initial subscription update".into(), - }; - anyhow::bail!(message) + ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { status, .. }) => anyhow::bail!(match status { + ws::UpdateStatus::Failed(msg) => msg, + _ => RECV_TX_UPDATE.into(), + }), + ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { .. }) => { + anyhow::bail!(RECV_TX_UPDATE) } _ => continue, } @@ -248,7 +250,8 @@ where ws::ServerMessage::InitialSubscription(_) => { anyhow::bail!("protocol error: received a second initial subscription update") } - ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { + ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { update, .. }) + | ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { status: ws::UpdateStatus::Committed(update), .. }) => { diff --git a/crates/cli/tests/snapshots/codegen__codegen_csharp.snap b/crates/cli/tests/snapshots/codegen__codegen_csharp.snap index 2095776370a..686b9144c81 100644 --- a/crates/cli/tests/snapshots/codegen__codegen_csharp.snap +++ b/crates/cli/tests/snapshots/codegen__codegen_csharp.snap @@ -880,13 +880,14 @@ namespace SpacetimeDB public sealed class RemoteReducers : RemoteBase { - internal RemoteReducers(DbConnection conn) : base(conn) {} + internal RemoteReducers(DbConnection conn, SetReducerFlags SetReducerFlags) : base(conn) { this.SetCallReducerFlags = SetReducerFlags; } + internal readonly SetReducerFlags SetCallReducerFlags; public delegate void AddPlayerHandler(EventContext ctx, string name); public event AddPlayerHandler? OnAddPlayer; public void AddPlayer(string name) { - conn.InternalCallReducer(new AddPlayer { Name = name }); + conn.InternalCallReducer(new AddPlayer { Name = name }, this.SetCallReducerFlags.AddPlayerFlags); } public bool InvokeAddPlayer(EventContext ctx, AddPlayer args) @@ -903,7 +904,7 @@ namespace SpacetimeDB public void AddPrivate(string name) { - conn.InternalCallReducer(new AddPrivate { Name = name }); + conn.InternalCallReducer(new AddPrivate { Name = name }, this.SetCallReducerFlags.AddPrivateFlags); } public bool InvokeAddPrivate(EventContext ctx, AddPrivate args) @@ -920,7 +921,7 @@ namespace SpacetimeDB public void DeletePlayer(ulong id) { - conn.InternalCallReducer(new DeletePlayer { Id = id }); + conn.InternalCallReducer(new DeletePlayer { Id = id }, this.SetCallReducerFlags.DeletePlayerFlags); } public bool InvokeDeletePlayer(EventContext ctx, DeletePlayer args) @@ -937,7 +938,7 @@ namespace SpacetimeDB public void DeletePlayersByName(string name) { - conn.InternalCallReducer(new DeletePlayersByName { Name = name }); + conn.InternalCallReducer(new DeletePlayersByName { Name = name }, this.SetCallReducerFlags.DeletePlayersByNameFlags); } public bool InvokeDeletePlayersByName(EventContext ctx, DeletePlayersByName args) @@ -954,7 +955,7 @@ namespace SpacetimeDB public void QueryPrivate() { - conn.InternalCallReducer(new QueryPrivate { }); + conn.InternalCallReducer(new QueryPrivate { }, this.SetCallReducerFlags.QueryPrivateFlags); } public bool InvokeQueryPrivate(EventContext ctx, QueryPrivate args) @@ -970,7 +971,7 @@ namespace SpacetimeDB public void RepeatingTest(SpacetimeDB.RepeatingTestArg arg) { - conn.InternalCallReducer(new RepeatingTest { Arg = arg }); + conn.InternalCallReducer(new RepeatingTest { Arg = arg }, this.SetCallReducerFlags.RepeatingTestFlags); } public bool InvokeRepeatingTest(EventContext ctx, RepeatingTest args) @@ -987,7 +988,7 @@ namespace SpacetimeDB public void Test(SpacetimeDB.TestA arg, SpacetimeDB.TestB arg2, SpacetimeDB.Namespace.Types.TestC arg3, SpacetimeDB.Namespace.TestF arg4) { - conn.InternalCallReducer(new Test { Arg = arg, Arg2 = arg2, Arg3 = arg3, Arg4 = arg4 }); + conn.InternalCallReducer(new Test { Arg = arg, Arg2 = arg2, Arg3 = arg3, Arg4 = arg4 }, this.SetCallReducerFlags.TestFlags); } public bool InvokeTest(EventContext ctx, Test args) @@ -1007,7 +1008,7 @@ namespace SpacetimeDB public void TestBtreeIndexArgs() { - conn.InternalCallReducer(new TestBtreeIndexArgs { }); + conn.InternalCallReducer(new TestBtreeIndexArgs { }, this.SetCallReducerFlags.TestBtreeIndexArgsFlags); } public bool InvokeTestBtreeIndexArgs(EventContext ctx, TestBtreeIndexArgs args) @@ -1020,14 +1021,37 @@ namespace SpacetimeDB } } + public sealed class SetReducerFlags + { + internal SetReducerFlags() { } + internal CallReducerFlags AddPlayerFlags; + public void AddPlayer(CallReducerFlags flags) { this.AddPlayerFlags = flags; } + internal CallReducerFlags AddPrivateFlags; + public void AddPrivate(CallReducerFlags flags) { this.AddPrivateFlags = flags; } + internal CallReducerFlags DeletePlayerFlags; + public void DeletePlayer(CallReducerFlags flags) { this.DeletePlayerFlags = flags; } + internal CallReducerFlags DeletePlayersByNameFlags; + public void DeletePlayersByName(CallReducerFlags flags) { this.DeletePlayersByNameFlags = flags; } + internal CallReducerFlags QueryPrivateFlags; + public void QueryPrivate(CallReducerFlags flags) { this.QueryPrivateFlags = flags; } + internal CallReducerFlags RepeatingTestFlags; + public void RepeatingTest(CallReducerFlags flags) { this.RepeatingTestFlags = flags; } + internal CallReducerFlags TestFlags; + public void Test(CallReducerFlags flags) { this.TestFlags = flags; } + internal CallReducerFlags TestBtreeIndexArgsFlags; + public void TestBtreeIndexArgs(CallReducerFlags flags) { this.TestBtreeIndexArgsFlags = flags; } + } + public partial record EventContext : DbContext, IEventContext { public readonly RemoteReducers Reducers; + public readonly SetReducerFlags SetReducerFlags; public readonly Event Event; internal EventContext(DbConnection conn, Event reducerEvent) : base(conn.Db) { Reducers = conn.Reducers; + SetReducerFlags = conn.SetReducerFlags; Event = reducerEvent; } } @@ -1050,10 +1074,12 @@ namespace SpacetimeDB { public readonly RemoteTables Db = new(); public readonly RemoteReducers Reducers; + public readonly SetReducerFlags SetReducerFlags; public DbConnection() { - Reducers = new(this); + SetReducerFlags = new(); + Reducers = new(this, this.SetReducerFlags); clientDB.AddTable("has_special_stuff", Db.HasSpecialStuff); clientDB.AddTable("pk_multi_identity", Db.PkMultiIdentity); diff --git a/crates/cli/tests/snapshots/codegen__codegen_rust.snap b/crates/cli/tests/snapshots/codegen__codegen_rust.snap index fb933f772ff..213ea25df70 100644 --- a/crates/cli/tests/snapshots/codegen__codegen_rust.snap +++ b/crates/cli/tests/snapshots/codegen__codegen_rust.snap @@ -75,6 +75,26 @@ impl add_player for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `add_player`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_add_player { + /// Set the call-reducer flags for the reducer `add_player` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn add_player(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_add_player for super::SetReducerFlags { + fn add_player(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("add_player", flags); + } +} + ''' "add_private_reducer.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -149,6 +169,26 @@ impl add_private for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `add_private`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_add_private { + /// Set the call-reducer flags for the reducer `add_private` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn add_private(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_add_private for super::SetReducerFlags { + fn add_private(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("add_private", flags); + } +} + ''' "baz_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -248,6 +288,26 @@ impl delete_player for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_player`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_player { + /// Set the call-reducer flags for the reducer `delete_player` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_player(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_player for super::SetReducerFlags { + fn delete_player(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_player", flags); + } +} + ''' "delete_players_by_name_reducer.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -322,6 +382,26 @@ impl delete_players_by_name for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_players_by_name`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_players_by_name { + /// Set the call-reducer flags for the reducer `delete_players_by_name` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_players_by_name(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_players_by_name for super::SetReducerFlags { + fn delete_players_by_name(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_players_by_name", flags); + } +} + ''' "foobar_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -541,6 +621,26 @@ impl identity_connected for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__identity_connected__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_identity_connected { + /// Set the call-reducer flags for the reducer `__identity_connected__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn identity_connected(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_identity_connected for super::SetReducerFlags { + fn identity_connected(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__identity_connected__", flags); + } +} + ''' "init_reducer.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -612,6 +712,26 @@ impl init for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__init__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_init { + /// Set the call-reducer flags for the reducer `__init__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn init(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_init for super::SetReducerFlags { + fn init(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__init__", flags); + } +} + ''' "mod.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -851,6 +971,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule { type Reducer = Reducer; type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; type DbUpdate = DbUpdate; type SubscriptionHandle = SubscriptionHandle; } @@ -865,6 +986,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers { type Module = RemoteModule; } +#[doc(hidden)] +/// The `set_reducer_flags` field of [`DbConnection`], +/// with methods provided by extension traits for each reducer defined by the module. +/// Each method sets the flags for the reducer with the same name. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub struct SetReducerFlags { + imp: __sdk::db_connection::DbContextImpl, +} + +impl __sdk::spacetime_module::InModule for SetReducerFlags { + type Module = RemoteModule; +} + /// The `db` field of [`EventContext`] and [`DbConnection`], /// with methods provided by extension traits for each table defined by the module. pub struct RemoteTables { @@ -896,6 +1031,12 @@ pub struct DbConnection { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + #[doc(hidden)] + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, imp: __sdk::db_connection::DbContextImpl, } @@ -907,6 +1048,7 @@ impl __sdk::spacetime_module::InModule for DbConnection { impl __sdk::db_context::DbContext for DbConnection { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -914,6 +1056,9 @@ impl __sdk::db_context::DbContext for DbConnection { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -1013,6 +1158,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, imp, } } @@ -1025,6 +1171,11 @@ pub struct EventContext { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, /// The event which caused these callbacks to run. pub event: __sdk::event::Event, imp: __sdk::db_connection::DbContextImpl, @@ -1037,6 +1188,7 @@ impl __sdk::spacetime_module::InModule for EventContext { impl __sdk::db_context::DbContext for EventContext { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -1044,6 +1196,9 @@ impl __sdk::db_context::DbContext for EventContext { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -1075,6 +1230,7 @@ impl __sdk::spacetime_module::EventContext for EventContext { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, event, imp, } @@ -1105,11 +1261,13 @@ impl __sdk::spacetime_module::SubscriptionHandle for SubscriptionHandle { pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, > {} impl, >> RemoteDbContext for Ctx {} @@ -1669,6 +1827,26 @@ impl query_private for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `query_private`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_query_private { + /// Set the call-reducer flags for the reducer `query_private` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn query_private(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_query_private for super::SetReducerFlags { + fn query_private(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("query_private", flags); + } +} + ''' "repeating_test_arg_table.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1910,6 +2088,26 @@ impl repeating_test for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `repeating_test`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_repeating_test { + /// Set the call-reducer flags for the reducer `repeating_test` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn repeating_test(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_repeating_test for super::SetReducerFlags { + fn repeating_test(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("repeating_test", flags); + } +} + ''' "test_a_table.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -2123,6 +2321,26 @@ impl test_btree_index_args for super::RemoteReducers { } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `test_btree_index_args`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_test_btree_index_args { + /// Set the call-reducer flags for the reducer `test_btree_index_args` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn test_btree_index_args(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_test_btree_index_args for super::SetReducerFlags { + fn test_btree_index_args(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("test_btree_index_args", flags); + } +} + ''' "test_d_table.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -2609,4 +2827,24 @@ arg_4: NamespaceTestF, } } +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `test`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_test { + /// Set the call-reducer flags for the reducer `test` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn test(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_test for super::SetReducerFlags { + fn test(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("test", flags); + } +} + ''' diff --git a/crates/cli/tests/snapshots/codegen__codegen_typescript.snap b/crates/cli/tests/snapshots/codegen__codegen_typescript.snap index 11ca97edb36..f5bfd4c6a3a 100644 --- a/crates/cli/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/cli/tests/snapshots/codegen__codegen_typescript.snap @@ -18,6 +18,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -88,6 +90,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -158,6 +162,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -228,6 +234,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -298,6 +306,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -368,6 +378,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -454,6 +466,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -540,6 +554,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -612,6 +628,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -679,6 +697,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -871,8 +891,11 @@ const REMOTE_MODULE = { dbViewConstructor: (imp: DBConnectionImpl) => { return new RemoteTables(imp); }, - reducersConstructor: (imp: DBConnectionImpl) => { - return new RemoteReducers(imp); + reducersConstructor: (imp: DBConnectionImpl, setReducerFlags: SetReducerFlags) => { + return new RemoteReducers(imp, setReducerFlags); + }, + setReducerFlagsConstructor: () => { + return new SetReducerFlags(); } } @@ -891,10 +914,10 @@ export type Reducer = never ; export class RemoteReducers { - constructor(private connection: DBConnectionImpl) {} + constructor(private connection: DBConnectionImpl, private setCallReducerFlags: SetReducerFlags) {} identityConnected() { - this.connection.callReducer("__identity_connected__", new Uint8Array(0)); + this.connection.callReducer("__identity_connected__", new Uint8Array(0), this.setCallReducerFlags.identityConnectedFlags); } onIdentityConnected(callback: (ctx: EventContext) => void) { @@ -906,7 +929,7 @@ export class RemoteReducers { } init() { - this.connection.callReducer("__init__", new Uint8Array(0)); + this.connection.callReducer("__init__", new Uint8Array(0), this.setCallReducerFlags.initFlags); } onInit(callback: (ctx: EventContext) => void) { @@ -922,7 +945,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); AddPlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("add_player", __argsBuffer); + this.connection.callReducer("add_player", __argsBuffer, this.setCallReducerFlags.addPlayerFlags); } onAddPlayer(callback: (ctx: EventContext, name: string) => void) { @@ -938,7 +961,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); AddPrivate.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("add_private", __argsBuffer); + this.connection.callReducer("add_private", __argsBuffer, this.setCallReducerFlags.addPrivateFlags); } onAddPrivate(callback: (ctx: EventContext, name: string) => void) { @@ -954,7 +977,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); DeletePlayer.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("delete_player", __argsBuffer); + this.connection.callReducer("delete_player", __argsBuffer, this.setCallReducerFlags.deletePlayerFlags); } onDeletePlayer(callback: (ctx: EventContext, id: bigint) => void) { @@ -970,7 +993,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); DeletePlayersByName.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("delete_players_by_name", __argsBuffer); + this.connection.callReducer("delete_players_by_name", __argsBuffer, this.setCallReducerFlags.deletePlayersByNameFlags); } onDeletePlayersByName(callback: (ctx: EventContext, name: string) => void) { @@ -982,7 +1005,7 @@ export class RemoteReducers { } queryPrivate() { - this.connection.callReducer("query_private", new Uint8Array(0)); + this.connection.callReducer("query_private", new Uint8Array(0), this.setCallReducerFlags.queryPrivateFlags); } onQueryPrivate(callback: (ctx: EventContext) => void) { @@ -998,7 +1021,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); RepeatingTest.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("repeating_test", __argsBuffer); + this.connection.callReducer("repeating_test", __argsBuffer, this.setCallReducerFlags.repeatingTestFlags); } onRepeatingTest(callback: (ctx: EventContext, arg: RepeatingTestArg) => void) { @@ -1014,7 +1037,7 @@ export class RemoteReducers { let __writer = new BinaryWriter(1024); Test.getTypeScriptAlgebraicType().serialize(__writer, __args); let __argsBuffer = __writer.getBuffer(); - this.connection.callReducer("test", __argsBuffer); + this.connection.callReducer("test", __argsBuffer, this.setCallReducerFlags.testFlags); } onTest(callback: (ctx: EventContext, arg: TestA, arg2: TestB, arg3: NamespaceTestC, arg4: NamespaceTestF) => void) { @@ -1026,7 +1049,7 @@ export class RemoteReducers { } testBtreeIndexArgs() { - this.connection.callReducer("test_btree_index_args", new Uint8Array(0)); + this.connection.callReducer("test_btree_index_args", new Uint8Array(0), this.setCallReducerFlags.testBtreeIndexArgsFlags); } onTestBtreeIndexArgs(callback: (ctx: EventContext) => void) { @@ -1039,6 +1062,59 @@ export class RemoteReducers { } +export class SetReducerFlags { + identityConnectedFlags: CallReducerFlags = 'FullUpdate'; + identityConnected(flags: CallReducerFlags) { + this.identityConnectedFlags = flags; + } + + initFlags: CallReducerFlags = 'FullUpdate'; + init(flags: CallReducerFlags) { + this.initFlags = flags; + } + + addPlayerFlags: CallReducerFlags = 'FullUpdate'; + addPlayer(flags: CallReducerFlags) { + this.addPlayerFlags = flags; + } + + addPrivateFlags: CallReducerFlags = 'FullUpdate'; + addPrivate(flags: CallReducerFlags) { + this.addPrivateFlags = flags; + } + + deletePlayerFlags: CallReducerFlags = 'FullUpdate'; + deletePlayer(flags: CallReducerFlags) { + this.deletePlayerFlags = flags; + } + + deletePlayersByNameFlags: CallReducerFlags = 'FullUpdate'; + deletePlayersByName(flags: CallReducerFlags) { + this.deletePlayersByNameFlags = flags; + } + + queryPrivateFlags: CallReducerFlags = 'FullUpdate'; + queryPrivate(flags: CallReducerFlags) { + this.queryPrivateFlags = flags; + } + + repeatingTestFlags: CallReducerFlags = 'FullUpdate'; + repeatingTest(flags: CallReducerFlags) { + this.repeatingTestFlags = flags; + } + + testFlags: CallReducerFlags = 'FullUpdate'; + test(flags: CallReducerFlags) { + this.testFlags = flags; + } + + testBtreeIndexArgsFlags: CallReducerFlags = 'FullUpdate'; + testBtreeIndexArgs(flags: CallReducerFlags) { + this.testBtreeIndexArgsFlags = flags; + } + +} + export class RemoteTables { constructor(private connection: DBConnectionImpl) {} @@ -1079,13 +1155,13 @@ export class RemoteTables { } } -export class DBConnection extends DBConnectionImpl { +export class DBConnection extends DBConnectionImpl { static builder = (): DBConnectionBuilder => { return new DBConnectionBuilder(REMOTE_MODULE, (imp: DBConnectionImpl) => imp as DBConnection); } } -export type EventContext = EventContextInterface; +export type EventContext = EventContextInterface; ''' "init_reducer.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1103,6 +1179,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1170,6 +1248,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1250,6 +1330,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1333,6 +1415,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1471,6 +1555,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1543,6 +1629,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1615,6 +1703,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1701,6 +1791,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1787,6 +1879,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1857,6 +1951,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -1924,6 +2020,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2040,6 +2138,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2114,6 +2214,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2187,6 +2289,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2273,6 +2377,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2347,6 +2453,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2417,6 +2525,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2484,6 +2594,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2573,6 +2685,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2646,6 +2760,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2762,6 +2878,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2834,6 +2952,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2923,6 +3043,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, @@ -2996,6 +3118,8 @@ import { // @ts-ignore BinaryWriter, // @ts-ignore + CallReducerFlags, + // @ts-ignore DBConnectionBuilder, // @ts-ignore DBConnectionImpl, diff --git a/crates/client-api-messages/src/websocket.rs b/crates/client-api-messages/src/websocket.rs index 00446959f7a..dcd87313543 100644 --- a/crates/client-api-messages/src/websocket.rs +++ b/crates/client-api-messages/src/websocket.rs @@ -28,9 +28,10 @@ use spacetimedb_lib::{Address, Identity}; use spacetimedb_primitives::TableId; use spacetimedb_sats::{ bsatn::{self, ToBsatn}, - de::Deserialize, + de::{Deserialize, Error}, + impl_deserialize, impl_serialize, impl_st, ser::{serde::SerializeWrapper, Serialize}, - SpacetimeType, + AlgebraicType, SpacetimeType, }; use std::{ io::{self, Read as _, Write as _}, @@ -98,10 +99,12 @@ impl ClientMessage { reducer, args, request_id, + flags, }) => ClientMessage::CallReducer(CallReducer { reducer, args: f(args), request_id, + flags, }), ClientMessage::Subscribe(x) => ClientMessage::Subscribe(x), ClientMessage::OneOffQuery(x) => ClientMessage::OneOffQuery(x), @@ -126,8 +129,39 @@ pub struct CallReducer { /// /// The server will include the same ID in the response [`TransactionUpdate`]. pub request_id: u32, + /// Assorted flags that can be passed when calling a reducer. + /// + /// Currently accepts 0 or 1 where the latter means + /// that the caller does not want to be notified about the reducer + /// without being subscribed to any relevant queries. + pub flags: CallReducerFlags, } +#[derive(Clone, Copy, Default, PartialEq, Eq)] +pub enum CallReducerFlags { + /// The reducer's caller does want to be notified about the reducer completing successfully + /// regardless of whether the caller had subscribed to a relevant query. + /// + /// Note that updates to a reducer's caller are always sent as full updates + /// whether subscribed to a relevant query or not. + /// That is, the light tx mode setting does not apply to the reducer's caller. + /// + /// This is the default flag. + #[default] + FullUpdate, + /// The reducer's caller does not want to be notified about the reducer completing successfully + /// without having subscribed to any of the relevant queries. + NoSuccessNotify, +} + +impl_st!([] CallReducerFlags, AlgebraicType::U8); +impl_serialize!([] CallReducerFlags, (self, ser) => ser.serialize_u8(*self as u8)); +impl_deserialize!([] CallReducerFlags, de => match de.deserialize_u8()? { + 0 => Ok(Self::FullUpdate), + 1 => Ok(Self::NoSuccessNotify), + x => Err(D::Error::custom(format_args!("invalid call reducer flag {x}"))), +}); + /// Sent by client to database to register a set of queries, about which the client will /// receive `TransactionUpdate`s. /// @@ -182,6 +216,8 @@ pub enum ServerMessage { InitialSubscription(InitialSubscription), /// Upon reducer run. TransactionUpdate(TransactionUpdate), + /// Upon reducer run, but limited to just the table updates. + TransactionUpdateLight(TransactionUpdateLight), /// After connecting, to inform client of its identity. IdentityToken(IdentityToken), /// Return results to a one off SQL query. @@ -252,6 +288,22 @@ pub struct TransactionUpdate { pub host_execution_duration_micros: u64, } +/// Received by client from database upon a reducer run. +/// +/// Clients receive `TransactionUpdateLight`s only for reducers +/// which update at least one of their subscribed rows. +/// Failed reducers result in full [`TransactionUpdate`]s +#[derive(SpacetimeType, Debug)] +#[sats(crate = spacetimedb_lib)] +pub struct TransactionUpdateLight { + /// An identifier for a client request + pub request_id: u32, + + /// The reducer ran successfully and its changes were committed to the database. + /// The rows altered in the database/ are recorded in this `DatabaseUpdate`. + pub update: DatabaseUpdate, +} + /// Contained in a [`TransactionUpdate`], metadata about a reducer invocation. #[derive(SpacetimeType, Debug)] #[sats(crate = spacetimedb_lib)] diff --git a/crates/client-api/src/routes/subscribe.rs b/crates/client-api/src/routes/subscribe.rs index f9a931bf17a..4368e49d291 100644 --- a/crates/client-api/src/routes/subscribe.rs +++ b/crates/client-api/src/routes/subscribe.rs @@ -13,7 +13,7 @@ use http::{HeaderValue, StatusCode}; use scopeguard::ScopeGuard; use serde::Deserialize; use spacetimedb::client::messages::{serialize, IdentityTokenMessage, SerializableMessage}; -use spacetimedb::client::{ClientActorId, ClientConnection, DataMessage, MessageHandleError, Protocol}; +use spacetimedb::client::{ClientActorId, ClientConfig, ClientConnection, DataMessage, MessageHandleError, Protocol}; use spacetimedb::host::NoSuchModule; use spacetimedb::util::also_poll; use spacetimedb::worker_metrics::WORKER_METRICS; @@ -43,7 +43,12 @@ pub struct SubscribeParams { #[derive(Deserialize)] pub struct SubscribeQueryParams { pub client_address: Option, - pub compression: Option, + #[serde(default)] + pub compression: Compression, + /// Whether we want "light" responses, tailored to network bandwidth constrained clients. + /// This knob works by setting other, more specifc, knobs to the value. + #[serde(default)] + pub light: bool, } // TODO: is this a reasonable way to generate client addresses? @@ -60,6 +65,7 @@ pub async fn handle_websocket( Query(SubscribeQueryParams { client_address, compression, + light, }): Query, forwarded_for: Option>, Extension(auth): Extension, @@ -85,7 +91,11 @@ where ws.select_protocol([(BIN_PROTOCOL, Protocol::Binary), (TEXT_PROTOCOL, Protocol::Text)]); let protocol = protocol.ok_or((StatusCode::BAD_REQUEST, "no valid protocol selected"))?; - let compression = compression.unwrap_or_default(); + let client_config = ClientConfig { + protocol, + compression, + tx_update_full: !light, + }; // TODO: Should also maybe refactor the code and the protocol to allow a single websocket // to connect to multiple modules @@ -137,8 +147,7 @@ where } let actor = |client, sendrx| ws_client_actor(client, ws, sendrx); - let client = match ClientConnection::spawn(client_id, protocol, compression, replica_id, module_rx, actor).await - { + let client = match ClientConnection::spawn(client_id, client_config, replica_id, module_rx, actor).await { Ok(s) => s, Err(e) => { log::warn!("ModuleHost died while we were connecting: {e:#}"); @@ -266,7 +275,7 @@ async fn ws_client_actor_inner( let workload = msg.workload(); let num_rows = msg.num_rows(); - let msg = datamsg_to_wsmsg(serialize(msg, client.protocol, client.compression)); + let msg = datamsg_to_wsmsg(serialize(msg, client.config)); // These metrics should be updated together, // or not at all. @@ -354,7 +363,7 @@ async fn ws_client_actor_inner( if let Err(e) = res { if let MessageHandleError::Execution(err) = e { log::error!("{err:#}"); - let msg = serialize(err, client.protocol, client.compression); + let msg = serialize(err, client.config); if let Err(error) = ws.send(datamsg_to_wsmsg(msg)).await { log::warn!("Websocket send error: {error}") } diff --git a/crates/core/src/client.rs b/crates/core/src/client.rs index 68465e0ea5b..dc86c99a907 100644 --- a/crates/core/src/client.rs +++ b/crates/core/src/client.rs @@ -6,7 +6,9 @@ mod client_connection_index; mod message_handlers; pub mod messages; -pub use client_connection::{ClientConnection, ClientConnectionSender, ClientSendError, DataMessage, Protocol}; +pub use client_connection::{ + ClientConfig, ClientConnection, ClientConnectionSender, ClientSendError, DataMessage, Protocol, +}; pub use client_connection_index::ClientActorIndex; pub use message_handlers::MessageHandleError; use spacetimedb_lib::Address; diff --git a/crates/core/src/client/client_connection.rs b/crates/core/src/client/client_connection.rs index eeea9c31a3f..fb646581a79 100644 --- a/crates/core/src/client/client_connection.rs +++ b/crates/core/src/client/client_connection.rs @@ -12,7 +12,7 @@ use crate::util::prometheus_handle::IntGaugeExt; use crate::worker_metrics::WORKER_METRICS; use derive_more::From; use futures::prelude::*; -use spacetimedb_client_api_messages::websocket::{Compression, FormatSwitch}; +use spacetimedb_client_api_messages::websocket::{CallReducerFlags, Compression, FormatSwitch}; use spacetimedb_lib::identity::RequestId; use tokio::sync::{mpsc, oneshot, watch}; use tokio::task::AbortHandle; @@ -32,11 +32,32 @@ impl Protocol { } } +#[derive(Clone, Copy, Debug)] +pub struct ClientConfig { + /// The client's desired protocol (format) when the host replies. + pub protocol: Protocol, + /// The client's desired (conditional) compression algorithm, if any. + pub compression: Compression, + /// Whether the client prefers full [`TransactionUpdate`]s + /// rather than [`TransactionUpdateLight`]s on a successful update. + // TODO(centril): As more knobs are added, make this into a bitfield (when there's time). + pub tx_update_full: bool, +} + +impl ClientConfig { + pub fn for_test() -> ClientConfig { + Self { + protocol: Protocol::Binary, + compression: <_>::default(), + tx_update_full: true, + } + } +} + #[derive(Debug)] pub struct ClientConnectionSender { pub id: ClientActorId, - pub protocol: Protocol, - pub compression: Compression, + pub config: ClientConfig, sendtx: mpsc::Sender, abort_handle: AbortHandle, cancelled: AtomicBool, @@ -51,7 +72,7 @@ pub enum ClientSendError { } impl ClientConnectionSender { - pub fn dummy_with_channel(id: ClientActorId, protocol: Protocol) -> (Self, mpsc::Receiver) { + pub fn dummy_with_channel(id: ClientActorId, config: ClientConfig) -> (Self, mpsc::Receiver) { let (sendtx, rx) = mpsc::channel(1); // just make something up, it doesn't need to be attached to a real task let abort_handle = match tokio::runtime::Handle::try_current() { @@ -61,8 +82,7 @@ impl ClientConnectionSender { ( Self { id, - protocol, - compression: Compression::Brotli, + config, sendtx, abort_handle, cancelled: AtomicBool::new(false), @@ -71,8 +91,8 @@ impl ClientConnectionSender { ) } - pub fn dummy(id: ClientActorId, protocol: Protocol) -> Self { - Self::dummy_with_channel(id, protocol).0 + pub fn dummy(id: ClientActorId, config: ClientConfig) -> Self { + Self::dummy_with_channel(id, config).0 } pub fn send_message(&self, message: impl Into) -> Result<(), ClientSendError> { @@ -142,16 +162,14 @@ const KB: usize = 1024; impl ClientConnection { /// Returns an error if ModuleHost closed - pub async fn spawn( + pub async fn spawn( id: ClientActorId, - protocol: Protocol, - compression: Compression, + config: ClientConfig, replica_id: u64, mut module_rx: watch::Receiver, - actor: F, + actor: impl FnOnce(ClientConnection, mpsc::Receiver) -> Fut, ) -> Result where - F: FnOnce(ClientConnection, mpsc::Receiver) -> Fut, Fut: Future + Send + 'static, { // Add this client as a subscriber @@ -180,8 +198,7 @@ impl ClientConnection { let sender = Arc::new(ClientConnectionSender { id, - protocol, - compression, + config, sendtx, abort_handle, cancelled: AtomicBool::new(false), @@ -202,13 +219,13 @@ impl ClientConnection { pub fn dummy( id: ClientActorId, - protocol: Protocol, + config: ClientConfig, replica_id: u64, mut module_rx: watch::Receiver, ) -> Self { let module = module_rx.borrow_and_update().clone(); Self { - sender: Arc::new(ClientConnectionSender::dummy(id, protocol)), + sender: Arc::new(ClientConnectionSender::dummy(id, config)), replica_id, module, module_rx, @@ -244,12 +261,20 @@ impl ClientConnection { args: ReducerArgs, request_id: RequestId, timer: Instant, + flags: CallReducerFlags, ) -> Result { + let caller = match flags { + CallReducerFlags::FullUpdate => Some(self.sender()), + // Setting `sender = None` causes `eval_updates` to skip sending to the caller + // as it has no access to the caller other than by id/addr. + CallReducerFlags::NoSuccessNotify => None, + }; + self.module .call_reducer( self.id.identity, Some(self.id.address), - Some(self.sender()), + caller, Some(request_id), Some(timer), reducer, diff --git a/crates/core/src/client/message_handlers.rs b/crates/core/src/client/message_handlers.rs index b2461ccdf91..af59b101602 100644 --- a/crates/core/src/client/message_handlers.rs +++ b/crates/core/src/client/message_handlers.rs @@ -64,8 +64,9 @@ pub async fn handle(client: &ClientConnection, message: DataMessage, timer: Inst ref reducer, args, request_id, + flags, }) => { - let res = client.call_reducer(reducer, args, request_id, timer).await; + let res = client.call_reducer(reducer, args, request_id, timer, flags).await; WORKER_METRICS .request_round_trip .with_label_values(&WorkloadType::Reducer, &address, reducer) @@ -144,7 +145,7 @@ impl ToProtocol for MessageExecutionError { type Encoded = SwitchedServerMessage; fn to_protocol(self, protocol: super::Protocol) -> Self::Encoded { TransactionUpdateMessage { - event: Arc::new(self.into_event()), + event: Some(Arc::new(self.into_event())), database_update: SubscriptionUpdateMessage::default_for_protocol(protocol, None), } .to_protocol(protocol) diff --git a/crates/core/src/client/messages.rs b/crates/core/src/client/messages.rs index 372f0cb8e79..eacc330ebf4 100644 --- a/crates/core/src/client/messages.rs +++ b/crates/core/src/client/messages.rs @@ -1,4 +1,4 @@ -use super::{DataMessage, Protocol}; +use super::{ClientConfig, DataMessage, Protocol}; use crate::execution_context::WorkloadType; use crate::host::module_host::{EventStatus, ModuleEvent}; use crate::host::ArgsTuple; @@ -25,19 +25,16 @@ pub trait ToProtocol { } pub(super) type SwitchedServerMessage = FormatSwitch, ws::ServerMessage>; +pub(super) type SwitchedDbUpdate = FormatSwitch, ws::DatabaseUpdate>; /// Serialize `msg` into a [`DataMessage`] containing a [`ws::ServerMessage`]. /// /// If `protocol` is [`Protocol::Binary`], /// the message will be conditionally compressed by this method according to `compression`. -pub fn serialize( - msg: impl ToProtocol, - protocol: Protocol, - compression: Compression, -) -> DataMessage { +pub fn serialize(msg: impl ToProtocol, config: ClientConfig) -> DataMessage { // TODO(centril, perf): here we are allocating buffers only to throw them away eventually. // Consider pooling these allocations so that we reuse them. - match msg.to_protocol(protocol) { + match msg.to_protocol(config.protocol) { FormatSwitch::Json(msg) => serde_json::to_string(&SerializeWrapper::new(msg)).unwrap().into(), FormatSwitch::Bsatn(msg) => { // First write the tag so that we avoid shifting the entire message at the end. @@ -46,7 +43,7 @@ pub fn serialize( // Conditionally compress the message. let srv_msg = &msg_bytes[1..]; - let msg_bytes = match ws::decide_compression(srv_msg.len(), compression) { + let msg_bytes = match ws::decide_compression(srv_msg.len(), config.compression) { Compression::None => msg_bytes, Compression::Brotli => { let mut out = vec![SERVER_MSG_COMPRESSION_TAG_BROTLI]; @@ -118,7 +115,9 @@ impl ToProtocol for IdentityTokenMessage { #[derive(Debug)] pub struct TransactionUpdateMessage { - pub event: Arc, + /// The event that caused this update. + /// When `None`, this is a light update. + pub event: Option>, pub database_update: SubscriptionUpdateMessage, } @@ -132,13 +131,17 @@ impl ToProtocol for TransactionUpdateMessage { type Encoded = SwitchedServerMessage; fn to_protocol(self, protocol: Protocol) -> Self::Encoded { fn convert( - event: Arc, - request_id: Option, - upd: ws::DatabaseUpdate, + event: Option>, + request_id: u32, + update: ws::DatabaseUpdate, conv_args: impl FnOnce(&ArgsTuple) -> F::Single, ) -> ws::ServerMessage { + let Some(event) = event else { + return ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { request_id, update }); + }; + let status = match &event.status { - EventStatus::Committed(_) => ws::UpdateStatus::Committed(upd), + EventStatus::Committed(_) => ws::UpdateStatus::Committed(update), EventStatus::Failed(errmsg) => ws::UpdateStatus::Failed(errmsg.clone().into()), EventStatus::OutOfEnergy => ws::UpdateStatus::OutOfEnergy, }; @@ -153,7 +156,7 @@ impl ToProtocol for TransactionUpdateMessage { reducer_name: event.function_call.reducer.to_owned().into(), reducer_id: event.function_call.reducer_id.into(), args, - request_id: request_id.unwrap_or(0), + request_id, }, energy_quanta_used: event.energy_quanta_used, host_execution_duration_micros: event.host_execution_duration.as_micros() as u64, @@ -166,7 +169,7 @@ impl ToProtocol for TransactionUpdateMessage { let TransactionUpdateMessage { event, database_update } = self; let update = database_update.database_update; protocol.assert_matches_format_switch(&update); - let request_id = database_update.request_id; + let request_id = database_update.request_id.unwrap_or(0); match update { FormatSwitch::Bsatn(update) => FormatSwitch::Bsatn(convert(event, request_id, update, |args| { Vec::from(args.get_bsatn().clone()).into() @@ -180,7 +183,7 @@ impl ToProtocol for TransactionUpdateMessage { #[derive(Debug, Clone)] pub struct SubscriptionUpdateMessage { - pub database_update: FormatSwitch, ws::DatabaseUpdate>, + pub database_update: SwitchedDbUpdate, pub request_id: Option, pub timer: Option, } @@ -197,6 +200,14 @@ impl SubscriptionUpdateMessage { } } + pub(crate) fn from_event_and_update(event: &ModuleEvent, update: SwitchedDbUpdate) -> Self { + Self { + database_update: update, + request_id: event.request_id, + timer: event.timer, + } + } + fn num_rows(&self) -> usize { match &self.database_update { FormatSwitch::Bsatn(x) => x.num_rows(), diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index cb1c5be4907..5ee0d84cb5d 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -306,14 +306,13 @@ impl ModuleInstance for WasmModuleInstance { Some(reducer_id) => { self.system_logger().info("Invoking `init` reducer"); let caller_identity = self.replica_context().database.owner_identity; - let client = None; Some(self.call_reducer_with_tx( Some(tx), CallReducerParams { timestamp, caller_identity, caller_address: Address::__DUMMY, - client, + client: None, request_id: None, timer: None, reducer_id, diff --git a/crates/core/src/subscription/module_subscription_actor.rs b/crates/core/src/subscription/module_subscription_actor.rs index 9cce46c165e..dd0fec406af 100644 --- a/crates/core/src/subscription/module_subscription_actor.rs +++ b/crates/core/src/subscription/module_subscription_actor.rs @@ -122,18 +122,18 @@ impl ModuleSubscriptions { )?; let slow_query_threshold = StVarTable::sub_limit(&self.relational_db, &tx)?.map(Duration::from_millis); - let database_update = match sender.protocol { + let database_update = match sender.config.protocol { Protocol::Text => FormatSwitch::Json(execution_set.eval( &self.relational_db, &tx, slow_query_threshold, - sender.compression, + sender.config.compression, )), Protocol::Binary => FormatSwitch::Bsatn(execution_set.eval( &self.relational_db, &tx, slow_query_threshold, - sender.compression, + sender.config.compression, )), }; @@ -179,7 +179,7 @@ impl ModuleSubscriptions { /// Commit a transaction and broadcast its ModuleEvent to all interested subscribers. pub fn commit_and_broadcast_event( &self, - client: Option<&ClientConnectionSender>, + caller: Option<&ClientConnectionSender>, mut event: ModuleEvent, tx: MutTx, ) -> Result, WriteConflict>, DBError> { @@ -211,13 +211,13 @@ impl ModuleSubscriptions { match &event.status { EventStatus::Committed(_) => { let slow_query_threshold = StVarTable::incr_limit(stdb, &read_tx)?.map(Duration::from_millis); - subscriptions.eval_updates(stdb, &read_tx, event.clone(), client, slow_query_threshold) + subscriptions.eval_updates(stdb, &read_tx, event.clone(), caller, slow_query_threshold) } EventStatus::Failed(_) => { - if let Some(client) = client { + if let Some(client) = caller { let message = TransactionUpdateMessage { - event: event.clone(), - database_update: SubscriptionUpdateMessage::default_for_protocol(client.protocol, None), + event: Some(event.clone()), + database_update: SubscriptionUpdateMessage::default_for_protocol(client.config.protocol, None), }; let _ = client.send_message(message); } else { @@ -236,7 +236,7 @@ pub struct WriteConflict; #[cfg(test)] mod tests { use super::{AssertTxFn, ModuleSubscriptions}; - use crate::client::{ClientActorId, ClientConnectionSender, Protocol}; + use crate::client::{ClientActorId, ClientConfig, ClientConnectionSender}; use crate::db::relational_db::tests_utils::TestDB; use crate::db::relational_db::RelationalDB; use crate::error::DBError; @@ -253,7 +253,8 @@ mod tests { fn add_subscriber(db: Arc, sql: &str, assert: Option) -> Result<(), DBError> { let owner = Identity::from_byte_array([1; 32]); let client = ClientActorId::for_test(Identity::ZERO); - let sender = Arc::new(ClientConnectionSender::dummy(client, Protocol::Binary)); + let config = ClientConfig::for_test(); + let sender = Arc::new(ClientConnectionSender::dummy(client, config)); let module_subscriptions = ModuleSubscriptions::new(db.clone(), owner); let subscribe = Subscribe { diff --git a/crates/core/src/subscription/module_subscription_manager.rs b/crates/core/src/subscription/module_subscription_manager.rs index d1671293d86..3639a06589b 100644 --- a/crates/core/src/subscription/module_subscription_manager.rs +++ b/crates/core/src/subscription/module_subscription_manager.rs @@ -2,12 +2,12 @@ use super::execution_unit::{ExecutionUnit, QueryHash}; use crate::client::messages::{SubscriptionUpdateMessage, TransactionUpdateMessage}; use crate::client::{ClientConnectionSender, Protocol}; use crate::db::relational_db::{RelationalDB, Tx}; -use crate::host::module_host::{DatabaseTableUpdate, ModuleEvent}; +use crate::host::module_host::{DatabaseTableUpdate, ModuleEvent, UpdatesRelValue}; use crate::messages::websocket::{self as ws, TableUpdate}; use arrayvec::ArrayVec; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use spacetimedb_client_api_messages::websocket::{ - BsatnFormat, CompressableQueryUpdate, FormatSwitch, JsonFormat, QueryUpdate, + BsatnFormat, CompressableQueryUpdate, FormatSwitch, JsonFormat, QueryUpdate, WebsocketFormat, }; use spacetimedb_data_structures::map::{Entry, HashCollectionExt, HashMap, HashSet, IntMap}; use spacetimedb_lib::{Address, Identity}; @@ -21,6 +21,7 @@ use std::time::Duration; type Id = (Identity, Address); type Query = Arc; type Client = Arc; +type SwitchedDbUpdate = FormatSwitch, ws::DatabaseUpdate>; /// Responsible for the efficient evaluation of subscriptions. /// It performs basic multi-query optimization, @@ -121,7 +122,7 @@ impl SubscriptionManager { db: &RelationalDB, tx: &Tx, event: Arc, - sender_client: Option<&ClientConnectionSender>, + caller: Option<&ClientConnectionSender>, slow_query_threshold: Option, ) { use FormatSwitch::{Bsatn, Json}; @@ -144,7 +145,7 @@ impl SubscriptionManager { let span = tracing::info_span!("eval_incr").entered(); let tx = &tx.into(); - let eval = units + let mut eval = units .par_iter() .filter_map(|(&hash, tables)| { let unit = self.queries.get(hash)?; @@ -165,21 +166,24 @@ impl SubscriptionManager { // and the latter `Some(_)` if some subscriber uses `Protocol::Text`. let mut ops_bin: Option<(CompressableQueryUpdate, _)> = None; let mut ops_json: Option<(QueryUpdate, _)> = None; + + fn memo_encode( + updates: &UpdatesRelValue<'_>, + client: &ClientConnectionSender, + memory: &mut Option<(F::QueryUpdate, u64)>, + ) -> (F::QueryUpdate, u64) { + memory + .get_or_insert_with(|| updates.encode::(client.config.compression)) + .clone() + } + self.subscribers.get(hash).into_iter().flatten().map(move |id| { let client = &*self.clients[id]; - let ops = match client.protocol { - Protocol::Binary => Bsatn( - ops_bin - .get_or_insert_with(|| delta.updates.encode::(client.compression)) - .clone(), - ), - Protocol::Text => Json( - ops_json - .get_or_insert_with(|| delta.updates.encode::(client.compression)) - .clone(), - ), + let update = match client.config.protocol { + Protocol::Binary => Bsatn(memo_encode::(&delta.updates, client, &mut ops_bin)), + Protocol::Text => Json(memo_encode::(&delta.updates, client, &mut ops_json)), }; - (id, table_id, table_name.clone(), ops) + (id, table_id, table_name.clone(), update) }) }) .collect::>() @@ -210,7 +214,7 @@ impl SubscriptionManager { // So before sending the updates to each client, // we must stitch together the `TableUpdate*`s into an aggregated list. .fold( - HashMap::<&Id, FormatSwitch, ws::DatabaseUpdate<_>>>::new(), + HashMap::<&Id, SwitchedDbUpdate>::new(), |mut updates, ((id, _), update)| { let entry = updates.entry(id); let entry = entry.or_insert_with(|| match &update { @@ -228,38 +232,40 @@ impl SubscriptionManager { let _span = tracing::info_span!("eval_send").entered(); - if let Some((_, client)) = event - .caller_address - .zip(sender_client) - .filter(|(addr, _)| !eval.contains_key(&(event.caller_identity, *addr))) - { - // Caller is not subscribed to any queries, - // but send a transaction update with an empty subscription update. - let update = SubscriptionUpdateMessage::default_for_protocol(client.protocol, event.request_id); - send_to_client(client, &event, update); + // We might have a known caller that hasn't been hidden from here.. + // This caller may have subscribed to some query. + // If they haven't, we'll send them an empty update. + // Regardless, the update that we send to the caller, if we send any, + // is a full tx update, rather than a light one. + // That is, in the case of the caller, we don't respect the light setting. + if let Some((caller, addr)) = caller.zip(event.caller_address) { + let update = eval + .remove(&(event.caller_identity, addr)) + .map(|update| SubscriptionUpdateMessage::from_event_and_update(&event, update)) + .unwrap_or_else(|| { + SubscriptionUpdateMessage::default_for_protocol(caller.config.protocol, event.request_id) + }); + send_to_client(caller, Some(event.clone()), update); } - eval.into_iter().for_each(|(id, tables)| { - let database_update = SubscriptionUpdateMessage { - database_update: tables, - request_id: event.request_id, - timer: event.timer, - }; - send_to_client(self.client(id).as_ref(), &event, database_update); - }); + // Send all the other updates. + for (id, update) in eval { + let message = SubscriptionUpdateMessage::from_event_and_update(&event, update); + let client = self.client(id); + // Conditionally send out a full update or a light one otherwise. + let event = client.config.tx_update_full.then(|| event.clone()); + send_to_client(&client, event, message); + } }) } } fn send_to_client( client: &ClientConnectionSender, - event: &Arc, + event: Option>, database_update: SubscriptionUpdateMessage, ) { - if let Err(e) = client.send_message(TransactionUpdateMessage { - event: event.clone(), - database_update, - }) { + if let Err(e) = client.send_message(TransactionUpdateMessage { event, database_update }) { tracing::warn!(%client.id, "failed to send update message to client: {e}") } } @@ -276,7 +282,7 @@ mod tests { use super::SubscriptionManager; use crate::execution_context::Workload; use crate::{ - client::{ClientActorId, ClientConnectionSender, ClientName, Protocol}, + client::{ClientActorId, ClientConfig, ClientConnectionSender, ClientName}, db::relational_db::{tests_utils::TestDB, RelationalDB}, energy::EnergyQuanta, host::{ @@ -313,13 +319,14 @@ mod tests { } fn client(address: u128) -> ClientConnectionSender { + let (identity, address) = id(address); ClientConnectionSender::dummy( ClientActorId { - identity: Identity::ZERO, - address: Address::from_u128(address), + identity, + address, name: ClientName(0), }, - Protocol::Binary, + ClientConfig::for_test(), ) } @@ -508,7 +515,8 @@ mod tests { let id0 = Identity::ZERO; let client0 = ClientActorId::for_test(id0); - let (client0, mut rx) = ClientConnectionSender::dummy_with_channel(client0, Protocol::Binary); + let config = ClientConfig::for_test(); + let (client0, mut rx) = ClientConnectionSender::dummy_with_channel(client0, config); let subscriptions = SubscriptionManager::default(); diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/identity_connected_reducer.rs b/crates/sdk/examples/quickstart-chat/module_bindings/identity_connected_reducer.rs index 40e0e1975f8..f15e0b3f320 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/identity_connected_reducer.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/identity_connected_reducer.rs @@ -66,3 +66,23 @@ impl identity_connected for super::RemoteReducers { .remove_on_reducer::("__identity_connected__", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__identity_connected__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_identity_connected { + /// Set the call-reducer flags for the reducer `__identity_connected__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn identity_connected(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_identity_connected for super::SetReducerFlags { + fn identity_connected(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__identity_connected__", flags); + } +} diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/identity_disconnected_reducer.rs b/crates/sdk/examples/quickstart-chat/module_bindings/identity_disconnected_reducer.rs index fe588fa7ac9..539ad0ecd03 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/identity_disconnected_reducer.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/identity_disconnected_reducer.rs @@ -67,3 +67,23 @@ impl identity_disconnected for super::RemoteReducers { .remove_on_reducer::("__identity_disconnected__", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__identity_disconnected__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_identity_disconnected { + /// Set the call-reducer flags for the reducer `__identity_disconnected__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn identity_disconnected(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_identity_disconnected for super::SetReducerFlags { + fn identity_disconnected(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__identity_disconnected__", flags); + } +} diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/init_reducer.rs b/crates/sdk/examples/quickstart-chat/module_bindings/init_reducer.rs index acc5c2f8cbd..ad2fbd48811 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/init_reducer.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/init_reducer.rs @@ -59,3 +59,23 @@ impl init for super::RemoteReducers { self.imp.remove_on_reducer::("__init__", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__init__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_init { + /// Set the call-reducer flags for the reducer `__init__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn init(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_init for super::SetReducerFlags { + fn init(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__init__", flags); + } +} diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/mod.rs b/crates/sdk/examples/quickstart-chat/module_bindings/mod.rs index ec7ed66e1c9..89acab0f991 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/mod.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/mod.rs @@ -148,6 +148,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule { type Reducer = Reducer; type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; type DbUpdate = DbUpdate; type SubscriptionHandle = SubscriptionHandle; } @@ -162,6 +163,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers { type Module = RemoteModule; } +#[doc(hidden)] +/// The `set_reducer_flags` field of [`DbConnection`], +/// with methods provided by extension traits for each reducer defined by the module. +/// Each method sets the flags for the reducer with the same name. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub struct SetReducerFlags { + imp: __sdk::db_connection::DbContextImpl, +} + +impl __sdk::spacetime_module::InModule for SetReducerFlags { + type Module = RemoteModule; +} + /// The `db` field of [`EventContext`] and [`DbConnection`], /// with methods provided by extension traits for each table defined by the module. pub struct RemoteTables { @@ -193,6 +208,12 @@ pub struct DbConnection { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + #[doc(hidden)] + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, imp: __sdk::db_connection::DbContextImpl, } @@ -204,6 +225,7 @@ impl __sdk::spacetime_module::InModule for DbConnection { impl __sdk::db_context::DbContext for DbConnection { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -211,6 +233,9 @@ impl __sdk::db_context::DbContext for DbConnection { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -310,6 +335,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, imp, } } @@ -322,6 +348,11 @@ pub struct EventContext { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, /// The event which caused these callbacks to run. pub event: __sdk::event::Event, imp: __sdk::db_connection::DbContextImpl, @@ -334,6 +365,7 @@ impl __sdk::spacetime_module::InModule for EventContext { impl __sdk::db_context::DbContext for EventContext { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -341,6 +373,9 @@ impl __sdk::db_context::DbContext for EventContext { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -372,6 +407,7 @@ impl __sdk::spacetime_module::EventContext for EventContext { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, event, imp, } @@ -403,6 +439,7 @@ pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, > { @@ -411,6 +448,7 @@ impl< Ctx: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, >, > RemoteDbContext for Ctx diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/send_message_reducer.rs b/crates/sdk/examples/quickstart-chat/module_bindings/send_message_reducer.rs index b4dbf1b5eb5..70627bd06e2 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/send_message_reducer.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/send_message_reducer.rs @@ -67,3 +67,23 @@ impl send_message for super::RemoteReducers { self.imp.remove_on_reducer::("send_message", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `send_message`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_send_message { + /// Set the call-reducer flags for the reducer `send_message` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn send_message(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_send_message for super::SetReducerFlags { + fn send_message(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("send_message", flags); + } +} diff --git a/crates/sdk/examples/quickstart-chat/module_bindings/set_name_reducer.rs b/crates/sdk/examples/quickstart-chat/module_bindings/set_name_reducer.rs index 57af56c41b3..aed78b363b2 100644 --- a/crates/sdk/examples/quickstart-chat/module_bindings/set_name_reducer.rs +++ b/crates/sdk/examples/quickstart-chat/module_bindings/set_name_reducer.rs @@ -64,3 +64,23 @@ impl set_name for super::RemoteReducers { self.imp.remove_on_reducer::("set_name", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `set_name`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_set_name { + /// Set the call-reducer flags for the reducer `set_name` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn set_name(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_set_name for super::SetReducerFlags { + fn set_name(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("set_name", flags); + } +} diff --git a/crates/sdk/src/db_connection.rs b/crates/sdk/src/db_connection.rs index f035d878835..4739226d32c 100644 --- a/crates/sdk/src/db_connection.rs +++ b/crates/sdk/src/db_connection.rs @@ -23,7 +23,7 @@ use crate::{ client_cache::{ClientCache, ClientCacheView, TableCache, UniqueConstraint}, spacetime_module::{DbConnection, DbUpdate, EventContext, InModule, SpacetimeModule}, subscription::{OnAppliedCallback, OnErrorCallback, SubscriptionManager}, - websocket::WsConnection, + websocket::{WsConnection, WsParams}, ws_messages as ws, Event, ReducerEvent, Status, }; use anyhow::{bail, Context, Result}; @@ -31,7 +31,8 @@ use bytes::Bytes; use futures::StreamExt; use futures_channel::mpsc; use http::Uri; -use spacetimedb_client_api_messages::websocket::{BsatnFormat, Compression}; +use spacetimedb_client_api_messages::websocket::{BsatnFormat, CallReducerFlags, Compression}; +use spacetimedb_data_structures::map::HashMap; use spacetimedb_lib::{bsatn, de::Deserialize, ser::Serialize, Address, Identity}; use std::{ sync::{Arc, Mutex as StdMutex, OnceLock}, @@ -246,14 +247,16 @@ impl DbContextImpl { // CallReducer: send the `CallReducer` WS message. PendingMutation::CallReducer { reducer, args_bsatn } => { + let inner = &mut *self.inner.lock().unwrap(); + + let flags = inner.call_reducer_flags.get_flags(reducer); let msg = ws::ClientMessage::CallReducer(ws::CallReducer { reducer: reducer.into(), args: args_bsatn.into(), request_id: 0, + flags, }); - self.inner - .lock() - .unwrap() + inner .send_chan .as_mut() .ok_or(DisconnectedError {})? @@ -349,6 +352,16 @@ impl DbContextImpl { .reducer_callbacks .remove_on_reducer(reducer, callback_id); } + PendingMutation::SetCallReducerFlags { + reducer: reducer_name, + flags, + } => { + self.inner + .lock() + .unwrap() + .call_reducer_flags + .set_flags(reducer_name, flags); + } }; Ok(()) } @@ -513,14 +526,16 @@ impl DbContextImpl { } } - /// Called by autogenerated reducer invokation methods. + /// Called by autogenerated reducer invocation methods. pub fn call_reducer>( &self, reducer_name: &'static str, args: Args, ) -> Result<()> { + // TODO(centril, perf): consider using a thread local pool to avoid allocating each time. let args_bsatn = bsatn::to_vec(&args) .with_context(|| format!("Failed to BSATN serialize arguments for reducer {reducer_name}"))?; + self.queue_mutation(PendingMutation::CallReducer { reducer: reducer_name, args_bsatn, @@ -528,6 +543,11 @@ impl DbContextImpl { Ok(()) } + /// Called by autogenerated on `reducer_config` methods. + pub fn set_call_reducer_flags(&self, reducer: &'static str, flags: CallReducerFlags) { + self.queue_mutation(PendingMutation::SetCallReducerFlags { reducer, flags }); + } + /// Called by autogenerated reducer callback methods. pub fn on_reducer + InModule + 'static>( &self, @@ -591,6 +611,32 @@ pub(crate) struct DbContextImplInner { // TODO: Make use of this to handle `ParsedMessage::Error` before receiving `IdentityToken`. on_connect_error: Option, on_disconnect: Option>, + + call_reducer_flags: CallReducerFlagsMap, +} + +/// Maps reducer names to the flags to use for `.call_reducer(..)`. +#[derive(Default, Clone)] +struct CallReducerFlagsMap { + // TODO(centril): consider replacing the string with a type-id based map + // where each reducer is associated with a marker type. + map: HashMap<&'static str, CallReducerFlags>, +} + +impl CallReducerFlagsMap { + /// Returns the [`CallReducerFlags`] for `reducer_name`. + fn get_flags(&self, reducer_name: &str) -> CallReducerFlags { + self.map.get(reducer_name).copied().unwrap_or_default() + } + + /// Sets the [`CallReducerFlags`] for `reducer_name` to `flags`. + pub fn set_flags(&mut self, reducer_name: &'static str, flags: CallReducerFlags) { + if flags == <_>::default() { + self.map.remove(reducer_name) + } else { + self.map.insert(reducer_name, flags) + }; + } } /// Internal implementation of a generated `TableHandle` struct, @@ -728,7 +774,7 @@ pub struct DbConnectionBuilder { on_connect_error: Option, on_disconnect: Option>, - compression: Compression, + params: WsParams, } /// This process's global client address, which will be attacked to all connections it makes. @@ -771,7 +817,7 @@ impl DbConnectionBuilder { on_connect: None, on_connect_error: None, on_disconnect: None, - compression: <_>::default(), + params: <_>::default(), } } @@ -818,7 +864,7 @@ but you must call one of them, or else the connection will never progress. self.module_name.as_ref().unwrap(), self.credentials.as_ref(), get_client_address(), - self.compression, + self.params, )) })?; @@ -836,13 +882,13 @@ but you must call one of them, or else the connection will never progress. on_connect: self.on_connect, on_connect_error: self.on_connect_error, on_disconnect: self.on_disconnect, + call_reducer_flags: <_>::default(), })); - let cache = Arc::new(StdMutex::new(Arc::new(ClientCache::default()))); let (pending_mutations_send, pending_mutations_recv) = mpsc::unbounded(); let ctx_imp = DbContextImpl { runtime: handle, inner, - cache, + cache: <_>::default(), recv: Arc::new(TokioMutex::new(parsed_recv_chan)), pending_mutations_send, pending_mutations_recv: Arc::new(TokioMutex::new(pending_mutations_recv)), @@ -887,7 +933,19 @@ but you must call one of them, or else the connection will never progress. /// and for individual query updates. /// Note however that this threshold is not guaranteed and may change without notice. pub fn with_compression(mut self, compression: Compression) -> Self { - self.compression = compression; + self.params.compression = compression; + self + } + + /// Sets whether the "light" mode is used. + /// + /// The light mode is meant for clients which are network-bandwidth constrained + /// and results in the following: + /// - Incremental updates will not include information about the reducer that caused them. + /// - The client will not be notified about a reducer the client called + /// without being subscribed to any relevant queries. + pub fn with_light_mode(mut self, light: bool) -> Self { + self.params.light = light; self } @@ -1027,6 +1085,12 @@ async fn parse_loop( ParsedMessage::TransactionUpdate(event, db_update) } }, + ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { update, request_id: _ }) => { + match M::DbUpdate::parse_update(update) { + Err(e) => ParsedMessage::Error(e.context("Failed to parse update from TransactionUpdateLight")), + Ok(db_update) => ParsedMessage::TransactionUpdate(Event::UnknownTransaction, Some(db_update)), + } + } ws::ServerMessage::IdentityToken(ws::IdentityToken { identity, token, @@ -1091,6 +1155,10 @@ pub(crate) enum PendingMutation { callback_id: CallbackId, }, Disconnect, + SetCallReducerFlags { + reducer: &'static str, + flags: CallReducerFlags, + }, } enum Message { diff --git a/crates/sdk/src/db_context.rs b/crates/sdk/src/db_context.rs index adcb9eb8e02..98f02bae158 100644 --- a/crates/sdk/src/db_context.rs +++ b/crates/sdk/src/db_context.rs @@ -27,6 +27,15 @@ pub trait DbContext { /// so accesses to concrete-typed contexts don't need to use this method. fn reducers(&self) -> &Self::Reducers; + type SetReducerFlags; + + /// Access to setters for per-reducer flags. + /// + /// The returned `SetReducerFlags` will have a method to invoke, + /// for each reducer defined by the module, + /// which call-flags for the reducer can be set. + fn set_reducer_flags(&self) -> &Self::SetReducerFlags; + /// Returns `true` if the connection is active, i.e. has not yet disconnected. fn is_active(&self) -> bool; diff --git a/crates/sdk/src/event.rs b/crates/sdk/src/event.rs index e0bd3be2743..eebd667374e 100644 --- a/crates/sdk/src/event.rs +++ b/crates/sdk/src/event.rs @@ -10,8 +10,7 @@ //! You can inspect its `event` field //! to determine what change in your connection's state caused the callback to run. -use crate::spacetime_module::SpacetimeModule; -use anyhow::Context as _; +use crate::spacetime_module::{DbUpdate as _, SpacetimeModule}; use spacetimedb_client_api_messages::websocket::BsatnFormat; use spacetimedb_lib::{Address, Identity}; use std::time::SystemTime; @@ -103,10 +102,9 @@ impl Status { status: crate::ws_messages::UpdateStatus, ) -> anyhow::Result<(Self, Option)> { Ok(match status { - crate::ws_messages::UpdateStatus::Committed(update) => ( - Self::Committed, - Some(M::DbUpdate::try_from(update).context("Failed to parse DatabaseUpdate from UpdateStatus")?), - ), + crate::ws_messages::UpdateStatus::Committed(update) => { + (Self::Committed, Some(M::DbUpdate::parse_update(update)?)) + } crate::ws_messages::UpdateStatus::Failed(errmsg) => (Self::Failed(errmsg), None), crate::ws_messages::UpdateStatus::OutOfEnergy => (Self::OutOfEnergy, None), }) diff --git a/crates/sdk/src/spacetime_module.rs b/crates/sdk/src/spacetime_module.rs index f60b52e382c..159cac8bdff 100644 --- a/crates/sdk/src/spacetime_module.rs +++ b/crates/sdk/src/spacetime_module.rs @@ -39,6 +39,9 @@ pub trait SpacetimeModule: Send + Sync + 'static { /// Return type of [`crate::DbContext::reducers`]. type Reducers: InModule + Send + 'static; + /// Return type of [`crate::DbContext::set_reducer_flags`]. + type SetReducerFlags: InModule + Send + 'static; + /// Parsed and typed analogue of [`crate::ws::DatabaseUpdate`]. type DbUpdate: DbUpdate; @@ -59,6 +62,10 @@ where event: &<::Module as SpacetimeModule>::EventContext, callbacks: &mut DbCallbacks, ); + + fn parse_update(update: ws::DatabaseUpdate) -> anyhow::Result { + Self::try_from(update).context("Failed to parse DatabaseUpdate from UpdateStatus") + } } /// Implemented by the autogenerated `DbConnection` type, diff --git a/crates/sdk/src/websocket.rs b/crates/sdk/src/websocket.rs index 8a4204f2ea0..b2ccfd15742 100644 --- a/crates/sdk/src/websocket.rs +++ b/crates/sdk/src/websocket.rs @@ -38,7 +38,13 @@ fn parse_scheme(scheme: Option) -> Result { }) } -fn make_uri(host: Host, db_name: &str, client_address: Address, compression: Compression) -> Result +#[derive(Clone, Copy, Default)] +pub(crate) struct WsParams { + pub compression: Compression, + pub light: bool, +} + +fn make_uri(host: Host, db_name: &str, client_address: Address, params: WsParams) -> Result where Host: TryInto, >::Error: std::error::Error + Send + Sync + 'static, @@ -56,18 +62,32 @@ where "/".to_string() }; + // Normalize the path, ensuring it ends with `/`. if !path.ends_with('/') { path.push('/'); } + path.push_str("database/subscribe/"); path.push_str(db_name); + + // Provide the client address. path.push_str("?client_address="); path.push_str(&client_address.to_hex()); - match compression { + + // Specify the desired compression for host->client replies. + match params.compression { Compression::None => path.push_str("&compression=None"), Compression::Gzip => path.push_str("&compression=Gzip"), + // The host uses the same default as the sdk, + // but in case this changes, we prefer to be explicit now. Compression::Brotli => path.push_str("&compression=Brotli"), }; + + // Specify the `light` mode if requested. + if params.light { + path.push_str("&light=true"); + } + parts.path_and_query = Some(path.parse()?); Ok(Uri::from_parts(parts)?) } @@ -86,13 +106,13 @@ fn make_request( db_name: &str, credentials: Option<&(Identity, String)>, client_address: Address, - compression: Compression, + params: WsParams, ) -> Result> where Host: TryInto, >::Error: std::error::Error + Send + Sync + 'static, { - let uri = make_uri(host, db_name, client_address, compression)?; + let uri = make_uri(host, db_name, client_address, params)?; let mut req = IntoClientRequest::into_client_request(uri)?; request_insert_protocol_header(&mut req); request_insert_auth_header(&mut req, credentials); @@ -141,13 +161,13 @@ impl WsConnection { db_name: &str, credentials: Option<&(Identity, String)>, client_address: Address, - compression: Compression, + params: WsParams, ) -> Result where Host: TryInto, >::Error: std::error::Error + Send + Sync + 'static, { - let req = make_request(host, db_name, credentials, client_address, compression)?; + let req = make_request(host, db_name, credentials, client_address, params)?; let (sock, _): (WebSocketStream>, _) = connect_async_with_config( req, // TODO(kim): In order to be able to replicate module WASM blobs, diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs index 40e0e1975f8..f15e0b3f320 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_connected_reducer.rs @@ -66,3 +66,23 @@ impl identity_connected for super::RemoteReducers { .remove_on_reducer::("__identity_connected__", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__identity_connected__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_identity_connected { + /// Set the call-reducer flags for the reducer `__identity_connected__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn identity_connected(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_identity_connected for super::SetReducerFlags { + fn identity_connected(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__identity_connected__", flags); + } +} diff --git a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs index fe588fa7ac9..539ad0ecd03 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/identity_disconnected_reducer.rs @@ -67,3 +67,23 @@ impl identity_disconnected for super::RemoteReducers { .remove_on_reducer::("__identity_disconnected__", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `__identity_disconnected__`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_identity_disconnected { + /// Set the call-reducer flags for the reducer `__identity_disconnected__` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn identity_disconnected(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_identity_disconnected for super::SetReducerFlags { + fn identity_disconnected(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("__identity_disconnected__", flags); + } +} 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 index 43dd5fa3762..f73114a1878 100644 --- a/crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs +++ b/crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs @@ -121,6 +121,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule { type Reducer = Reducer; type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; type DbUpdate = DbUpdate; type SubscriptionHandle = SubscriptionHandle; } @@ -135,6 +136,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers { type Module = RemoteModule; } +#[doc(hidden)] +/// The `set_reducer_flags` field of [`DbConnection`], +/// with methods provided by extension traits for each reducer defined by the module. +/// Each method sets the flags for the reducer with the same name. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub struct SetReducerFlags { + imp: __sdk::db_connection::DbContextImpl, +} + +impl __sdk::spacetime_module::InModule for SetReducerFlags { + type Module = RemoteModule; +} + /// The `db` field of [`EventContext`] and [`DbConnection`], /// with methods provided by extension traits for each table defined by the module. pub struct RemoteTables { @@ -166,6 +181,12 @@ pub struct DbConnection { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + #[doc(hidden)] + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, imp: __sdk::db_connection::DbContextImpl, } @@ -177,6 +198,7 @@ impl __sdk::spacetime_module::InModule for DbConnection { impl __sdk::db_context::DbContext for DbConnection { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -184,6 +206,9 @@ impl __sdk::db_context::DbContext for DbConnection { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -283,6 +308,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, imp, } } @@ -295,6 +321,11 @@ pub struct EventContext { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, /// The event which caused these callbacks to run. pub event: __sdk::event::Event, imp: __sdk::db_connection::DbContextImpl, @@ -307,6 +338,7 @@ impl __sdk::spacetime_module::InModule for EventContext { impl __sdk::db_context::DbContext for EventContext { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -314,6 +346,9 @@ impl __sdk::db_context::DbContext for EventContext { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -345,6 +380,7 @@ impl __sdk::spacetime_module::EventContext for EventContext { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, event, imp, } @@ -376,6 +412,7 @@ pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, > { @@ -384,6 +421,7 @@ impl< Ctx: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, >, > RemoteDbContext for Ctx 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 index 3565d5d6b9b..ef302a66de4 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_pk_address for super::RemoteReducers { .remove_on_reducer::("delete_pk_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_address { + /// Set the call-reducer flags for the reducer `delete_pk_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_address for super::SetReducerFlags { + fn delete_pk_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_address", flags); + } +} 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 index 6b182774019..bad581aa9cb 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_bool for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_bool { + /// Set the call-reducer flags for the reducer `delete_pk_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_bool for super::SetReducerFlags { + fn delete_pk_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_bool", flags); + } +} 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 index 6af4d087a1d..37d809e71b8 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_i_128 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_128 { + /// Set the call-reducer flags for the reducer `delete_pk_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_128 for super::SetReducerFlags { + fn delete_pk_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i128", flags); + } +} 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 index 8c2db4bf093..fc5b3576d2f 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_i_16 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_16 { + /// Set the call-reducer flags for the reducer `delete_pk_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_16 for super::SetReducerFlags { + fn delete_pk_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_256_reducer.rs index 0d6c7d27529..fa3e0f10647 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_i_256_reducer.rs @@ -67,3 +67,23 @@ impl delete_pk_i_256 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_256 { + /// Set the call-reducer flags for the reducer `delete_pk_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_256 for super::SetReducerFlags { + fn delete_pk_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i256", flags); + } +} 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 index 61336d2b289..2b958640d52 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_i_32 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_32 { + /// Set the call-reducer flags for the reducer `delete_pk_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_32 for super::SetReducerFlags { + fn delete_pk_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i32", flags); + } +} 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 index f0c6000cf00..34330ea4201 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_i_64 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_64 { + /// Set the call-reducer flags for the reducer `delete_pk_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_64 for super::SetReducerFlags { + fn delete_pk_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i64", flags); + } +} 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 index 6fa005410ec..94e022f6ada 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_i_8 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_i_8 { + /// Set the call-reducer flags for the reducer `delete_pk_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_i_8 for super::SetReducerFlags { + fn delete_pk_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_i8", flags); + } +} 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 index 2ce6ed8120f..ee73a1d1a77 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_pk_identity for super::RemoteReducers { .remove_on_reducer::("delete_pk_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_identity { + /// Set the call-reducer flags for the reducer `delete_pk_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_identity for super::SetReducerFlags { + fn delete_pk_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_identity", flags); + } +} 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 index 8406510a160..5cdbb0814b9 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_pk_string for super::RemoteReducers { .remove_on_reducer::("delete_pk_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_string { + /// Set the call-reducer flags for the reducer `delete_pk_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_string for super::SetReducerFlags { + fn delete_pk_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_string", flags); + } +} 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 index 08f01a94b8c..da5b69c3952 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_u_128 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_128 { + /// Set the call-reducer flags for the reducer `delete_pk_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_128 for super::SetReducerFlags { + fn delete_pk_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u128", flags); + } +} 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 index 7bfd5fecade..6dc81e2a5e2 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_u_16 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_16 { + /// Set the call-reducer flags for the reducer `delete_pk_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_16 for super::SetReducerFlags { + fn delete_pk_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_256_reducer.rs index 3a5244c47d4..295f70ba972 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_pk_u_256_reducer.rs @@ -67,3 +67,23 @@ impl delete_pk_u_256 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_256 { + /// Set the call-reducer flags for the reducer `delete_pk_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_256 for super::SetReducerFlags { + fn delete_pk_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u256", flags); + } +} 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 index ab8becdf496..d5f7b40a957 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_u_32 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_32 { + /// Set the call-reducer flags for the reducer `delete_pk_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_32 for super::SetReducerFlags { + fn delete_pk_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u32", flags); + } +} 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 index cab46795c8e..33ab5fcc7dc 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_u_64 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_64 { + /// Set the call-reducer flags for the reducer `delete_pk_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_64 for super::SetReducerFlags { + fn delete_pk_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u64", flags); + } +} 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 index e47f04cc41f..5962cec3438 100644 --- 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 @@ -67,3 +67,23 @@ impl delete_pk_u_8 for super::RemoteReducers { self.imp.remove_on_reducer::("delete_pk_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_pk_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_pk_u_8 { + /// Set the call-reducer flags for the reducer `delete_pk_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_pk_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_pk_u_8 for super::SetReducerFlags { + fn delete_pk_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_pk_u8", flags); + } +} 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 index 0c5c6b10e2b..c034849d2e4 100644 --- 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 @@ -69,3 +69,23 @@ impl delete_unique_address for super::RemoteReducers { .remove_on_reducer::("delete_unique_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_address { + /// Set the call-reducer flags for the reducer `delete_unique_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_address for super::SetReducerFlags { + fn delete_unique_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_address", flags); + } +} 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 index b6981e67da4..eef5605b62b 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_bool for super::RemoteReducers { .remove_on_reducer::("delete_unique_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_bool { + /// Set the call-reducer flags for the reducer `delete_unique_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_bool for super::SetReducerFlags { + fn delete_unique_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_bool", flags); + } +} 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 index 274832205a4..6f2950634b6 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_i_128 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_128 { + /// Set the call-reducer flags for the reducer `delete_unique_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_128 for super::SetReducerFlags { + fn delete_unique_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i128", flags); + } +} 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 index 51036c25f87..0f08c5ec716 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_i_16 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_16 { + /// Set the call-reducer flags for the reducer `delete_unique_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_16 for super::SetReducerFlags { + fn delete_unique_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_256_reducer.rs index f00a09e3d96..4d20cf591fe 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_i_256_reducer.rs @@ -68,3 +68,23 @@ impl delete_unique_i_256 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_256 { + /// Set the call-reducer flags for the reducer `delete_unique_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_256 for super::SetReducerFlags { + fn delete_unique_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i256", flags); + } +} 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 index 3cff0b61f92..15bb9189ce9 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_i_32 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_32 { + /// Set the call-reducer flags for the reducer `delete_unique_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_32 for super::SetReducerFlags { + fn delete_unique_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i32", flags); + } +} 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 index 9186af50086..7f72627391e 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_i_64 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_64 { + /// Set the call-reducer flags for the reducer `delete_unique_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_64 for super::SetReducerFlags { + fn delete_unique_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i64", flags); + } +} 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 index 3241147cd1b..030be737cfa 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_i_8 for super::RemoteReducers { .remove_on_reducer::("delete_unique_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_i_8 { + /// Set the call-reducer flags for the reducer `delete_unique_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_i_8 for super::SetReducerFlags { + fn delete_unique_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_i8", flags); + } +} 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 index c51daacba13..19ce7967f93 100644 --- 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 @@ -69,3 +69,23 @@ impl delete_unique_identity for super::RemoteReducers { .remove_on_reducer::("delete_unique_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_identity { + /// Set the call-reducer flags for the reducer `delete_unique_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_identity for super::SetReducerFlags { + fn delete_unique_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_identity", flags); + } +} 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 index 03253765052..997aa914e58 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_string for super::RemoteReducers { .remove_on_reducer::("delete_unique_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_string { + /// Set the call-reducer flags for the reducer `delete_unique_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_string for super::SetReducerFlags { + fn delete_unique_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_string", flags); + } +} 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 index 16c7d0dac69..d4878402c7f 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_u_128 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_128 { + /// Set the call-reducer flags for the reducer `delete_unique_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_128 for super::SetReducerFlags { + fn delete_unique_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u128", flags); + } +} 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 index 45377400a66..362ab6334da 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_u_16 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_16 { + /// Set the call-reducer flags for the reducer `delete_unique_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_16 for super::SetReducerFlags { + fn delete_unique_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_256_reducer.rs index a8e41d6da49..7be56298065 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/delete_unique_u_256_reducer.rs @@ -68,3 +68,23 @@ impl delete_unique_u_256 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_256 { + /// Set the call-reducer flags for the reducer `delete_unique_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_256 for super::SetReducerFlags { + fn delete_unique_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u256", flags); + } +} 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 index 945e80f2d23..25a845bb27c 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_u_32 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_32 { + /// Set the call-reducer flags for the reducer `delete_unique_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_32 for super::SetReducerFlags { + fn delete_unique_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u32", flags); + } +} 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 index d64acae677a..51ef5443bb6 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_u_64 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_64 { + /// Set the call-reducer flags for the reducer `delete_unique_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_64 for super::SetReducerFlags { + fn delete_unique_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u64", flags); + } +} 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 index cecbe6411f6..7673e5e1569 100644 --- 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 @@ -68,3 +68,23 @@ impl delete_unique_u_8 for super::RemoteReducers { .remove_on_reducer::("delete_unique_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `delete_unique_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_delete_unique_u_8 { + /// Set the call-reducer flags for the reducer `delete_unique_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn delete_unique_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_delete_unique_u_8 for super::SetReducerFlags { + fn delete_unique_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("delete_unique_u8", flags); + } +} 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 index 8f957f9032d..a3f0cda63bd 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_caller_one_address for super::RemoteReducers { .remove_on_reducer::("insert_caller_one_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_one_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_one_address { + /// Set the call-reducer flags for the reducer `insert_caller_one_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_one_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_one_address for super::SetReducerFlags { + fn insert_caller_one_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_one_address", flags); + } +} 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 index 4a50dc98b27..7a518a6d7fc 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_caller_one_identity for super::RemoteReducers { .remove_on_reducer::("insert_caller_one_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_one_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_one_identity { + /// Set the call-reducer flags for the reducer `insert_caller_one_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_one_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_one_identity for super::SetReducerFlags { + fn insert_caller_one_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_one_identity", flags); + } +} 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 index 39744d2f4c6..14ba0ce94da 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_caller_pk_address for super::RemoteReducers { .remove_on_reducer::("insert_caller_pk_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_pk_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_pk_address { + /// Set the call-reducer flags for the reducer `insert_caller_pk_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_pk_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_pk_address for super::SetReducerFlags { + fn insert_caller_pk_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_pk_address", flags); + } +} 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 index 40a1f5fb4a4..6cd10d4e3a1 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_caller_pk_identity for super::RemoteReducers { .remove_on_reducer::("insert_caller_pk_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_pk_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_pk_identity { + /// Set the call-reducer flags for the reducer `insert_caller_pk_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_pk_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_pk_identity for super::SetReducerFlags { + fn insert_caller_pk_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_pk_identity", flags); + } +} 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 index cb8d14f0532..61f5f2bcdfb 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_caller_unique_address for super::RemoteReducers { .remove_on_reducer::("insert_caller_unique_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_unique_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_unique_address { + /// Set the call-reducer flags for the reducer `insert_caller_unique_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_unique_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_unique_address for super::SetReducerFlags { + fn insert_caller_unique_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_unique_address", flags); + } +} 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 index 8a74560c553..98fae641f9a 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_caller_unique_identity for super::RemoteReducers { .remove_on_reducer::("insert_caller_unique_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_unique_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_unique_identity { + /// Set the call-reducer flags for the reducer `insert_caller_unique_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_unique_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_unique_identity for super::SetReducerFlags { + fn insert_caller_unique_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_unique_identity", flags); + } +} 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 index f24c38e11e0..c564d3dcd34 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_caller_vec_address for super::RemoteReducers { .remove_on_reducer::("insert_caller_vec_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_vec_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_vec_address { + /// Set the call-reducer flags for the reducer `insert_caller_vec_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_vec_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_vec_address for super::SetReducerFlags { + fn insert_caller_vec_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_vec_address", flags); + } +} 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 index e1dc5ad131c..a343cd78e1e 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_caller_vec_identity for super::RemoteReducers { .remove_on_reducer::("insert_caller_vec_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_caller_vec_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_caller_vec_identity { + /// Set the call-reducer flags for the reducer `insert_caller_vec_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_caller_vec_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_caller_vec_identity for super::SetReducerFlags { + fn insert_caller_vec_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_caller_vec_identity", flags); + } +} 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 index c6102e89177..ed171b244ce 100644 --- 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 @@ -226,3 +226,23 @@ impl insert_large_table for super::RemoteReducers { .remove_on_reducer::("insert_large_table", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_large_table`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_large_table { + /// Set the call-reducer flags for the reducer `insert_large_table` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_large_table(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_large_table for super::SetReducerFlags { + fn insert_large_table(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_large_table", flags); + } +} 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 index ac5cd36256c..dae46ab9e7d 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_address for super::RemoteReducers { .remove_on_reducer::("insert_one_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_address { + /// Set the call-reducer flags for the reducer `insert_one_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_address for super::SetReducerFlags { + fn insert_one_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_address", flags); + } +} 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 index c70dcd9335d..e934f5b5162 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_bool for super::RemoteReducers { .remove_on_reducer::("insert_one_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_bool { + /// Set the call-reducer flags for the reducer `insert_one_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_bool for super::SetReducerFlags { + fn insert_one_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_bool", flags); + } +} 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 index 998ae4db890..fd56ecace5f 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_one_byte_struct for super::RemoteReducers { .remove_on_reducer::("insert_one_byte_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_byte_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_byte_struct { + /// Set the call-reducer flags for the reducer `insert_one_byte_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_byte_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_byte_struct for super::SetReducerFlags { + fn insert_one_byte_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_byte_struct", flags); + } +} 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 index ed2a5910348..16436743c93 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_one_enum_with_payload for super::RemoteReducers { .remove_on_reducer::("insert_one_enum_with_payload", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_enum_with_payload`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_enum_with_payload { + /// Set the call-reducer flags for the reducer `insert_one_enum_with_payload` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_enum_with_payload(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_enum_with_payload for super::SetReducerFlags { + fn insert_one_enum_with_payload(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_enum_with_payload", flags); + } +} 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 index 33e9b929359..32b97f36733 100644 --- 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 @@ -71,3 +71,24 @@ impl insert_one_every_primitive_struct for super::RemoteReducers { .remove_on_reducer::("insert_one_every_primitive_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_every_primitive_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_every_primitive_struct { + /// Set the call-reducer flags for the reducer `insert_one_every_primitive_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_every_primitive_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_every_primitive_struct for super::SetReducerFlags { + fn insert_one_every_primitive_struct(&self, flags: __ws::CallReducerFlags) { + self.imp + .set_call_reducer_flags("insert_one_every_primitive_struct", flags); + } +} 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 index 0f4bdf27347..67bdda007d0 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_one_every_vec_struct for super::RemoteReducers { .remove_on_reducer::("insert_one_every_vec_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_every_vec_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_every_vec_struct { + /// Set the call-reducer flags for the reducer `insert_one_every_vec_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_every_vec_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_every_vec_struct for super::SetReducerFlags { + fn insert_one_every_vec_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_every_vec_struct", flags); + } +} 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 index 00706e4427d..693e9905bd4 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_f_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_f32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_f32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_f_32 { + /// Set the call-reducer flags for the reducer `insert_one_f32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_f_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_f_32 for super::SetReducerFlags { + fn insert_one_f_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_f32", flags); + } +} 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 index 5ce9337c8e2..40cfdc0a563 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_f_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_f64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_f64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_f_64 { + /// Set the call-reducer flags for the reducer `insert_one_f64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_f_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_f_64 for super::SetReducerFlags { + fn insert_one_f_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_f64", flags); + } +} 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 index e29f3539ace..baf515e6ae3 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_i_128 for super::RemoteReducers { .remove_on_reducer::("insert_one_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_128 { + /// Set the call-reducer flags for the reducer `insert_one_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_128 for super::SetReducerFlags { + fn insert_one_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i128", flags); + } +} 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 index 9efc9c9943b..e8deffd28bc 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_i_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_16 { + /// Set the call-reducer flags for the reducer `insert_one_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_16 for super::SetReducerFlags { + fn insert_one_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_256_reducer.rs index 1e7798b9198..6195af58bae 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_i_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_one_i_256 for super::RemoteReducers { .remove_on_reducer::("insert_one_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_256 { + /// Set the call-reducer flags for the reducer `insert_one_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_256 for super::SetReducerFlags { + fn insert_one_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i256", flags); + } +} 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 index 62abb90f61f..617a70112c2 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_i_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_32 { + /// Set the call-reducer flags for the reducer `insert_one_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_32 for super::SetReducerFlags { + fn insert_one_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i32", flags); + } +} 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 index 41fc83bb195..228d17b3e1e 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_i_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_64 { + /// Set the call-reducer flags for the reducer `insert_one_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_64 for super::SetReducerFlags { + fn insert_one_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i64", flags); + } +} 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 index a4282c70396..520732e7907 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_i_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_i_8 { + /// Set the call-reducer flags for the reducer `insert_one_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_i_8 for super::SetReducerFlags { + fn insert_one_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_i8", flags); + } +} 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 index d323fb6b4c4..647f7e2bfa8 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_identity for super::RemoteReducers { .remove_on_reducer::("insert_one_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_identity { + /// Set the call-reducer flags for the reducer `insert_one_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_identity for super::SetReducerFlags { + fn insert_one_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_identity", flags); + } +} 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 index d91fe95d6c1..3ece98fb8e5 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_one_simple_enum for super::RemoteReducers { .remove_on_reducer::("insert_one_simple_enum", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_simple_enum`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_simple_enum { + /// Set the call-reducer flags for the reducer `insert_one_simple_enum` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_simple_enum(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_simple_enum for super::SetReducerFlags { + fn insert_one_simple_enum(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_simple_enum", flags); + } +} 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 index 78545822349..7606e406d28 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_string for super::RemoteReducers { .remove_on_reducer::("insert_one_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_string { + /// Set the call-reducer flags for the reducer `insert_one_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_string for super::SetReducerFlags { + fn insert_one_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_string", flags); + } +} 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 index 6866ec1731e..d63f011747b 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_one_u_128 for super::RemoteReducers { .remove_on_reducer::("insert_one_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_128 { + /// Set the call-reducer flags for the reducer `insert_one_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_128 for super::SetReducerFlags { + fn insert_one_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u128", flags); + } +} 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 index cf3b5ffaefd..dd1155f2f47 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_u_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_16 { + /// Set the call-reducer flags for the reducer `insert_one_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_16 for super::SetReducerFlags { + fn insert_one_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_256_reducer.rs index a648096b47f..98c8c244247 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_one_u_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_one_u_256 for super::RemoteReducers { .remove_on_reducer::("insert_one_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_256 { + /// Set the call-reducer flags for the reducer `insert_one_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_256 for super::SetReducerFlags { + fn insert_one_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u256", flags); + } +} 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 index 2f170a21fa3..3196c11caa4 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_u_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_32 { + /// Set the call-reducer flags for the reducer `insert_one_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_32 for super::SetReducerFlags { + fn insert_one_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u32", flags); + } +} 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 index 2ed37821717..1d213658af7 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_u_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_64 { + /// Set the call-reducer flags for the reducer `insert_one_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_64 for super::SetReducerFlags { + fn insert_one_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u64", flags); + } +} 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 index 79388a94c31..3d3d14f7e9f 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_one_u_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_one_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_u_8 { + /// Set the call-reducer flags for the reducer `insert_one_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_u_8 for super::SetReducerFlags { + fn insert_one_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_u8", flags); + } +} 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 index a46d28d886b..d806945cfe6 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_one_unit_struct for super::RemoteReducers { .remove_on_reducer::("insert_one_unit_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_one_unit_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_one_unit_struct { + /// Set the call-reducer flags for the reducer `insert_one_unit_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_one_unit_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_one_unit_struct for super::SetReducerFlags { + fn insert_one_unit_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_one_unit_struct", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_every_primitive_struct_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_every_primitive_struct_reducer.rs index f7b0e3dfc7e..2469942acab 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_every_primitive_struct_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_every_primitive_struct_reducer.rs @@ -73,3 +73,24 @@ impl insert_option_every_primitive_struct for super::RemoteReducers { .remove_on_reducer::("insert_option_every_primitive_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_every_primitive_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_every_primitive_struct { + /// Set the call-reducer flags for the reducer `insert_option_every_primitive_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_every_primitive_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_every_primitive_struct for super::SetReducerFlags { + fn insert_option_every_primitive_struct(&self, flags: __ws::CallReducerFlags) { + self.imp + .set_call_reducer_flags("insert_option_every_primitive_struct", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_i_32_reducer.rs index 722e9247c07..1645099c4bc 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_i_32_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_i_32_reducer.rs @@ -68,3 +68,23 @@ impl insert_option_i_32 for super::RemoteReducers { .remove_on_reducer::("insert_option_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_i_32 { + /// Set the call-reducer flags for the reducer `insert_option_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_i_32 for super::SetReducerFlags { + fn insert_option_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_option_i32", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_identity_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_identity_reducer.rs index 75011ff15ea..b6a8094ac7b 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_identity_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_identity_reducer.rs @@ -69,3 +69,23 @@ impl insert_option_identity for super::RemoteReducers { .remove_on_reducer::("insert_option_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_identity { + /// Set the call-reducer flags for the reducer `insert_option_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_identity for super::SetReducerFlags { + fn insert_option_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_option_identity", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_simple_enum_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_simple_enum_reducer.rs index a4a16ceebba..bd3bddfc289 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_simple_enum_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_simple_enum_reducer.rs @@ -71,3 +71,23 @@ impl insert_option_simple_enum for super::RemoteReducers { .remove_on_reducer::("insert_option_simple_enum", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_simple_enum`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_simple_enum { + /// Set the call-reducer flags for the reducer `insert_option_simple_enum` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_simple_enum(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_simple_enum for super::SetReducerFlags { + fn insert_option_simple_enum(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_option_simple_enum", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_string_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_string_reducer.rs index 25f0535fe8c..62df5fc9637 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_string_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_string_reducer.rs @@ -68,3 +68,23 @@ impl insert_option_string for super::RemoteReducers { .remove_on_reducer::("insert_option_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_string { + /// Set the call-reducer flags for the reducer `insert_option_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_string for super::SetReducerFlags { + fn insert_option_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_option_string", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_option_vec_option_i_32_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_option_vec_option_i_32_reducer.rs index 244e5c0905e..a427a6036cc 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_option_vec_option_i_32_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_option_vec_option_i_32_reducer.rs @@ -69,3 +69,23 @@ impl insert_option_vec_option_i_32 for super::RemoteReducers { .remove_on_reducer::("insert_option_vec_option_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_option_vec_option_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_option_vec_option_i_32 { + /// Set the call-reducer flags for the reducer `insert_option_vec_option_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_option_vec_option_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_option_vec_option_i_32 for super::SetReducerFlags { + fn insert_option_vec_option_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_option_vec_option_i32", flags); + } +} 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 index 2e268c6a573..f5aba467538 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_pk_address for super::RemoteReducers { .remove_on_reducer::("insert_pk_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_address { + /// Set the call-reducer flags for the reducer `insert_pk_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_address for super::SetReducerFlags { + fn insert_pk_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_address", flags); + } +} 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 index ccc503aa95c..57f45f08f6d 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_bool for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_bool { + /// Set the call-reducer flags for the reducer `insert_pk_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_bool for super::SetReducerFlags { + fn insert_pk_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_bool", flags); + } +} 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 index d9a116a57c3..c759048ebf6 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_i_128 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_128 { + /// Set the call-reducer flags for the reducer `insert_pk_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_128 for super::SetReducerFlags { + fn insert_pk_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i128", flags); + } +} 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 index 210470a51a6..eeb2555c2c9 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_i_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_16 { + /// Set the call-reducer flags for the reducer `insert_pk_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_16 for super::SetReducerFlags { + fn insert_pk_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_256_reducer.rs index 233c8f38826..abc52651fac 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_i_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_pk_i_256 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_256 { + /// Set the call-reducer flags for the reducer `insert_pk_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_256 for super::SetReducerFlags { + fn insert_pk_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i256", flags); + } +} 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 index 74ba098948b..d2ab5dc024d 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_i_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_32 { + /// Set the call-reducer flags for the reducer `insert_pk_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_32 for super::SetReducerFlags { + fn insert_pk_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i32", flags); + } +} 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 index 240c7ea490c..3858e6fd81f 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_i_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_64 { + /// Set the call-reducer flags for the reducer `insert_pk_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_64 for super::SetReducerFlags { + fn insert_pk_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i64", flags); + } +} 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 index d9dad344608..492a45487c7 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_i_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_i_8 { + /// Set the call-reducer flags for the reducer `insert_pk_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_i_8 for super::SetReducerFlags { + fn insert_pk_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_i8", flags); + } +} 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 index 2d91c50a175..045b52060b4 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_pk_identity for super::RemoteReducers { .remove_on_reducer::("insert_pk_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_identity { + /// Set the call-reducer flags for the reducer `insert_pk_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_identity for super::SetReducerFlags { + fn insert_pk_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_identity", flags); + } +} 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 index b9b6dd33f85..930917a9f42 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_pk_string for super::RemoteReducers { .remove_on_reducer::("insert_pk_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_string { + /// Set the call-reducer flags for the reducer `insert_pk_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_string for super::SetReducerFlags { + fn insert_pk_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_string", flags); + } +} 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 index 80ebc9acd21..f66528a632c 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_u_128 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_128 { + /// Set the call-reducer flags for the reducer `insert_pk_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_128 for super::SetReducerFlags { + fn insert_pk_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u128", flags); + } +} 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 index 269d095d7de..523a26e4e69 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_u_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_16 { + /// Set the call-reducer flags for the reducer `insert_pk_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_16 for super::SetReducerFlags { + fn insert_pk_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_256_reducer.rs index 3f348f24f26..8be24c42cf8 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_pk_u_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_pk_u_256 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_256 { + /// Set the call-reducer flags for the reducer `insert_pk_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_256 for super::SetReducerFlags { + fn insert_pk_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u256", flags); + } +} 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 index ac372aa982e..d64e320bded 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_u_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_32 { + /// Set the call-reducer flags for the reducer `insert_pk_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_32 for super::SetReducerFlags { + fn insert_pk_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u32", flags); + } +} 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 index edba8e6bfce..1d58f1a5a24 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_u_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_64 { + /// Set the call-reducer flags for the reducer `insert_pk_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_64 for super::SetReducerFlags { + fn insert_pk_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u64", flags); + } +} 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 index 936420766fb..26a320bac70 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_pk_u_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_pk_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_pk_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_pk_u_8 { + /// Set the call-reducer flags for the reducer `insert_pk_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_pk_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_pk_u_8 for super::SetReducerFlags { + fn insert_pk_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_pk_u8", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_primitives_as_strings_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_primitives_as_strings_reducer.rs index abb56317d4e..3538a93a302 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_primitives_as_strings_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_primitives_as_strings_reducer.rs @@ -71,3 +71,23 @@ impl insert_primitives_as_strings for super::RemoteReducers { .remove_on_reducer::("insert_primitives_as_strings", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_primitives_as_strings`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_primitives_as_strings { + /// Set the call-reducer flags for the reducer `insert_primitives_as_strings` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_primitives_as_strings(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_primitives_as_strings for super::SetReducerFlags { + fn insert_primitives_as_strings(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_primitives_as_strings", flags); + } +} 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 index bc7591f7927..57e61923ae2 100644 --- 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 @@ -73,3 +73,23 @@ impl insert_table_holds_table for super::RemoteReducers { .remove_on_reducer::("insert_table_holds_table", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_table_holds_table`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_table_holds_table { + /// Set the call-reducer flags for the reducer `insert_table_holds_table` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_table_holds_table(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_table_holds_table for super::SetReducerFlags { + fn insert_table_holds_table(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_table_holds_table", flags); + } +} 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 index 2436e4beff2..aae98d1d331 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_address for super::RemoteReducers { .remove_on_reducer::("insert_unique_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_address { + /// Set the call-reducer flags for the reducer `insert_unique_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_address for super::SetReducerFlags { + fn insert_unique_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_address", flags); + } +} 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 index 65993a130cd..b035dfd07b8 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_bool for super::RemoteReducers { .remove_on_reducer::("insert_unique_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_bool { + /// Set the call-reducer flags for the reducer `insert_unique_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_bool for super::SetReducerFlags { + fn insert_unique_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_bool", flags); + } +} 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 index 822c9d85a11..e44e77f5a8c 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_i_128 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_128 { + /// Set the call-reducer flags for the reducer `insert_unique_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_128 for super::SetReducerFlags { + fn insert_unique_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i128", flags); + } +} 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 index f18efd9b31c..5bc6b4aba3a 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_i_16 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_16 { + /// Set the call-reducer flags for the reducer `insert_unique_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_16 for super::SetReducerFlags { + fn insert_unique_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_256_reducer.rs index e034afd5b49..bbbcce0c566 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_i_256_reducer.rs @@ -70,3 +70,23 @@ impl insert_unique_i_256 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_256 { + /// Set the call-reducer flags for the reducer `insert_unique_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_256 for super::SetReducerFlags { + fn insert_unique_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i256", flags); + } +} 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 index 1a48bf9b7d2..9a797693ee8 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_i_32 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_32 { + /// Set the call-reducer flags for the reducer `insert_unique_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_32 for super::SetReducerFlags { + fn insert_unique_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i32", flags); + } +} 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 index 3c7a17b23af..3ec098e667e 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_i_64 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_64 { + /// Set the call-reducer flags for the reducer `insert_unique_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_64 for super::SetReducerFlags { + fn insert_unique_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i64", flags); + } +} 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 index ecb1dd6cb05..fca339652bf 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_i_8 for super::RemoteReducers { .remove_on_reducer::("insert_unique_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_i_8 { + /// Set the call-reducer flags for the reducer `insert_unique_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_i_8 for super::SetReducerFlags { + fn insert_unique_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_i8", flags); + } +} 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 index 90104824710..cdea4a89483 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_identity for super::RemoteReducers { .remove_on_reducer::("insert_unique_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_identity { + /// Set the call-reducer flags for the reducer `insert_unique_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_identity for super::SetReducerFlags { + fn insert_unique_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_identity", flags); + } +} 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 index 824203ab64f..732ffcd8a09 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_string for super::RemoteReducers { .remove_on_reducer::("insert_unique_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_string { + /// Set the call-reducer flags for the reducer `insert_unique_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_string for super::SetReducerFlags { + fn insert_unique_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_string", flags); + } +} 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 index b138da20558..980b7f3a0c2 100644 --- 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 @@ -70,3 +70,23 @@ impl insert_unique_u_128 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_128 { + /// Set the call-reducer flags for the reducer `insert_unique_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_128 for super::SetReducerFlags { + fn insert_unique_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u128", flags); + } +} 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 index b937dce5f71..7faf69e02a4 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_u_16 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_16 { + /// Set the call-reducer flags for the reducer `insert_unique_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_16 for super::SetReducerFlags { + fn insert_unique_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_256_reducer.rs index 74e2dc07104..9360698d6fc 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_unique_u_256_reducer.rs @@ -70,3 +70,23 @@ impl insert_unique_u_256 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_256 { + /// Set the call-reducer flags for the reducer `insert_unique_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_256 for super::SetReducerFlags { + fn insert_unique_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u256", flags); + } +} 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 index f4bb9b5f095..6f12f882dee 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_u_32 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_32 { + /// Set the call-reducer flags for the reducer `insert_unique_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_32 for super::SetReducerFlags { + fn insert_unique_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u32", flags); + } +} 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 index 77c266af779..aedd948c1f5 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_u_64 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_64 { + /// Set the call-reducer flags for the reducer `insert_unique_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_64 for super::SetReducerFlags { + fn insert_unique_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u64", flags); + } +} 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 index 25c43414219..c7179a933a0 100644 --- 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 @@ -69,3 +69,23 @@ impl insert_unique_u_8 for super::RemoteReducers { .remove_on_reducer::("insert_unique_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_unique_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_unique_u_8 { + /// Set the call-reducer flags for the reducer `insert_unique_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_unique_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_unique_u_8 for super::SetReducerFlags { + fn insert_unique_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_unique_u8", flags); + } +} 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 index db8ec7f7344..65ba4d7cb4e 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_address for super::RemoteReducers { .remove_on_reducer::("insert_vec_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_address { + /// Set the call-reducer flags for the reducer `insert_vec_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_address for super::SetReducerFlags { + fn insert_vec_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_address", flags); + } +} 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 index 58047e6edc8..375fb8054c0 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_bool for super::RemoteReducers { .remove_on_reducer::("insert_vec_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_bool { + /// Set the call-reducer flags for the reducer `insert_vec_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_bool for super::SetReducerFlags { + fn insert_vec_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_bool", flags); + } +} 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 index c9c09124db6..05d89ba4491 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_vec_byte_struct for super::RemoteReducers { .remove_on_reducer::("insert_vec_byte_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_byte_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_byte_struct { + /// Set the call-reducer flags for the reducer `insert_vec_byte_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_byte_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_byte_struct for super::SetReducerFlags { + fn insert_vec_byte_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_byte_struct", flags); + } +} 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 index 3c09bcc02a6..30f786e2388 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_vec_enum_with_payload for super::RemoteReducers { .remove_on_reducer::("insert_vec_enum_with_payload", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_enum_with_payload`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_enum_with_payload { + /// Set the call-reducer flags for the reducer `insert_vec_enum_with_payload` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_enum_with_payload(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_enum_with_payload for super::SetReducerFlags { + fn insert_vec_enum_with_payload(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_enum_with_payload", flags); + } +} 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 index a53a0080d2e..93bc294f3fa 100644 --- 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 @@ -71,3 +71,24 @@ impl insert_vec_every_primitive_struct for super::RemoteReducers { .remove_on_reducer::("insert_vec_every_primitive_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_every_primitive_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_every_primitive_struct { + /// Set the call-reducer flags for the reducer `insert_vec_every_primitive_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_every_primitive_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_every_primitive_struct for super::SetReducerFlags { + fn insert_vec_every_primitive_struct(&self, flags: __ws::CallReducerFlags) { + self.imp + .set_call_reducer_flags("insert_vec_every_primitive_struct", flags); + } +} 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 index a2a3a8ccbd3..a230c84c5aa 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_vec_every_vec_struct for super::RemoteReducers { .remove_on_reducer::("insert_vec_every_vec_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_every_vec_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_every_vec_struct { + /// Set the call-reducer flags for the reducer `insert_vec_every_vec_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_every_vec_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_every_vec_struct for super::SetReducerFlags { + fn insert_vec_every_vec_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_every_vec_struct", flags); + } +} 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 index 8bcdfd435d6..c9d8fd540f8 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_f_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_f32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_f32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_f_32 { + /// Set the call-reducer flags for the reducer `insert_vec_f32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_f_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_f_32 for super::SetReducerFlags { + fn insert_vec_f_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_f32", flags); + } +} 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 index 7139fe27713..2407b5266a8 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_f_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_f64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_f64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_f_64 { + /// Set the call-reducer flags for the reducer `insert_vec_f64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_f_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_f_64 for super::SetReducerFlags { + fn insert_vec_f_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_f64", flags); + } +} 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 index ca17c9db766..90908728b9c 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_i_128 for super::RemoteReducers { .remove_on_reducer::("insert_vec_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_128 { + /// Set the call-reducer flags for the reducer `insert_vec_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_128 for super::SetReducerFlags { + fn insert_vec_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i128", flags); + } +} 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 index e2a2a0e71a7..72a7ff9ec0a 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_i_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_16 { + /// Set the call-reducer flags for the reducer `insert_vec_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_16 for super::SetReducerFlags { + fn insert_vec_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_256_reducer.rs index 96a943a5418..7596e4121aa 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_i_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_vec_i_256 for super::RemoteReducers { .remove_on_reducer::("insert_vec_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_256 { + /// Set the call-reducer flags for the reducer `insert_vec_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_256 for super::SetReducerFlags { + fn insert_vec_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i256", flags); + } +} 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 index c804fb80c25..625cb995737 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_i_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_32 { + /// Set the call-reducer flags for the reducer `insert_vec_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_32 for super::SetReducerFlags { + fn insert_vec_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i32", flags); + } +} 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 index 900f2fd43f4..db04cdcd294 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_i_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_64 { + /// Set the call-reducer flags for the reducer `insert_vec_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_64 for super::SetReducerFlags { + fn insert_vec_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i64", flags); + } +} 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 index ebb68a09c0a..2b1aaea964a 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_i_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_i_8 { + /// Set the call-reducer flags for the reducer `insert_vec_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_i_8 for super::SetReducerFlags { + fn insert_vec_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_i8", flags); + } +} 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 index 09d7327eff5..3d598bb5c74 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_identity for super::RemoteReducers { .remove_on_reducer::("insert_vec_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_identity { + /// Set the call-reducer flags for the reducer `insert_vec_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_identity for super::SetReducerFlags { + fn insert_vec_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_identity", flags); + } +} 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 index 2c9171884b8..0590f61e88e 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_vec_simple_enum for super::RemoteReducers { .remove_on_reducer::("insert_vec_simple_enum", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_simple_enum`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_simple_enum { + /// Set the call-reducer flags for the reducer `insert_vec_simple_enum` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_simple_enum(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_simple_enum for super::SetReducerFlags { + fn insert_vec_simple_enum(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_simple_enum", flags); + } +} 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 index eaf337730a0..4f36a761871 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_string for super::RemoteReducers { .remove_on_reducer::("insert_vec_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_string { + /// Set the call-reducer flags for the reducer `insert_vec_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_string for super::SetReducerFlags { + fn insert_vec_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_string", flags); + } +} 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 index 0ffd525cc62..0b5f19e7d07 100644 --- 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 @@ -68,3 +68,23 @@ impl insert_vec_u_128 for super::RemoteReducers { .remove_on_reducer::("insert_vec_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_128 { + /// Set the call-reducer flags for the reducer `insert_vec_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_128 for super::SetReducerFlags { + fn insert_vec_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u128", flags); + } +} 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 index 8a0290e7dea..d5e35731f9e 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_u_16 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_16 { + /// Set the call-reducer flags for the reducer `insert_vec_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_16 for super::SetReducerFlags { + fn insert_vec_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_256_reducer.rs index 01fcacf9250..e9039f664f0 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/insert_vec_u_256_reducer.rs @@ -68,3 +68,23 @@ impl insert_vec_u_256 for super::RemoteReducers { .remove_on_reducer::("insert_vec_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_256 { + /// Set the call-reducer flags for the reducer `insert_vec_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_256 for super::SetReducerFlags { + fn insert_vec_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u256", flags); + } +} 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 index aa60e7ded79..805c4eb4527 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_u_32 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_32 { + /// Set the call-reducer flags for the reducer `insert_vec_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_32 for super::SetReducerFlags { + fn insert_vec_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u32", flags); + } +} 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 index 789afadaabf..4576b20e6b8 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_u_64 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_64 { + /// Set the call-reducer flags for the reducer `insert_vec_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_64 for super::SetReducerFlags { + fn insert_vec_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u64", flags); + } +} 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 index f813712a68a..6ba80949e11 100644 --- 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 @@ -67,3 +67,23 @@ impl insert_vec_u_8 for super::RemoteReducers { self.imp.remove_on_reducer::("insert_vec_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_u_8 { + /// Set the call-reducer flags for the reducer `insert_vec_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_u_8 for super::SetReducerFlags { + fn insert_vec_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_u8", flags); + } +} 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 index e0f6862d4e3..dfb499f11ed 100644 --- 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 @@ -71,3 +71,23 @@ impl insert_vec_unit_struct for super::RemoteReducers { .remove_on_reducer::("insert_vec_unit_struct", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `insert_vec_unit_struct`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_insert_vec_unit_struct { + /// Set the call-reducer flags for the reducer `insert_vec_unit_struct` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn insert_vec_unit_struct(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_insert_vec_unit_struct for super::SetReducerFlags { + fn insert_vec_unit_struct(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("insert_vec_unit_struct", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/mod.rs b/crates/sdk/tests/test-client/src/module_bindings/mod.rs index ae115cef752..02caa0e57fa 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/mod.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/mod.rs @@ -2306,6 +2306,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule { type Reducer = Reducer; type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; type DbUpdate = DbUpdate; type SubscriptionHandle = SubscriptionHandle; } @@ -2320,6 +2321,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers { type Module = RemoteModule; } +#[doc(hidden)] +/// The `set_reducer_flags` field of [`DbConnection`], +/// with methods provided by extension traits for each reducer defined by the module. +/// Each method sets the flags for the reducer with the same name. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub struct SetReducerFlags { + imp: __sdk::db_connection::DbContextImpl, +} + +impl __sdk::spacetime_module::InModule for SetReducerFlags { + type Module = RemoteModule; +} + /// The `db` field of [`EventContext`] and [`DbConnection`], /// with methods provided by extension traits for each table defined by the module. pub struct RemoteTables { @@ -2351,6 +2366,12 @@ pub struct DbConnection { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + #[doc(hidden)] + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, imp: __sdk::db_connection::DbContextImpl, } @@ -2362,6 +2383,7 @@ impl __sdk::spacetime_module::InModule for DbConnection { impl __sdk::db_context::DbContext for DbConnection { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -2369,6 +2391,9 @@ impl __sdk::db_context::DbContext for DbConnection { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -2468,6 +2493,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, imp, } } @@ -2480,6 +2506,11 @@ pub struct EventContext { pub db: RemoteTables, /// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`]. pub reducers: RemoteReducers, + /// Access to setting the call-flags of each reducer defined for each reducer defined by the module + /// via extension traits implemented for [`SetReducerFlags`]. + /// + /// This type is currently unstable and may be removed without a major version bump. + pub set_reducer_flags: SetReducerFlags, /// The event which caused these callbacks to run. pub event: __sdk::event::Event, imp: __sdk::db_connection::DbContextImpl, @@ -2492,6 +2523,7 @@ impl __sdk::spacetime_module::InModule for EventContext { impl __sdk::db_context::DbContext for EventContext { type DbView = RemoteTables; type Reducers = RemoteReducers; + type SetReducerFlags = SetReducerFlags; fn db(&self) -> &Self::DbView { &self.db @@ -2499,6 +2531,9 @@ impl __sdk::db_context::DbContext for EventContext { fn reducers(&self) -> &Self::Reducers { &self.reducers } + fn set_reducer_flags(&self) -> &Self::SetReducerFlags { + &self.set_reducer_flags + } fn is_active(&self) -> bool { self.imp.is_active() @@ -2530,6 +2565,7 @@ impl __sdk::spacetime_module::EventContext for EventContext { Self { db: RemoteTables { imp: imp.clone() }, reducers: RemoteReducers { imp: imp.clone() }, + set_reducer_flags: SetReducerFlags { imp: imp.clone() }, event, imp, } @@ -2561,6 +2597,7 @@ pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, > { @@ -2569,6 +2606,7 @@ impl< Ctx: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, + SetReducerFlags = SetReducerFlags, SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder, >, > RemoteDbContext for Ctx diff --git a/crates/sdk/tests/test-client/src/module_bindings/no_op_succeeds_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/no_op_succeeds_reducer.rs index 88f70b0369c..a73357f3506 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/no_op_succeeds_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/no_op_succeeds_reducer.rs @@ -62,3 +62,23 @@ impl no_op_succeeds for super::RemoteReducers { self.imp.remove_on_reducer::("no_op_succeeds", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `no_op_succeeds`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_no_op_succeeds { + /// Set the call-reducer flags for the reducer `no_op_succeeds` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn no_op_succeeds(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_no_op_succeeds for super::SetReducerFlags { + fn no_op_succeeds(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("no_op_succeeds", flags); + } +} 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 index fe4aa3df19b..eaa5ef67c19 100644 --- 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 @@ -69,3 +69,23 @@ impl update_pk_address for super::RemoteReducers { .remove_on_reducer::("update_pk_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_address { + /// Set the call-reducer flags for the reducer `update_pk_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_address for super::SetReducerFlags { + fn update_pk_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_address", flags); + } +} 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 index d628755d73f..98060ce67d5 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_bool for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_bool { + /// Set the call-reducer flags for the reducer `update_pk_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_bool for super::SetReducerFlags { + fn update_pk_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_bool", flags); + } +} 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 index a89d9ac7667..57507dc1a03 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_i_128 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_128 { + /// Set the call-reducer flags for the reducer `update_pk_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_128 for super::SetReducerFlags { + fn update_pk_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i128", flags); + } +} 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 index dd2d4947c34..19d068bf77c 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_i_16 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_16 { + /// Set the call-reducer flags for the reducer `update_pk_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_16 for super::SetReducerFlags { + fn update_pk_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_256_reducer.rs index 2c51518493d..3172fe37607 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_i_256_reducer.rs @@ -68,3 +68,23 @@ impl update_pk_i_256 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_256 { + /// Set the call-reducer flags for the reducer `update_pk_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_256 for super::SetReducerFlags { + fn update_pk_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i256", flags); + } +} 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 index ec00b330548..2087c38d060 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_i_32 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_32 { + /// Set the call-reducer flags for the reducer `update_pk_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_32 for super::SetReducerFlags { + fn update_pk_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i32", flags); + } +} 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 index 986eacfe561..746c92a6ca0 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_i_64 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_64 { + /// Set the call-reducer flags for the reducer `update_pk_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_64 for super::SetReducerFlags { + fn update_pk_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i64", flags); + } +} 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 index d53c5f0638d..5f145137717 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_i_8 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_i_8 { + /// Set the call-reducer flags for the reducer `update_pk_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_i_8 for super::SetReducerFlags { + fn update_pk_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_i8", flags); + } +} 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 index b2c24d1fc44..833e49a00de 100644 --- 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 @@ -70,3 +70,23 @@ impl update_pk_identity for super::RemoteReducers { .remove_on_reducer::("update_pk_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_identity { + /// Set the call-reducer flags for the reducer `update_pk_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_identity for super::SetReducerFlags { + fn update_pk_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_identity", flags); + } +} 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 index 9ac9862932d..66a3702b303 100644 --- 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 @@ -69,3 +69,23 @@ impl update_pk_string for super::RemoteReducers { .remove_on_reducer::("update_pk_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_string { + /// Set the call-reducer flags for the reducer `update_pk_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_string for super::SetReducerFlags { + fn update_pk_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_string", flags); + } +} 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 index aa0522b06e1..e2458fe54a5 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_u_128 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_128 { + /// Set the call-reducer flags for the reducer `update_pk_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_128 for super::SetReducerFlags { + fn update_pk_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u128", flags); + } +} 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 index e7eb4959a62..76ddd2a4f30 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_u_16 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_16 { + /// Set the call-reducer flags for the reducer `update_pk_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_16 for super::SetReducerFlags { + fn update_pk_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_256_reducer.rs index fb033cd8119..cc1fbc88f69 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/update_pk_u_256_reducer.rs @@ -68,3 +68,23 @@ impl update_pk_u_256 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_256 { + /// Set the call-reducer flags for the reducer `update_pk_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_256 for super::SetReducerFlags { + fn update_pk_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u256", flags); + } +} 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 index 81ad34486bb..ea212b4b4ac 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_u_32 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_32 { + /// Set the call-reducer flags for the reducer `update_pk_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_32 for super::SetReducerFlags { + fn update_pk_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u32", flags); + } +} 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 index c4452ed6ac9..b2325b21468 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_u_64 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_64 { + /// Set the call-reducer flags for the reducer `update_pk_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_64 for super::SetReducerFlags { + fn update_pk_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u64", flags); + } +} 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 index 80eaa0df40e..6654de8d585 100644 --- 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 @@ -68,3 +68,23 @@ impl update_pk_u_8 for super::RemoteReducers { self.imp.remove_on_reducer::("update_pk_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_pk_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_pk_u_8 { + /// Set the call-reducer flags for the reducer `update_pk_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_pk_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_pk_u_8 for super::SetReducerFlags { + fn update_pk_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_pk_u8", flags); + } +} 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 index 5be4234093b..bb1f61defb4 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_address for super::RemoteReducers { .remove_on_reducer::("update_unique_address", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_address`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_address { + /// Set the call-reducer flags for the reducer `update_unique_address` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_address(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_address for super::SetReducerFlags { + fn update_unique_address(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_address", flags); + } +} 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 index 6d153e8e58d..5b12f801635 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_bool for super::RemoteReducers { .remove_on_reducer::("update_unique_bool", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_bool`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_bool { + /// Set the call-reducer flags for the reducer `update_unique_bool` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_bool(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_bool for super::SetReducerFlags { + fn update_unique_bool(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_bool", flags); + } +} 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 index 0966ec5643d..46295956068 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_i_128 for super::RemoteReducers { .remove_on_reducer::("update_unique_i128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_128 { + /// Set the call-reducer flags for the reducer `update_unique_i128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_128 for super::SetReducerFlags { + fn update_unique_i_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i128", flags); + } +} 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 index 3a63acad55e..55b96d25fb2 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_i_16 for super::RemoteReducers { .remove_on_reducer::("update_unique_i16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_16 { + /// Set the call-reducer flags for the reducer `update_unique_i16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_16 for super::SetReducerFlags { + fn update_unique_i_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_256_reducer.rs index bbf7eac512b..c940a2aff8e 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_i_256_reducer.rs @@ -70,3 +70,23 @@ impl update_unique_i_256 for super::RemoteReducers { .remove_on_reducer::("update_unique_i256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_256 { + /// Set the call-reducer flags for the reducer `update_unique_i256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_256 for super::SetReducerFlags { + fn update_unique_i_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i256", flags); + } +} 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 index bfe4a1fc480..25d960743e9 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_i_32 for super::RemoteReducers { .remove_on_reducer::("update_unique_i32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_32 { + /// Set the call-reducer flags for the reducer `update_unique_i32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_32 for super::SetReducerFlags { + fn update_unique_i_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i32", flags); + } +} 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 index ca687c6ed40..69e512b73db 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_i_64 for super::RemoteReducers { .remove_on_reducer::("update_unique_i64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_64 { + /// Set the call-reducer flags for the reducer `update_unique_i64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_64 for super::SetReducerFlags { + fn update_unique_i_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i64", flags); + } +} 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 index f616887fdcf..f113579e40b 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_i_8 for super::RemoteReducers { .remove_on_reducer::("update_unique_i8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_i8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_i_8 { + /// Set the call-reducer flags for the reducer `update_unique_i8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_i_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_i_8 for super::SetReducerFlags { + fn update_unique_i_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_i8", flags); + } +} 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 index 85f89061c0a..4c0e9b403f4 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_identity for super::RemoteReducers { .remove_on_reducer::("update_unique_identity", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_identity`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_identity { + /// Set the call-reducer flags for the reducer `update_unique_identity` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_identity(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_identity for super::SetReducerFlags { + fn update_unique_identity(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_identity", flags); + } +} 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 index 7337130e058..7de7b54e867 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_string for super::RemoteReducers { .remove_on_reducer::("update_unique_string", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_string`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_string { + /// Set the call-reducer flags for the reducer `update_unique_string` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_string(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_string for super::SetReducerFlags { + fn update_unique_string(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_string", flags); + } +} 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 index 84feb388ff2..e3bfb08dd7d 100644 --- 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 @@ -70,3 +70,23 @@ impl update_unique_u_128 for super::RemoteReducers { .remove_on_reducer::("update_unique_u128", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u128`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_128 { + /// Set the call-reducer flags for the reducer `update_unique_u128` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_128(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_128 for super::SetReducerFlags { + fn update_unique_u_128(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u128", flags); + } +} 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 index 099cb90138b..117f96a7fc5 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_u_16 for super::RemoteReducers { .remove_on_reducer::("update_unique_u16", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u16`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_16 { + /// Set the call-reducer flags for the reducer `update_unique_u16` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_16(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_16 for super::SetReducerFlags { + fn update_unique_u_16(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u16", flags); + } +} diff --git a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_256_reducer.rs b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_256_reducer.rs index 8a7ee0281e7..b3194175dd3 100644 --- a/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_256_reducer.rs +++ b/crates/sdk/tests/test-client/src/module_bindings/update_unique_u_256_reducer.rs @@ -70,3 +70,23 @@ impl update_unique_u_256 for super::RemoteReducers { .remove_on_reducer::("update_unique_u256", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u256`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_256 { + /// Set the call-reducer flags for the reducer `update_unique_u256` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_256(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_256 for super::SetReducerFlags { + fn update_unique_u_256(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u256", flags); + } +} 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 index 9bb0e77eae0..8eb5b3bd4bb 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_u_32 for super::RemoteReducers { .remove_on_reducer::("update_unique_u32", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u32`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_32 { + /// Set the call-reducer flags for the reducer `update_unique_u32` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_32(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_32 for super::SetReducerFlags { + fn update_unique_u_32(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u32", flags); + } +} 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 index 1f8b0986615..7d4fe9211f0 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_u_64 for super::RemoteReducers { .remove_on_reducer::("update_unique_u64", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u64`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_64 { + /// Set the call-reducer flags for the reducer `update_unique_u64` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_64(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_64 for super::SetReducerFlags { + fn update_unique_u_64(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u64", flags); + } +} 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 index 7c35ce2c198..cc5fd6db16b 100644 --- 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 @@ -69,3 +69,23 @@ impl update_unique_u_8 for super::RemoteReducers { .remove_on_reducer::("update_unique_u8", callback.0) } } + +#[allow(non_camel_case_types)] +#[doc(hidden)] +/// Extension trait for setting the call-flags for the reducer `update_unique_u8`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_update_unique_u_8 { + /// Set the call-reducer flags for the reducer `update_unique_u8` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn update_unique_u_8(&self, flags: __ws::CallReducerFlags); +} + +impl set_flags_for_update_unique_u_8 for super::SetReducerFlags { + fn update_unique_u_8(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("update_unique_u8", flags); + } +} diff --git a/crates/testing/src/modules.rs b/crates/testing/src/modules.rs index 711298ee32a..497a39e24c9 100644 --- a/crates/testing/src/modules.rs +++ b/crates/testing/src/modules.rs @@ -11,7 +11,7 @@ use spacetimedb_client_api::routes::subscribe::generate_random_address; use spacetimedb_lib::ser::serde::SerializeWrapper; use tokio::runtime::{Builder, Runtime}; -use spacetimedb::client::{ClientActorId, ClientConnection, DataMessage, Protocol}; +use spacetimedb::client::{ClientActorId, ClientConfig, ClientConnection, DataMessage}; use spacetimedb::config::{FilesLocal, SpacetimeDbFiles}; use spacetimedb::database_logger::DatabaseLogger; use spacetimedb::db::{Config, Storage}; @@ -50,23 +50,25 @@ pub struct ModuleHandle { } impl ModuleHandle { - pub async fn call_reducer_json(&self, reducer: &str, args: sats::ProductValue) -> anyhow::Result<()> { - let args = serde_json::to_string(&args).unwrap(); - let message = ws::ClientMessage::CallReducer(ws::CallReducer { + fn call_reducer_msg(reducer: &str, args: Args) -> ws::ClientMessage { + ws::ClientMessage::CallReducer(ws::CallReducer { reducer: reducer.into(), args, request_id: 0, - }); + flags: ws::CallReducerFlags::FullUpdate, + }) + } + + pub async fn call_reducer_json(&self, reducer: &str, args: sats::ProductValue) -> anyhow::Result<()> { + let args = serde_json::to_string(&args).unwrap(); + let message = Self::call_reducer_msg(reducer, args); self.send(serde_json::to_string(&SerializeWrapper::new(message)).unwrap()) .await } pub async fn call_reducer_binary(&self, reducer: &str, args: sats::ProductValue) -> anyhow::Result<()> { - let message = ws::ClientMessage::CallReducer(ws::CallReducer { - reducer: reducer.into(), - args: bsatn::to_vec(&args).unwrap(), - request_id: 0, - }); + let args = bsatn::to_vec(&args).unwrap(); + let message = Self::call_reducer_msg(reducer, args); self.send(bsatn::to_vec(&message).unwrap()).await } @@ -195,7 +197,7 @@ impl CompiledModule { // for stuff like "get logs" or "get message log" ModuleHandle { _env: env, - client: ClientConnection::dummy(client_id, Protocol::Text, instance.id, module_rx), + client: ClientConnection::dummy(client_id, ClientConfig::for_test(), instance.id, module_rx), db_identity, } } diff --git a/crates/testing/tests/standalone_integration_test.rs b/crates/testing/tests/standalone_integration_test.rs index 8fede70fe4a..3f458f4d9e5 100644 --- a/crates/testing/tests/standalone_integration_test.rs +++ b/crates/testing/tests/standalone_integration_test.rs @@ -47,17 +47,21 @@ fn test_calling_a_reducer_in_module(module_name: &'static str) { DEFAULT_CONFIG, |module| async move { let json = - r#"{"CallReducer": {"reducer": "add", "args": "[\"Tyrion\", 24]", "request_id": 0 }}"#.to_string(); + r#"{"CallReducer": {"reducer": "add", "args": "[\"Tyrion\", 24]", "request_id": 0, "flags": 0 }}"# + .to_string(); module.send(json).await.unwrap(); let json = - r#"{"CallReducer": {"reducer": "add", "args": "[\"Cersei\", 31]", "request_id": 1 }}"#.to_string(); + r#"{"CallReducer": {"reducer": "add", "args": "[\"Cersei\", 31]", "request_id": 1, "flags": 0 }}"# + .to_string(); module.send(json).await.unwrap(); - let json = r#"{"CallReducer": {"reducer": "say_hello", "args": "[]", "request_id": 2 }}"#.to_string(); + let json = + r#"{"CallReducer": {"reducer": "say_hello", "args": "[]", "request_id": 2, "flags": 0 }}"#.to_string(); module.send(json).await.unwrap(); - let json = r#"{"CallReducer": {"reducer": "list_over_age", "args": "[30]", "request_id": 3 }}"#.to_string(); + let json = r#"{"CallReducer": {"reducer": "list_over_age", "args": "[30]", "request_id": 3, "flags": 0 }}"# + .to_string(); module.send(json).await.unwrap(); assert_eq!( @@ -175,7 +179,8 @@ fn test_call_query_macro() { "reducer": "test", "args": "[ { \"x\": 0, \"y\": 2, \"z\": \"Macro\" }, { \"foo\": \"Foo\" }, { \"Foo\": {} }, { \"Baz\": \"buzz\" } ]", - "request_id": 0 + "request_id": 0, + "flags": 0 } }"# .to_string(); module.send(json).await.unwrap(); @@ -251,7 +256,8 @@ fn test_index_scans() { } async fn bench_call<'a>(module: &ModuleHandle, call: &str, count: &u32) -> Duration { - let json = format!(r#"{{"CallReducer": {{"reducer": "{call}", "args": "[{count}]", "request_id": 0 }}}}"#); + let json = + format!(r#"{{"CallReducer": {{"reducer": "{call}", "args": "[{count}]", "request_id": 0, "flags": 0 }}}}"#); let now = Instant::now(); From 663c5b11845b94dafa1b1043f22a4129b1baf1ca Mon Sep 17 00:00:00 2001 From: James Gilles Date: Mon, 4 Nov 2024 13:30:27 -0500 Subject: [PATCH 10/12] Keep little-endian standalone ControlDb keys --- crates/standalone/src/control_db.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/standalone/src/control_db.rs b/crates/standalone/src/control_db.rs index 102b1a96ae6..30e36ad8d22 100644 --- a/crates/standalone/src/control_db.rs +++ b/crates/standalone/src/control_db.rs @@ -10,6 +10,11 @@ use spacetimedb_lib::bsatn; #[cfg(test)] mod tests; +/// A control database when SpacetimeDB is running standalone. +/// +/// Important note: The `Addresses` and `Identities` stored in this database +/// are stored as *little-endian* byte arrays. This means that printing such an array +/// in hexadecimal will result in the REVERSE of the standard way to print `Addresses` and `Identities`. #[derive(Clone)] pub struct ControlDb { db: sled::Db, @@ -83,9 +88,7 @@ impl ControlDb { pub fn spacetime_reverse_dns(&self, database_identity: &Identity) -> Result> { let tree = self.db.open_tree("reverse_dns")?; - // TODO: everywhere in this file should use `to_be_byte_array`. - // We may want to implement some sort of trait to ensure that it is used consistently. - let value = tree.get(database_identity.to_be_byte_array())?; + let value = tree.get(database_identity.to_byte_array())?; if let Some(value) = value { let vec: Vec = serde_json::from_slice(&value[..])?; return Ok(vec); @@ -140,7 +143,7 @@ impl ControlDb { } } - let identity_bytes = database_identity.to_be_byte_array(); + let identity_bytes = database_identity.to_byte_array(); let tree = self.db.open_tree("dns")?; tree.insert(domain.to_lowercase().as_bytes(), &identity_bytes)?; @@ -181,7 +184,7 @@ impl ControlDb { } } None => { - tree.insert(key, &owner_identity.to_be_byte_array())?; + tree.insert(key, &owner_identity.to_byte_array())?; Ok(RegisterTldResult::Success { domain: tld }) } } @@ -420,7 +423,7 @@ impl ControlDb { /// `control_budget`, where a cached copy is stored along with business logic for managing it. pub fn get_energy_balance(&self, identity: &Identity) -> Result> { let tree = self.db.open_tree("energy_budget")?; - let value = tree.get(identity.to_be_byte_array())?; + let value = tree.get(identity.to_byte_array())?; if let Some(value) = value { let arr = <[u8; 16]>::try_from(value.as_ref()).map_err(|_| bsatn::DecodeError::BufferLength { for_type: "Identity".into(), @@ -439,7 +442,7 @@ impl ControlDb { /// `control_budget`, where a cached copy is stored along with business logic for managing it. pub fn set_energy_balance(&self, identity: Identity, energy_balance: energy::EnergyBalance) -> Result<()> { let tree = self.db.open_tree("energy_budget")?; - tree.insert(identity.to_be_byte_array(), &energy_balance.get().to_be_bytes())?; + tree.insert(identity.to_byte_array(), &energy_balance.get().to_be_bytes())?; Ok(()) } From 3b8068704e3ca8a15bc231860d44c9afb619cf09 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Mon, 4 Nov 2024 16:32:32 -0500 Subject: [PATCH 11/12] Ah, fix some incorrect controldb paths --- crates/lib/src/identity.rs | 19 +++++++++++++++++-- crates/standalone/src/control_db.rs | 14 +++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/crates/lib/src/identity.rs b/crates/lib/src/identity.rs index 84ef9fedbca..0cc0e2dbdfa 100644 --- a/crates/lib/src/identity.rs +++ b/crates/lib/src/identity.rs @@ -99,11 +99,26 @@ impl Identity { } /// Returns an `Identity` defined as the given byte `slice`. - /// The slice is assumed to be in big-endian format. - pub fn from_slice(slice: &[u8]) -> Self { + /// The slice is assumed to be in BIG-ENDIAN format. + /// + /// This method is the correct choice if you have converted the bytes of a hexadecimal-formatted `Identity` + /// to a byte array in the following way: + /// ```ignore + /// "0xb0b1b2..." + /// -> + /// [0xb0, 0xb1, 0xb2, ...] + /// ``` + pub fn from_be_slice(slice: &[u8]) -> Self { Self::from_be_byte_array(slice.try_into().unwrap()) } + /// Returns an `Identity` defined as the given byte `slice`. + /// The slice is assumed to be in LITTLE-ENDIAN format. + /// If you are parsing an `Identity` from a string, you probably want `from_be_slice` instead. + pub fn from_slice(slice: &[u8]) -> Self { + Self::from_byte_array(slice.try_into().unwrap()) + } + #[doc(hidden)] pub fn __dummy() -> Self { Self::ZERO diff --git a/crates/standalone/src/control_db.rs b/crates/standalone/src/control_db.rs index 30e36ad8d22..db44c730d7a 100644 --- a/crates/standalone/src/control_db.rs +++ b/crates/standalone/src/control_db.rs @@ -13,7 +13,7 @@ mod tests; /// A control database when SpacetimeDB is running standalone. /// /// Important note: The `Addresses` and `Identities` stored in this database -/// are stored as *little-endian* byte arrays. This means that printing such an array +/// are stored as *LITTLE-ENDIAN* byte arrays. This means that printing such an array /// in hexadecimal will result in the REVERSE of the standard way to print `Addresses` and `Identities`. #[derive(Clone)] pub struct ControlDb { @@ -145,7 +145,7 @@ impl ControlDb { let identity_bytes = database_identity.to_byte_array(); let tree = self.db.open_tree("dns")?; - tree.insert(domain.to_lowercase().as_bytes(), &identity_bytes)?; + tree.insert(domain.to_lowercase(), &identity_bytes)?; let tree = self.db.open_tree("reverse_dns")?; match tree.get(identity_bytes)? { @@ -225,8 +225,8 @@ impl ControlDb { pub fn get_database_by_identity(&self, identity: &Identity) -> Result> { let tree = self.db.open_tree("database_by_identity")?; - let key = identity.to_hex(); - let value = tree.get(key.as_bytes())?; + let key = identity.to_be_byte_array(); + let value = tree.get(&key[..])?; if let Some(value) = value { let database = compat::Database::from_slice(&value[..]).unwrap().into(); return Ok(Some(database)); @@ -238,7 +238,7 @@ impl ControlDb { let id = self.db.generate_id()?; let tree = self.db.open_tree("database_by_identity")?; - let key = database.database_identity.to_hex(); + let key = database.database_identity.to_be_byte_array(); if tree.contains_key(key)? { return Err(Error::DatabaseAlreadyExists(database.database_identity)); } @@ -261,9 +261,9 @@ impl ControlDb { if let Some(old_value) = tree.get(id.to_be_bytes())? { let database = compat::Database::from_slice(&old_value[..])?; - let key = database.database_identity().to_hex(); + let key = database.database_identity().to_be_byte_array(); - tree_by_identity.remove(key.as_bytes())?; + tree_by_identity.remove(&key[..])?; tree.remove(id.to_be_bytes())?; return Ok(Some(id)); } From b9881d1593688328ba5ec1bc05bc4239b1386362 Mon Sep 17 00:00:00 2001 From: James Gilles Date: Tue, 5 Nov 2024 13:33:40 -0500 Subject: [PATCH 12/12] Bump commit --- crates/lib/src/address.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/lib/src/address.rs b/crates/lib/src/address.rs index 19778a47432..4eaec6e5401 100644 --- a/crates/lib/src/address.rs +++ b/crates/lib/src/address.rs @@ -86,6 +86,7 @@ impl Address { /// /// This method is the correct choice if you have converted the bytes of a hexadecimal-formatted `Address` /// to a byte array in the following way: + /// /// ```ignore /// "0xb0b1b2..." /// ->