This commit is contained in:
Tao Tien 2026-02-22 00:39:51 -08:00
parent d7b4221727
commit 222459f828
31 changed files with 870 additions and 135 deletions

View file

@ -142,3 +142,19 @@ impl<'ctx> BotIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Bot`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait botQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Bot`.
fn bot(&self) -> __sdk::__query_builder::Table<Bot>;
}
impl botQueryTableAccess for __sdk::QueryTableAccessor {
fn bot(&self) -> __sdk::__query_builder::Table<Bot> {
__sdk::__query_builder::Table::new("bot")
}
}

View file

@ -21,3 +21,47 @@ pub struct Bot {
impl __sdk::InModule for Bot {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `Bot`.
///
/// Provides typed access to columns for query building.
pub struct BotCols {
pub id: __sdk::__query_builder::Col<Bot, u32>,
pub lobby_id: __sdk::__query_builder::Col<Bot, u32>,
pub turn_state: __sdk::__query_builder::Col<Bot, TurnState>,
pub hand: __sdk::__query_builder::Col<Bot, Vec<DbTile>>,
pub pond: __sdk::__query_builder::Col<Bot, Vec<DbTile>>,
pub working_tile: __sdk::__query_builder::Col<Bot, Option<DbTile>>,
}
impl __sdk::__query_builder::HasCols for Bot {
type Cols = BotCols;
fn cols(table_name: &'static str) -> Self::Cols {
BotCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
lobby_id: __sdk::__query_builder::Col::new(table_name, "lobby_id"),
turn_state: __sdk::__query_builder::Col::new(table_name, "turn_state"),
hand: __sdk::__query_builder::Col::new(table_name, "hand"),
pond: __sdk::__query_builder::Col::new(table_name, "pond"),
working_tile: __sdk::__query_builder::Col::new(table_name, "working_tile"),
}
}
}
/// Indexed column accessor struct for the table `Bot`.
///
/// Provides typed access to indexed columns for query building.
pub struct BotIxCols {
pub id: __sdk::__query_builder::IxCol<Bot, u32>,
pub lobby_id: __sdk::__query_builder::IxCol<Bot, u32>,
}
impl __sdk::__query_builder::HasIxCols for Bot {
type IxCols = BotIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
BotIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
lobby_id: __sdk::__query_builder::IxCol::new(table_name, "lobby_id"),
}
}
}

View file

@ -16,3 +16,37 @@ pub struct DbTile {
impl __sdk::InModule for DbTile {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `DbTile`.
///
/// Provides typed access to columns for query building.
pub struct DbTileCols {
pub id: __sdk::__query_builder::Col<DbTile, u32>,
pub tile: __sdk::__query_builder::Col<DbTile, Tile>,
}
impl __sdk::__query_builder::HasCols for DbTile {
type Cols = DbTileCols;
fn cols(table_name: &'static str) -> Self::Cols {
DbTileCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
tile: __sdk::__query_builder::Col::new(table_name, "tile"),
}
}
}
/// Indexed column accessor struct for the table `DbTile`.
///
/// Provides typed access to indexed columns for query building.
pub struct DbTileIxCols {
pub id: __sdk::__query_builder::IxCol<DbTile, u32>,
}
impl __sdk::__query_builder::HasIxCols for DbTile {
type IxCols = DbTileIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
DbTileIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
}
}
}

View file

@ -16,3 +16,37 @@ pub struct DbWall {
impl __sdk::InModule for DbWall {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `DbWall`.
///
/// Provides typed access to columns for query building.
pub struct DbWallCols {
pub lobby_id: __sdk::__query_builder::Col<DbWall, u32>,
pub tiles: __sdk::__query_builder::Col<DbWall, Vec<DbTile>>,
}
impl __sdk::__query_builder::HasCols for DbWall {
type Cols = DbWallCols;
fn cols(table_name: &'static str) -> Self::Cols {
DbWallCols {
lobby_id: __sdk::__query_builder::Col::new(table_name, "lobby_id"),
tiles: __sdk::__query_builder::Col::new(table_name, "tiles"),
}
}
}
/// Indexed column accessor struct for the table `DbWall`.
///
/// Provides typed access to indexed columns for query building.
pub struct DbWallIxCols {
pub lobby_id: __sdk::__query_builder::IxCol<DbWall, u32>,
}
impl __sdk::__query_builder::HasIxCols for DbWall {
type IxCols = DbWallIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
DbWallIxCols {
lobby_id: __sdk::__query_builder::IxCol::new(table_name, "lobby_id"),
}
}
}

View file

@ -171,3 +171,19 @@ impl<'ctx> GameTimerLobbyIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `GameTimer`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait game_timerQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `GameTimer`.
fn game_timer(&self) -> __sdk::__query_builder::Table<GameTimer>;
}
impl game_timerQueryTableAccess for __sdk::QueryTableAccessor {
fn game_timer(&self) -> __sdk::__query_builder::Table<GameTimer> {
__sdk::__query_builder::Table::new("game_timer")
}
}

