// 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::person_type::Person; use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `person`. /// /// Obtain a handle from the [`PersonTableAccess::person`] method on [`super::RemoteTables`], /// like `ctx.db.person()`. /// /// Users are encouraged not to explicitly reference this type, /// but to directly chain method calls, /// like `ctx.db.person().on_insert(...)`. pub struct PersonTableHandle<'ctx> { imp: __sdk::TableHandle, ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } #[allow(non_camel_case_types)] /// Extension trait for access to the table `person`. /// /// Implemented for [`super::RemoteTables`]. pub trait PersonTableAccess { #[allow(non_snake_case)] /// Obtain a [`PersonTableHandle`], which mediates access to the table `person`. fn person(&self) -> PersonTableHandle<'_>; } impl PersonTableAccess for super::RemoteTables { fn person(&self) -> PersonTableHandle<'_> { PersonTableHandle { imp: self.imp.get_table::("person"), ctx: std::marker::PhantomData, } } } pub struct PersonInsertCallbackId(__sdk::CallbackId); pub struct PersonDeleteCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::Table for PersonTableHandle<'ctx> { type Row = Person; type EventContext = super::EventContext; fn count(&self) -> u64 { self.imp.count() } fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = PersonInsertCallbackId; fn on_insert( &self, callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, ) -> PersonInsertCallbackId { PersonInsertCallbackId(self.imp.on_insert(Box::new(callback))) } fn remove_on_insert(&self, callback: PersonInsertCallbackId) { self.imp.remove_on_insert(callback.0) } type DeleteCallbackId = PersonDeleteCallbackId; fn on_delete( &self, callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, ) -> PersonDeleteCallbackId { PersonDeleteCallbackId(self.imp.on_delete(Box::new(callback))) } fn remove_on_delete(&self, callback: PersonDeleteCallbackId) { self.imp.remove_on_delete(callback.0) } } #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("person"); } #[doc(hidden)] pub(super) fn parse_table_update( raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") .with_cause(e) .into() }) }