View file

@ -15,3 +15,41 @@ pub struct GameTimer {
impl __sdk::InModule for GameTimer {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `GameTimer`.
///
/// Provides typed access to columns for query building.
pub struct GameTimerCols {
pub id: __sdk::__query_builder::Col<GameTimer, u64>,
pub lobby_id: __sdk::__query_builder::Col<GameTimer, u32>,
pub scheduled_at: __sdk::__query_builder::Col<GameTimer, __sdk::ScheduleAt>,
}
impl __sdk::__query_builder::HasCols for GameTimer {
type Cols = GameTimerCols;
fn cols(table_name: &'static str) -> Self::Cols {
GameTimerCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
lobby_id: __sdk::__query_builder::Col::new(table_name, "lobby_id"),
scheduled_at: __sdk::__query_builder::Col::new(table_name, "scheduled_at"),
}
}
}
/// Indexed column accessor struct for the table `GameTimer`.
///
/// Provides typed access to indexed columns for query building.
pub struct GameTimerIxCols {
pub id: __sdk::__query_builder::IxCol<GameTimer, u64>,
pub lobby_id: __sdk::__query_builder::IxCol<GameTimer, u32>,
}
impl __sdk::__query_builder::HasIxCols for GameTimer {
type IxCols = GameTimerIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
GameTimerIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
lobby_id: __sdk::__query_builder::IxCol::new(table_name, "lobby_id"),
}
}
}

View file

@ -142,3 +142,19 @@ impl<'ctx> LobbyIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Lobby`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait lobbyQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Lobby`.
fn lobby(&self) -> __sdk::__query_builder::Table<Lobby>;
}
impl lobbyQueryTableAccess for __sdk::QueryTableAccessor {
fn lobby(&self) -> __sdk::__query_builder::Table<Lobby> {
__sdk::__query_builder::Table::new("lobby")
}
}

View file

@ -20,3 +20,43 @@ pub struct Lobby {
impl __sdk::InModule for Lobby {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `Lobby`.
///
/// Provides typed access to columns for query building.
pub struct LobbyCols {
pub id: __sdk::__query_builder::Col<Lobby, u32>,
pub players: __sdk::__query_builder::Col<Lobby, Vec<PlayerOrBot>>,
pub dealer_idx: __sdk::__query_builder::Col<Lobby, u8>,
pub current_idx: __sdk::__query_builder::Col<Lobby, u8>,
pub game_state: __sdk::__query_builder::Col<Lobby, GameState>,
}
impl __sdk::__query_builder::HasCols for Lobby {
type Cols = LobbyCols;
fn cols(table_name: &'static str) -> Self::Cols {
LobbyCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
players: __sdk::__query_builder::Col::new(table_name, "players"),
dealer_idx: __sdk::__query_builder::Col::new(table_name, "dealer_idx"),
current_idx: __sdk::__query_builder::Col::new(table_name, "current_idx"),
game_state: __sdk::__query_builder::Col::new(table_name, "game_state"),
}
}
}
/// Indexed column accessor struct for the table `Lobby`.
///
/// Provides typed access to indexed columns for query building.
pub struct LobbyIxCols {
pub id: __sdk::__query_builder::IxCol<Lobby, u32>,
}
impl __sdk::__query_builder::HasIxCols for Lobby {
type IxCols = LobbyIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
LobbyIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
}
}
}

View file

@ -173,3 +173,19 @@ impl<'ctx> LoggedOutPlayerIdentityUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Player`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait logged_out_playerQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Player`.
fn logged_out_player(&self) -> __sdk::__query_builder::Table<Player>;
}
impl logged_out_playerQueryTableAccess for __sdk::QueryTableAccessor {
fn logged_out_player(&self) -> __sdk::__query_builder::Table<Player> {
__sdk::__query_builder::Table::new("logged_out_player")
}
}

View file

@ -1,7 +1,7 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
// This was generated using spacetimedb cli version 1.11.3 (commit 02449737ca3b29e7e39679fccbef541a50f32094).
// This was generated using spacetimedb cli version 1.12.0 (commit 4fdb8d923f39ed592931ad4c7e6391ed99b9fe3a).
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
@ -37,6 +37,7 @@ pub mod suit_type;
pub mod tile_table;
pub mod tile_type;
pub mod turn_state_type;
pub mod view_hand_table;
pub mod wall_table;
pub mod wind_type;
@ -73,6 +74,7 @@ pub use suit_type::Suit;
pub use tile_table::*;
pub use tile_type::Tile;
pub use turn_state_type::TurnState;
pub use view_hand_table::*;
pub use wall_table::*;
pub use wind_type::Wind;
@ -188,6 +190,7 @@ pub struct DbUpdate {
player_clock: __sdk::TableUpdate<PlayerClock>,
player_hand: __sdk::TableUpdate<PlayerHand>,
tile: __sdk::TableUpdate<DbTile>,
view_hand: __sdk::TableUpdate<PlayerHand>,
wall: __sdk::TableUpdate<DbWall>,
}
@ -221,6 +224,9 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate {
"tile" => db_update
.tile
.append(tile_table::parse_table_update(table_update)?),
"view_hand" => db_update
.view_hand
.append(view_hand_table::parse_table_update(table_update)?),
"wall" => db_update
.wall
.append(wall_table::parse_table_update(table_update)?),
@ -277,6 +283,7 @@ impl __sdk::DbUpdate for DbUpdate {
diff.wall = cache
.apply_diff_to_table::<DbWall>("wall", &self.wall)
.with_updates_by_pk(|row| &row.lobby_id);
diff.view_hand = cache.apply_diff_to_table::<PlayerHand>("view_hand", &self.view_hand);
diff
}
@ -294,6 +301,7 @@ pub struct AppliedDiff<'r> {
player_clock: __sdk::TableAppliedDiff<'r, PlayerClock>,
player_hand: __sdk::TableAppliedDiff<'r, PlayerHand>,
tile: __sdk::TableAppliedDiff<'r, DbTile>,
view_hand: __sdk::TableAppliedDiff<'r, PlayerHand>,
wall: __sdk::TableAppliedDiff<'r, DbWall>,
__unused: std::marker::PhantomData<&'r ()>,
}
@ -324,6 +332,7 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
);
callbacks.invoke_table_row_callbacks::<PlayerHand>("player_hand", &self.player_hand, event);
callbacks.invoke_table_row_callbacks::<DbTile>("tile", &self.tile, event);
callbacks.invoke_table_row_callbacks::<PlayerHand>("view_hand", &self.view_hand, event);
callbacks.invoke_table_row_callbacks::<DbWall>("wall", &self.wall, event);
}
}
@ -1042,6 +1051,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
type DbUpdate = DbUpdate;
type AppliedDiff<'r> = AppliedDiff<'r>;
type SubscriptionHandle = SubscriptionHandle;
type QueryBuilder = __sdk::QueryBuilder;
fn register_tables(client_cache: &mut __sdk::ClientCache<Self>) {
bot_table::register_table(client_cache);
@ -1052,6 +1062,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
player_clock_table::register_table(client_cache);
player_hand_table::register_table(client_cache);
tile_table::register_table(client_cache);
view_hand_table::register_table(client_cache);
wall_table::register_table(client_cache);
}
}

View file

@ -171,3 +171,19 @@ impl<'ctx> PlayerClockPlayerIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PlayerClock`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait player_clockQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PlayerClock`.
fn player_clock(&self) -> __sdk::__query_builder::Table<PlayerClock>;
}
impl player_clockQueryTableAccess for __sdk::QueryTableAccessor {
fn player_clock(&self) -> __sdk::__query_builder::Table<PlayerClock> {
__sdk::__query_builder::Table::new("player_clock")
}
}

View file

@ -16,3 +16,43 @@ pub struct PlayerClock {
impl __sdk::InModule for PlayerClock {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `PlayerClock`.
///
/// Provides typed access to columns for query building.
pub struct PlayerClockCols {
pub id: __sdk::__query_builder::Col<PlayerClock, u32>,
pub player_id: __sdk::__query_builder::Col<PlayerClock, u32>,
pub renewable: __sdk::__query_builder::Col<PlayerClock, u16>,
pub total: __sdk::__query_builder::Col<PlayerClock, u16>,
}
impl __sdk::__query_builder::HasCols for PlayerClock {
type Cols = PlayerClockCols;
fn cols(table_name: &'static str) -> Self::Cols {
PlayerClockCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
player_id: __sdk::__query_builder::Col::new(table_name, "player_id"),
renewable: __sdk::__query_builder::Col::new(table_name, "renewable"),
total: __sdk::__query_builder::Col::new(table_name, "total"),
}
}
}
/// Indexed column accessor struct for the table `PlayerClock`.
///
/// Provides typed access to indexed columns for query building.
pub struct PlayerClockIxCols {
pub id: __sdk::__query_builder::IxCol<PlayerClock, u32>,
pub player_id: __sdk::__query_builder::IxCol<PlayerClock, u32>,
}
impl __sdk::__query_builder::HasIxCols for PlayerClock {
type IxCols = PlayerClockIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
PlayerClockIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
player_id: __sdk::__query_builder::IxCol::new(table_name, "player_id"),
}
}
}

View file

@ -173,3 +173,19 @@ impl<'ctx> PlayerHandPlayerIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PlayerHand`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait player_handQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PlayerHand`.
fn player_hand(&self) -> __sdk::__query_builder::Table<PlayerHand>;
}
impl player_handQueryTableAccess for __sdk::QueryTableAccessor {
fn player_hand(&self) -> __sdk::__query_builder::Table<PlayerHand> {
__sdk::__query_builder::Table::new("player_hand")
}
}

View file

@ -21,3 +21,47 @@ pub struct PlayerHand {
impl __sdk::InModule for PlayerHand {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `PlayerHand`.
///
/// Provides typed access to columns for query building.
pub struct PlayerHandCols {
pub id: __sdk::__query_builder::Col<PlayerHand, u32>,
pub player_id: __sdk::__query_builder::Col<PlayerHand, u32>,
pub turn_state: __sdk::__query_builder::Col<PlayerHand, TurnState>,
pub pond: __sdk::__query_builder::Col<PlayerHand, Vec<DbTile>>,
pub hand: __sdk::__query_builder::Col<PlayerHand, Vec<DbTile>>,
pub working_tile: __sdk::__query_builder::Col<PlayerHand, Option<DbTile>>,
}
impl __sdk::__query_builder::HasCols for PlayerHand {
type Cols = PlayerHandCols;
fn cols(table_name: &'static str) -> Self::Cols {
PlayerHandCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
player_id: __sdk::__query_builder::Col::new(table_name, "player_id"),
turn_state: __sdk::__query_builder::Col::new(table_name, "turn_state"),
pond: __sdk::__query_builder::Col::new(table_name, "pond"),
hand: __sdk::__query_builder::Col::new(table_name, "hand"),
working_tile: __sdk::__query_builder::Col::new(table_name, "working_tile"),
}
}
}
/// Indexed column accessor struct for the table `PlayerHand`.
///
/// Provides typed access to indexed columns for query building.
pub struct PlayerHandIxCols {
pub id: __sdk::__query_builder::IxCol<PlayerHand, u32>,
pub player_id: __sdk::__query_builder::IxCol<PlayerHand, u32>,
}
impl __sdk::__query_builder::HasIxCols for PlayerHand {
type IxCols = PlayerHandIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
PlayerHandIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
player_id: __sdk::__query_builder::IxCol::new(table_name, "player_id"),
}
}
}

View file

@ -173,3 +173,19 @@ impl<'ctx> PlayerIdentityUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Player`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait playerQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Player`.
fn player(&self) -> __sdk::__query_builder::Table<Player>;
}
impl playerQueryTableAccess for __sdk::QueryTableAccessor {
fn player(&self) -> __sdk::__query_builder::Table<Player> {
__sdk::__query_builder::Table::new("player")
}
}

View file

@ -18,3 +18,49 @@ pub struct Player {
impl __sdk::InModule for Player {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `Player`.
///
/// Provides typed access to columns for query building.
pub struct PlayerCols {
pub id: __sdk::__query_builder::Col<Player, u32>,
pub identity: __sdk::__query_builder::Col<Player, __sdk::Identity>,
pub name: __sdk::__query_builder::Col<Player, Option<String>>,
pub lobby_id: __sdk::__query_builder::Col<Player, u32>,
pub ready: __sdk::__query_builder::Col<Player, bool>,
pub sort: __sdk::__query_builder::Col<Player, bool>,
}
impl __sdk::__query_builder::HasCols for Player {
type Cols = PlayerCols;
fn cols(table_name: &'static str) -> Self::Cols {
PlayerCols {
id: __sdk::__query_builder::Col::new(table_name, "id"),
identity: __sdk::__query_builder::Col::new(table_name, "identity"),
name: __sdk::__query_builder::Col::new(table_name, "name"),
lobby_id: __sdk::__query_builder::Col::new(table_name, "lobby_id"),
ready: __sdk::__query_builder::Col::new(table_name, "ready"),
sort: __sdk::__query_builder::Col::new(table_name, "sort"),
}
}
}
/// Indexed column accessor struct for the table `Player`.
///
/// Provides typed access to indexed columns for query building.
pub struct PlayerIxCols {
pub id: __sdk::__query_builder::IxCol<Player, u32>,
pub identity: __sdk::__query_builder::IxCol<Player, __sdk::Identity>,
pub lobby_id: __sdk::__query_builder::IxCol<Player, u32>,
}
impl __sdk::__query_builder::HasIxCols for Player {
type IxCols = PlayerIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
PlayerIxCols {
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
identity: __sdk::__query_builder::IxCol::new(table_name, "identity"),
lobby_id: __sdk::__query_builder::IxCol::new(table_name, "lobby_id"),
}
}
}

View file

@ -141,3 +141,19 @@ impl<'ctx> TileIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `DbTile`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait tileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `DbTile`.
fn tile(&self) -> __sdk::__query_builder::Table<DbTile>;
}
impl tileQueryTableAccess for __sdk::QueryTableAccessor {
fn tile(&self) -> __sdk::__query_builder::Table<DbTile> {
__sdk::__query_builder::Table::new("tile")
}
}

View file

@ -0,0 +1,113 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::db_tile_type::DbTile;
use super::player_hand_type::PlayerHand;
use super::turn_state_type::TurnState;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `view_hand`.
///
/// Obtain a handle from the [`ViewHandTableAccess::view_hand`] method on [`super::RemoteTables`],
/// like `ctx.db.view_hand()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.view_hand().on_insert(...)`.
pub struct ViewHandTableHandle<'ctx> {
imp: __sdk::TableHandle<PlayerHand>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `view_hand`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ViewHandTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ViewHandTableHandle`], which mediates access to the table `view_hand`.
fn view_hand(&self) -> ViewHandTableHandle<'_>;
}
impl ViewHandTableAccess for super::RemoteTables {
fn view_hand(&self) -> ViewHandTableHandle<'_> {
ViewHandTableHandle {
imp: self.imp.get_table::<PlayerHand>("view_hand"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ViewHandInsertCallbackId(__sdk::CallbackId);
pub struct ViewHandDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ViewHandTableHandle<'ctx> {
type Row = PlayerHand;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PlayerHand> + '_ {
self.imp.iter()
}
type InsertCallbackId = ViewHandInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ViewHandInsertCallbackId {
ViewHandInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ViewHandInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ViewHandDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ViewHandDeleteCallbackId {
ViewHandDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ViewHandDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PlayerHand>("view_hand");
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::TableUpdate<__ws::BsatnFormat>,
) -> __sdk::Result<__sdk::TableUpdate<PlayerHand>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PlayerHand>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PlayerHand`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait view_handQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PlayerHand`.
fn view_hand(&self) -> __sdk::__query_builder::Table<PlayerHand>;
}
impl view_handQueryTableAccess for __sdk::QueryTableAccessor {
fn view_hand(&self) -> __sdk::__query_builder::Table<PlayerHand> {
__sdk::__query_builder::Table::new("view_hand")
}
}

View file

@ -141,3 +141,19 @@ impl<'ctx> WallLobbyIdUnique<'ctx> {
self.imp.find(col_val)
}
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `DbWall`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wallQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `DbWall`.
fn wall(&self) -> __sdk::__query_builder::Table<DbWall>;
}
impl wallQueryTableAccess for __sdk::QueryTableAccessor {
fn wall(&self) -> __sdk::__query_builder::Table<DbWall> {
__sdk::__query_builder::Table::new("wall")
}
}

View file

@ -1,4 +1,6 @@
pub mod db;
pub use conversions::*;
pub use db::*;
mod conversions {