omega restructuring + a bunch of changes i have made over the last weeks
This commit is contained in:
1
marts/generated/src/lib.rs
Normal file
1
marts/generated/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod spacetime;
|
||||
60
marts/generated/src/spacetime/action_type.rs
Normal file
60
marts/generated/src/spacetime/action_type.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct Action {
|
||||
pub name: String,
|
||||
pub activity: Option<u64>,
|
||||
pub task: Option<u64>,
|
||||
pub start: Option<__sdk::Timestamp>,
|
||||
pub end: Option<__sdk::Timestamp>,
|
||||
pub duration: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Action {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `Action`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct ActionCols {
|
||||
pub name: __sdk::__query_builder::Col<Action, String>,
|
||||
pub activity: __sdk::__query_builder::Col<Action, Option<u64>>,
|
||||
pub task: __sdk::__query_builder::Col<Action, Option<u64>>,
|
||||
pub start: __sdk::__query_builder::Col<Action, Option<__sdk::Timestamp>>,
|
||||
pub end: __sdk::__query_builder::Col<Action, Option<__sdk::Timestamp>>,
|
||||
pub duration: __sdk::__query_builder::Col<Action, Option<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for Action {
|
||||
type Cols = ActionCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
ActionCols {
|
||||
name: __sdk::__query_builder::Col::new(table_name, "name"),
|
||||
activity: __sdk::__query_builder::Col::new(table_name, "activity"),
|
||||
task: __sdk::__query_builder::Col::new(table_name, "task"),
|
||||
start: __sdk::__query_builder::Col::new(table_name, "start"),
|
||||
end: __sdk::__query_builder::Col::new(table_name, "end"),
|
||||
duration: __sdk::__query_builder::Col::new(table_name, "duration"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `Action`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct ActionIxCols {}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for Action {
|
||||
type IxCols = ActionIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
ActionIxCols {}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for Action {}
|
||||
159
marts/generated/src/spacetime/activities_table.rs
Normal file
159
marts/generated/src/spacetime/activities_table.rs
Normal file
@@ -0,0 +1,159 @@
|
||||
// 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::activity_type::Activity;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `activities`.
|
||||
///
|
||||
/// Obtain a handle from the [`ActivitiesTableAccess::activities`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.activities()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.activities().on_insert(...)`.
|
||||
pub struct ActivitiesTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<Activity>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `activities`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait ActivitiesTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`ActivitiesTableHandle`], which mediates access to the table `activities`.
|
||||
fn activities(&self) -> ActivitiesTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl ActivitiesTableAccess for super::RemoteTables {
|
||||
fn activities(&self) -> ActivitiesTableHandle<'_> {
|
||||
ActivitiesTableHandle {
|
||||
imp: self.imp.get_table::<Activity>("activities"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ActivitiesInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct ActivitiesDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for ActivitiesTableHandle<'ctx> {
|
||||
type Row = Activity;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = Activity> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = ActivitiesInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ActivitiesInsertCallbackId {
|
||||
ActivitiesInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ActivitiesInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = ActivitiesDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ActivitiesDeleteCallbackId {
|
||||
ActivitiesDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ActivitiesDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ActivitiesUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for ActivitiesTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ActivitiesUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ActivitiesUpdateCallbackId {
|
||||
ActivitiesUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ActivitiesUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `id` unique index on the table `activities`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ActivitiesIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.activities().id().find(...)`.
|
||||
pub struct ActivitiesIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<Activity, u64>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ActivitiesTableHandle<'ctx> {
|
||||
/// Get a handle on the `id` unique index on the table `activities`.
|
||||
pub fn id(&self) -> ActivitiesIdUnique<'ctx> {
|
||||
ActivitiesIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<u64>("id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ActivitiesIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &u64) -> Option<Activity> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<Activity>("activities");
|
||||
_table.add_unique_constraint::<u64>("id", |row| &row.id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<Activity>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<Activity>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `Activity`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait activitiesQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `Activity`.
|
||||
fn activities(&self) -> __sdk::__query_builder::Table<Activity>;
|
||||
}
|
||||
|
||||
impl activitiesQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn activities(&self) -> __sdk::__query_builder::Table<Activity> {
|
||||
__sdk::__query_builder::Table::new("activities")
|
||||
}
|
||||
}
|
||||
58
marts/generated/src/spacetime/activity_type.rs
Normal file
58
marts/generated/src/spacetime/activity_type.rs
Normal file
@@ -0,0 +1,58 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct Activity {
|
||||
pub id: u64,
|
||||
pub name: String,
|
||||
pub task: Option<u64>,
|
||||
pub parents_ids: Vec<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Activity {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `Activity`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct ActivityCols {
|
||||
pub id: __sdk::__query_builder::Col<Activity, u64>,
|
||||
pub name: __sdk::__query_builder::Col<Activity, String>,
|
||||
pub task: __sdk::__query_builder::Col<Activity, Option<u64>>,
|
||||
pub parents_ids: __sdk::__query_builder::Col<Activity, Vec<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for Activity {
|
||||
type Cols = ActivityCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
ActivityCols {
|
||||
id: __sdk::__query_builder::Col::new(table_name, "id"),
|
||||
name: __sdk::__query_builder::Col::new(table_name, "name"),
|
||||
task: __sdk::__query_builder::Col::new(table_name, "task"),
|
||||
parents_ids: __sdk::__query_builder::Col::new(table_name, "parents_ids"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `Activity`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct ActivityIxCols {
|
||||
pub id: __sdk::__query_builder::IxCol<Activity, u64>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for Activity {
|
||||
type IxCols = ActivityIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
ActivityIxCols {
|
||||
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for Activity {}
|
||||
66
marts/generated/src/spacetime/add_activity_reducer.rs
Normal file
66
marts/generated/src/spacetime/add_activity_reducer.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct AddActivityArgs {
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
impl From<AddActivityArgs> for super::Reducer {
|
||||
fn from(args: AddActivityArgs) -> Self {
|
||||
Self::AddActivity { name: args.name }
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AddActivityArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `add_activity`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait add_activity {
|
||||
/// Request that the remote module invoke the reducer `add_activity` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`add_activity:add_activity_then`] to run a callback after the reducer completes.
|
||||
fn add_activity(&self, name: String) -> __sdk::Result<()> {
|
||||
self.add_activity_then(name, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `add_activity` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn add_activity_then(
|
||||
&self,
|
||||
name: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl add_activity for super::RemoteReducers {
|
||||
fn add_activity_then(
|
||||
&self,
|
||||
name: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(AddActivityArgs { name }, callback)
|
||||
}
|
||||
}
|
||||
68
marts/generated/src/spacetime/add_thought_reducer.rs
Normal file
68
marts/generated/src/spacetime/add_thought_reducer.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct AddThoughtArgs {
|
||||
pub thought: String,
|
||||
}
|
||||
|
||||
impl From<AddThoughtArgs> for super::Reducer {
|
||||
fn from(args: AddThoughtArgs) -> Self {
|
||||
Self::AddThought {
|
||||
thought: args.thought,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AddThoughtArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `add_thought`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait add_thought {
|
||||
/// Request that the remote module invoke the reducer `add_thought` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`add_thought:add_thought_then`] to run a callback after the reducer completes.
|
||||
fn add_thought(&self, thought: String) -> __sdk::Result<()> {
|
||||
self.add_thought_then(thought, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `add_thought` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn add_thought_then(
|
||||
&self,
|
||||
thought: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl add_thought for super::RemoteReducers {
|
||||
fn add_thought_then(
|
||||
&self,
|
||||
thought: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(AddThoughtArgs { thought }, callback)
|
||||
}
|
||||
}
|
||||
111
marts/generated/src/spacetime/daily_task_log_table.rs
Normal file
111
marts/generated/src/spacetime/daily_task_log_table.rs
Normal file
@@ -0,0 +1,111 @@
|
||||
// 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::daily_task_log_type::DailyTaskLog;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `daily_task_log`.
|
||||
///
|
||||
/// Obtain a handle from the [`DailyTaskLogTableAccess::daily_task_log`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.daily_task_log()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.daily_task_log().on_insert(...)`.
|
||||
pub struct DailyTaskLogTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<DailyTaskLog>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `daily_task_log`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait DailyTaskLogTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`DailyTaskLogTableHandle`], which mediates access to the table `daily_task_log`.
|
||||
fn daily_task_log(&self) -> DailyTaskLogTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl DailyTaskLogTableAccess for super::RemoteTables {
|
||||
fn daily_task_log(&self) -> DailyTaskLogTableHandle<'_> {
|
||||
DailyTaskLogTableHandle {
|
||||
imp: self.imp.get_table::<DailyTaskLog>("daily_task_log"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DailyTaskLogInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct DailyTaskLogDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for DailyTaskLogTableHandle<'ctx> {
|
||||
type Row = DailyTaskLog;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = DailyTaskLog> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = DailyTaskLogInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> DailyTaskLogInsertCallbackId {
|
||||
DailyTaskLogInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: DailyTaskLogInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = DailyTaskLogDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> DailyTaskLogDeleteCallbackId {
|
||||
DailyTaskLogDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: DailyTaskLogDeleteCallbackId) {
|
||||
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::<DailyTaskLog>("daily_task_log");
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<DailyTaskLog>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<DailyTaskLog>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `DailyTaskLog`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait daily_task_logQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `DailyTaskLog`.
|
||||
fn daily_task_log(&self) -> __sdk::__query_builder::Table<DailyTaskLog>;
|
||||
}
|
||||
|
||||
impl daily_task_logQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn daily_task_log(&self) -> __sdk::__query_builder::Table<DailyTaskLog> {
|
||||
__sdk::__query_builder::Table::new("daily_task_log")
|
||||
}
|
||||
}
|
||||
48
marts/generated/src/spacetime/daily_task_log_type.rs
Normal file
48
marts/generated/src/spacetime/daily_task_log_type.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct DailyTaskLog {
|
||||
pub daily_task_id: i64,
|
||||
pub done: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for DailyTaskLog {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `DailyTaskLog`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct DailyTaskLogCols {
|
||||
pub daily_task_id: __sdk::__query_builder::Col<DailyTaskLog, i64>,
|
||||
pub done: __sdk::__query_builder::Col<DailyTaskLog, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for DailyTaskLog {
|
||||
type Cols = DailyTaskLogCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
DailyTaskLogCols {
|
||||
daily_task_id: __sdk::__query_builder::Col::new(table_name, "daily_task_id"),
|
||||
done: __sdk::__query_builder::Col::new(table_name, "done"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `DailyTaskLog`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct DailyTaskLogIxCols {}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for DailyTaskLog {
|
||||
type IxCols = DailyTaskLogIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
DailyTaskLogIxCols {}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for DailyTaskLog {}
|
||||
111
marts/generated/src/spacetime/daily_task_table.rs
Normal file
111
marts/generated/src/spacetime/daily_task_table.rs
Normal file
@@ -0,0 +1,111 @@
|
||||
// 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::daily_task_type::DailyTask;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `daily_task`.
|
||||
///
|
||||
/// Obtain a handle from the [`DailyTaskTableAccess::daily_task`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.daily_task()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.daily_task().on_insert(...)`.
|
||||
pub struct DailyTaskTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<DailyTask>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `daily_task`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait DailyTaskTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`DailyTaskTableHandle`], which mediates access to the table `daily_task`.
|
||||
fn daily_task(&self) -> DailyTaskTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl DailyTaskTableAccess for super::RemoteTables {
|
||||
fn daily_task(&self) -> DailyTaskTableHandle<'_> {
|
||||
DailyTaskTableHandle {
|
||||
imp: self.imp.get_table::<DailyTask>("daily_task"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DailyTaskInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct DailyTaskDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for DailyTaskTableHandle<'ctx> {
|
||||
type Row = DailyTask;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = DailyTask> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = DailyTaskInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> DailyTaskInsertCallbackId {
|
||||
DailyTaskInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: DailyTaskInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = DailyTaskDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> DailyTaskDeleteCallbackId {
|
||||
DailyTaskDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: DailyTaskDeleteCallbackId) {
|
||||
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::<DailyTask>("daily_task");
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<DailyTask>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<DailyTask>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `DailyTask`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait daily_taskQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `DailyTask`.
|
||||
fn daily_task(&self) -> __sdk::__query_builder::Table<DailyTask>;
|
||||
}
|
||||
|
||||
impl daily_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn daily_task(&self) -> __sdk::__query_builder::Table<DailyTask> {
|
||||
__sdk::__query_builder::Table::new("daily_task")
|
||||
}
|
||||
}
|
||||
51
marts/generated/src/spacetime/daily_task_type.rs
Normal file
51
marts/generated/src/spacetime/daily_task_type.rs
Normal file
@@ -0,0 +1,51 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct DailyTask {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub owner: __sdk::Identity,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for DailyTask {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `DailyTask`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct DailyTaskCols {
|
||||
pub id: __sdk::__query_builder::Col<DailyTask, i64>,
|
||||
pub name: __sdk::__query_builder::Col<DailyTask, String>,
|
||||
pub owner: __sdk::__query_builder::Col<DailyTask, __sdk::Identity>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for DailyTask {
|
||||
type Cols = DailyTaskCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
DailyTaskCols {
|
||||
id: __sdk::__query_builder::Col::new(table_name, "id"),
|
||||
name: __sdk::__query_builder::Col::new(table_name, "name"),
|
||||
owner: __sdk::__query_builder::Col::new(table_name, "owner"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `DailyTask`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct DailyTaskIxCols {}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for DailyTask {
|
||||
type IxCols = DailyTaskIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
DailyTaskIxCols {}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for DailyTask {}
|
||||
59
marts/generated/src/spacetime/export_timetrack_procedure.rs
Normal file
59
marts/generated/src/spacetime/export_timetrack_procedure.rs
Normal file
@@ -0,0 +1,59 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ExportTimetrackArgs {
|
||||
pub username: String,
|
||||
pub date: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ExportTimetrackArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `export_timetrack`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait export_timetrack {
|
||||
fn export_timetrack(&self, username: String, date: String) {
|
||||
self.export_timetrack_then(username, date, |_, _| {});
|
||||
}
|
||||
|
||||
fn export_timetrack_then(
|
||||
&self,
|
||||
username: String,
|
||||
date: String,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<Result<String, String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl export_timetrack for super::RemoteProcedures {
|
||||
fn export_timetrack_then(
|
||||
&self,
|
||||
username: String,
|
||||
date: String,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<Result<String, String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, Result<String, String>>(
|
||||
"export_timetrack",
|
||||
ExportTimetrackArgs { username, date },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct FirstTimetrackDateArgs {
|
||||
pub username: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for FirstTimetrackDateArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `first_timetrack_date`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait first_timetrack_date {
|
||||
fn first_timetrack_date(&self, username: String) {
|
||||
self.first_timetrack_date_then(username, |_, _| {});
|
||||
}
|
||||
|
||||
fn first_timetrack_date_then(
|
||||
&self,
|
||||
username: String,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<Result<String, String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl first_timetrack_date for super::RemoteProcedures {
|
||||
fn first_timetrack_date_then(
|
||||
&self,
|
||||
username: String,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<Result<String, String>, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, Result<String, String>>(
|
||||
"first_timetrack_date",
|
||||
FirstTimetrackDateArgs { username },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
63
marts/generated/src/spacetime/log_event_type.rs
Normal file
63
marts/generated/src/spacetime/log_event_type.rs
Normal file
@@ -0,0 +1,63 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::action_type::Action;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct LogEvent {
|
||||
pub id: u64,
|
||||
pub start: __sdk::Timestamp,
|
||||
pub end: __sdk::Timestamp,
|
||||
pub action: Action,
|
||||
pub user: __sdk::Identity,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for LogEvent {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `LogEvent`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct LogEventCols {
|
||||
pub id: __sdk::__query_builder::Col<LogEvent, u64>,
|
||||
pub start: __sdk::__query_builder::Col<LogEvent, __sdk::Timestamp>,
|
||||
pub end: __sdk::__query_builder::Col<LogEvent, __sdk::Timestamp>,
|
||||
pub action: __sdk::__query_builder::Col<LogEvent, Action>,
|
||||
pub user: __sdk::__query_builder::Col<LogEvent, __sdk::Identity>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for LogEvent {
|
||||
type Cols = LogEventCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
LogEventCols {
|
||||
id: __sdk::__query_builder::Col::new(table_name, "id"),
|
||||
start: __sdk::__query_builder::Col::new(table_name, "start"),
|
||||
end: __sdk::__query_builder::Col::new(table_name, "end"),
|
||||
action: __sdk::__query_builder::Col::new(table_name, "action"),
|
||||
user: __sdk::__query_builder::Col::new(table_name, "user"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `LogEvent`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct LogEventIxCols {
|
||||
pub id: __sdk::__query_builder::IxCol<LogEvent, u64>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for LogEvent {
|
||||
type IxCols = LogEventIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
LogEventIxCols {
|
||||
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for LogEvent {}
|
||||
160
marts/generated/src/spacetime/log_events_table.rs
Normal file
160
marts/generated/src/spacetime/log_events_table.rs
Normal file
@@ -0,0 +1,160 @@
|
||||
// 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::action_type::Action;
|
||||
use super::log_event_type::LogEvent;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `log_events`.
|
||||
///
|
||||
/// Obtain a handle from the [`LogEventsTableAccess::log_events`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.log_events()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.log_events().on_insert(...)`.
|
||||
pub struct LogEventsTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<LogEvent>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `log_events`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait LogEventsTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`LogEventsTableHandle`], which mediates access to the table `log_events`.
|
||||
fn log_events(&self) -> LogEventsTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl LogEventsTableAccess for super::RemoteTables {
|
||||
fn log_events(&self) -> LogEventsTableHandle<'_> {
|
||||
LogEventsTableHandle {
|
||||
imp: self.imp.get_table::<LogEvent>("log_events"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct LogEventsInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct LogEventsDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for LogEventsTableHandle<'ctx> {
|
||||
type Row = LogEvent;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = LogEvent> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = LogEventsInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> LogEventsInsertCallbackId {
|
||||
LogEventsInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: LogEventsInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = LogEventsDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> LogEventsDeleteCallbackId {
|
||||
LogEventsDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: LogEventsDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct LogEventsUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for LogEventsTableHandle<'ctx> {
|
||||
type UpdateCallbackId = LogEventsUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> LogEventsUpdateCallbackId {
|
||||
LogEventsUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: LogEventsUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `id` unique index on the table `log_events`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`LogEventsIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.log_events().id().find(...)`.
|
||||
pub struct LogEventsIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<LogEvent, u64>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> LogEventsTableHandle<'ctx> {
|
||||
/// Get a handle on the `id` unique index on the table `log_events`.
|
||||
pub fn id(&self) -> LogEventsIdUnique<'ctx> {
|
||||
LogEventsIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<u64>("id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> LogEventsIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &u64) -> Option<LogEvent> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<LogEvent>("log_events");
|
||||
_table.add_unique_constraint::<u64>("id", |row| &row.id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<LogEvent>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<LogEvent>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `LogEvent`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait log_eventsQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `LogEvent`.
|
||||
fn log_events(&self) -> __sdk::__query_builder::Table<LogEvent>;
|
||||
}
|
||||
|
||||
impl log_eventsQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn log_events(&self) -> __sdk::__query_builder::Table<LogEvent> {
|
||||
__sdk::__query_builder::Table::new("log_events")
|
||||
}
|
||||
}
|
||||
44
marts/generated/src/spacetime/migrate_procedure.rs
Normal file
44
marts/generated/src/spacetime/migrate_procedure.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct MigrateArgs {}
|
||||
|
||||
impl __sdk::InModule for MigrateArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `migrate`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait migrate {
|
||||
fn migrate(&self) {
|
||||
self.migrate_then(|_, _| {});
|
||||
}
|
||||
|
||||
fn migrate_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<String, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl migrate for super::RemoteProcedures {
|
||||
fn migrate_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<String, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, String>("migrate", MigrateArgs {}, __callback);
|
||||
}
|
||||
}
|
||||
1046
marts/generated/src/spacetime/mod.rs
Normal file
1046
marts/generated/src/spacetime/mod.rs
Normal file
File diff suppressed because it is too large
Load Diff
74
marts/generated/src/spacetime/next_action_reducer.rs
Normal file
74
marts/generated/src/spacetime/next_action_reducer.rs
Normal file
@@ -0,0 +1,74 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::action_type::Action;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct NextActionArgs {
|
||||
pub break_flag: bool,
|
||||
pub action: Option<Action>,
|
||||
}
|
||||
|
||||
impl From<NextActionArgs> for super::Reducer {
|
||||
fn from(args: NextActionArgs) -> Self {
|
||||
Self::NextAction {
|
||||
break_flag: args.break_flag,
|
||||
action: args.action,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for NextActionArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `next_action`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait next_action {
|
||||
/// Request that the remote module invoke the reducer `next_action` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`next_action:next_action_then`] to run a callback after the reducer completes.
|
||||
fn next_action(&self, break_flag: bool, action: Option<Action>) -> __sdk::Result<()> {
|
||||
self.next_action_then(break_flag, action, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `next_action` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn next_action_then(
|
||||
&self,
|
||||
break_flag: bool,
|
||||
action: Option<Action>,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl next_action for super::RemoteReducers {
|
||||
fn next_action_then(
|
||||
&self,
|
||||
break_flag: bool,
|
||||
action: Option<Action>,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(NextActionArgs { break_flag, action }, callback)
|
||||
}
|
||||
}
|
||||
54
marts/generated/src/spacetime/profile_type.rs
Normal file
54
marts/generated/src/spacetime/profile_type.rs
Normal file
@@ -0,0 +1,54 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct Profile {
|
||||
pub identity: __sdk::Identity,
|
||||
pub username: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Profile {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `Profile`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct ProfileCols {
|
||||
pub identity: __sdk::__query_builder::Col<Profile, __sdk::Identity>,
|
||||
pub username: __sdk::__query_builder::Col<Profile, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for Profile {
|
||||
type Cols = ProfileCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
ProfileCols {
|
||||
identity: __sdk::__query_builder::Col::new(table_name, "identity"),
|
||||
username: __sdk::__query_builder::Col::new(table_name, "username"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `Profile`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct ProfileIxCols {
|
||||
pub identity: __sdk::__query_builder::IxCol<Profile, __sdk::Identity>,
|
||||
pub username: __sdk::__query_builder::IxCol<Profile, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for Profile {
|
||||
type IxCols = ProfileIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
ProfileIxCols {
|
||||
identity: __sdk::__query_builder::IxCol::new(table_name, "identity"),
|
||||
username: __sdk::__query_builder::IxCol::new(table_name, "username"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for Profile {}
|
||||
192
marts/generated/src/spacetime/profiles_table.rs
Normal file
192
marts/generated/src/spacetime/profiles_table.rs
Normal file
@@ -0,0 +1,192 @@
|
||||
// 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::profile_type::Profile;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `profiles`.
|
||||
///
|
||||
/// Obtain a handle from the [`ProfilesTableAccess::profiles`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.profiles()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.profiles().on_insert(...)`.
|
||||
pub struct ProfilesTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<Profile>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `profiles`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait ProfilesTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`ProfilesTableHandle`], which mediates access to the table `profiles`.
|
||||
fn profiles(&self) -> ProfilesTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl ProfilesTableAccess for super::RemoteTables {
|
||||
fn profiles(&self) -> ProfilesTableHandle<'_> {
|
||||
ProfilesTableHandle {
|
||||
imp: self.imp.get_table::<Profile>("profiles"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ProfilesInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct ProfilesDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for ProfilesTableHandle<'ctx> {
|
||||
type Row = Profile;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = Profile> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = ProfilesInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ProfilesInsertCallbackId {
|
||||
ProfilesInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ProfilesInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = ProfilesDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ProfilesDeleteCallbackId {
|
||||
ProfilesDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ProfilesDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ProfilesUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for ProfilesTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ProfilesUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ProfilesUpdateCallbackId {
|
||||
ProfilesUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ProfilesUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `identity` unique index on the table `profiles`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ProfilesIdentityUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.profiles().identity().find(...)`.
|
||||
pub struct ProfilesIdentityUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<Profile, __sdk::Identity>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ProfilesTableHandle<'ctx> {
|
||||
/// Get a handle on the `identity` unique index on the table `profiles`.
|
||||
pub fn identity(&self) -> ProfilesIdentityUnique<'ctx> {
|
||||
ProfilesIdentityUnique {
|
||||
imp: self
|
||||
.imp
|
||||
.get_unique_constraint::<__sdk::Identity>("identity"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ProfilesIdentityUnique<'ctx> {
|
||||
/// Find the subscribed row whose `identity` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &__sdk::Identity) -> Option<Profile> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `username` unique index on the table `profiles`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ProfilesUsernameUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.profiles().username().find(...)`.
|
||||
pub struct ProfilesUsernameUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<Profile, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ProfilesTableHandle<'ctx> {
|
||||
/// Get a handle on the `username` unique index on the table `profiles`.
|
||||
pub fn username(&self) -> ProfilesUsernameUnique<'ctx> {
|
||||
ProfilesUsernameUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("username"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ProfilesUsernameUnique<'ctx> {
|
||||
/// Find the subscribed row whose `username` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<Profile> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<Profile>("profiles");
|
||||
_table.add_unique_constraint::<__sdk::Identity>("identity", |row| &row.identity);
|
||||
_table.add_unique_constraint::<String>("username", |row| &row.username);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<Profile>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<Profile>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `Profile`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait profilesQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `Profile`.
|
||||
fn profiles(&self) -> __sdk::__query_builder::Table<Profile>;
|
||||
}
|
||||
|
||||
impl profilesQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn profiles(&self) -> __sdk::__query_builder::Table<Profile> {
|
||||
__sdk::__query_builder::Table::new("profiles")
|
||||
}
|
||||
}
|
||||
70
marts/generated/src/spacetime/remove_activity_reducer.rs
Normal file
70
marts/generated/src/spacetime/remove_activity_reducer.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::activity_type::Activity;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct RemoveActivityArgs {
|
||||
pub activity: Activity,
|
||||
}
|
||||
|
||||
impl From<RemoveActivityArgs> for super::Reducer {
|
||||
fn from(args: RemoveActivityArgs) -> Self {
|
||||
Self::RemoveActivity {
|
||||
activity: args.activity,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RemoveActivityArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `remove_activity`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait remove_activity {
|
||||
/// Request that the remote module invoke the reducer `remove_activity` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`remove_activity:remove_activity_then`] to run a callback after the reducer completes.
|
||||
fn remove_activity(&self, activity: Activity) -> __sdk::Result<()> {
|
||||
self.remove_activity_then(activity, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `remove_activity` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn remove_activity_then(
|
||||
&self,
|
||||
activity: Activity,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl remove_activity for super::RemoteReducers {
|
||||
fn remove_activity_then(
|
||||
&self,
|
||||
activity: Activity,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(RemoveActivityArgs { activity }, callback)
|
||||
}
|
||||
}
|
||||
72
marts/generated/src/spacetime/set_activity_name_reducer.rs
Normal file
72
marts/generated/src/spacetime/set_activity_name_reducer.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct SetActivityNameArgs {
|
||||
pub id: u64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
impl From<SetActivityNameArgs> for super::Reducer {
|
||||
fn from(args: SetActivityNameArgs) -> Self {
|
||||
Self::SetActivityName {
|
||||
id: args.id,
|
||||
name: args.name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for SetActivityNameArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `set_activity_name`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait set_activity_name {
|
||||
/// Request that the remote module invoke the reducer `set_activity_name` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`set_activity_name:set_activity_name_then`] to run a callback after the reducer completes.
|
||||
fn set_activity_name(&self, id: u64, name: String) -> __sdk::Result<()> {
|
||||
self.set_activity_name_then(id, name, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `set_activity_name` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn set_activity_name_then(
|
||||
&self,
|
||||
id: u64,
|
||||
name: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl set_activity_name for super::RemoteReducers {
|
||||
fn set_activity_name_then(
|
||||
&self,
|
||||
id: u64,
|
||||
name: String,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(SetActivityNameArgs { id, name }, callback)
|
||||
}
|
||||
}
|
||||
162
marts/generated/src/spacetime/task_part_table.rs
Normal file
162
marts/generated/src/spacetime/task_part_table.rs
Normal file
@@ -0,0 +1,162 @@
|
||||
// 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::action_type::Action;
|
||||
use super::task_part_type::TaskPart;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `task_part`.
|
||||
///
|
||||
/// Obtain a handle from the [`TaskPartTableAccess::task_part`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.task_part()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.task_part().on_insert(...)`.
|
||||
pub struct TaskPartTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<TaskPart>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `task_part`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait TaskPartTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`TaskPartTableHandle`], which mediates access to the table `task_part`.
|
||||
fn task_part(&self) -> TaskPartTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl TaskPartTableAccess for super::RemoteTables {
|
||||
fn task_part(&self) -> TaskPartTableHandle<'_> {
|
||||
TaskPartTableHandle {
|
||||
imp: self.imp.get_table::<TaskPart>("task_part"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TaskPartInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct TaskPartDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for TaskPartTableHandle<'ctx> {
|
||||
type Row = TaskPart;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = TaskPart> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = TaskPartInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TaskPartInsertCallbackId {
|
||||
TaskPartInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: TaskPartInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = TaskPartDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TaskPartDeleteCallbackId {
|
||||
TaskPartDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: TaskPartDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TaskPartUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for TaskPartTableHandle<'ctx> {
|
||||
type UpdateCallbackId = TaskPartUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> TaskPartUpdateCallbackId {
|
||||
TaskPartUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: TaskPartUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `identity` unique index on the table `task_part`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`TaskPartIdentityUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.task_part().identity().find(...)`.
|
||||
pub struct TaskPartIdentityUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<TaskPart, __sdk::Identity>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> TaskPartTableHandle<'ctx> {
|
||||
/// Get a handle on the `identity` unique index on the table `task_part`.
|
||||
pub fn identity(&self) -> TaskPartIdentityUnique<'ctx> {
|
||||
TaskPartIdentityUnique {
|
||||
imp: self
|
||||
.imp
|
||||
.get_unique_constraint::<__sdk::Identity>("identity"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> TaskPartIdentityUnique<'ctx> {
|
||||
/// Find the subscribed row whose `identity` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &__sdk::Identity) -> Option<TaskPart> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<TaskPart>("task_part");
|
||||
_table.add_unique_constraint::<__sdk::Identity>("identity", |row| &row.identity);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<TaskPart>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<TaskPart>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `TaskPart`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait task_partQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `TaskPart`.
|
||||
fn task_part(&self) -> __sdk::__query_builder::Table<TaskPart>;
|
||||
}
|
||||
|
||||
impl task_partQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn task_part(&self) -> __sdk::__query_builder::Table<TaskPart> {
|
||||
__sdk::__query_builder::Table::new("task_part")
|
||||
}
|
||||
}
|
||||
60
marts/generated/src/spacetime/task_part_type.rs
Normal file
60
marts/generated/src/spacetime/task_part_type.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::action_type::Action;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct TaskPart {
|
||||
pub identity: __sdk::Identity,
|
||||
pub start_of_current: __sdk::Timestamp,
|
||||
pub current: Action,
|
||||
pub upcoming: Vec<Action>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for TaskPart {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `TaskPart`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct TaskPartCols {
|
||||
pub identity: __sdk::__query_builder::Col<TaskPart, __sdk::Identity>,
|
||||
pub start_of_current: __sdk::__query_builder::Col<TaskPart, __sdk::Timestamp>,
|
||||
pub current: __sdk::__query_builder::Col<TaskPart, Action>,
|
||||
pub upcoming: __sdk::__query_builder::Col<TaskPart, Vec<Action>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for TaskPart {
|
||||
type Cols = TaskPartCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
TaskPartCols {
|
||||
identity: __sdk::__query_builder::Col::new(table_name, "identity"),
|
||||
start_of_current: __sdk::__query_builder::Col::new(table_name, "start_of_current"),
|
||||
current: __sdk::__query_builder::Col::new(table_name, "current"),
|
||||
upcoming: __sdk::__query_builder::Col::new(table_name, "upcoming"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `TaskPart`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct TaskPartIxCols {
|
||||
pub identity: __sdk::__query_builder::IxCol<TaskPart, __sdk::Identity>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for TaskPart {
|
||||
type IxCols = TaskPartIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
TaskPartIxCols {
|
||||
identity: __sdk::__query_builder::IxCol::new(table_name, "identity"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for TaskPart {}
|
||||
58
marts/generated/src/spacetime/task_type.rs
Normal file
58
marts/generated/src/spacetime/task_type.rs
Normal file
@@ -0,0 +1,58 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct Task {
|
||||
pub id: u64,
|
||||
pub done: bool,
|
||||
pub name: String,
|
||||
pub parent: Option<u64>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Task {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `Task`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct TaskCols {
|
||||
pub id: __sdk::__query_builder::Col<Task, u64>,
|
||||
pub done: __sdk::__query_builder::Col<Task, bool>,
|
||||
pub name: __sdk::__query_builder::Col<Task, String>,
|
||||
pub parent: __sdk::__query_builder::Col<Task, Option<u64>>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for Task {
|
||||
type Cols = TaskCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
TaskCols {
|
||||
id: __sdk::__query_builder::Col::new(table_name, "id"),
|
||||
done: __sdk::__query_builder::Col::new(table_name, "done"),
|
||||
name: __sdk::__query_builder::Col::new(table_name, "name"),
|
||||
parent: __sdk::__query_builder::Col::new(table_name, "parent"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `Task`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct TaskIxCols {
|
||||
pub id: __sdk::__query_builder::IxCol<Task, u64>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for Task {
|
||||
type IxCols = TaskIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
TaskIxCols {
|
||||
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for Task {}
|
||||
159
marts/generated/src/spacetime/tasks_table.rs
Normal file
159
marts/generated/src/spacetime/tasks_table.rs
Normal file
@@ -0,0 +1,159 @@
|
||||
// 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::task_type::Task;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `tasks`.
|
||||
///
|
||||
/// Obtain a handle from the [`TasksTableAccess::tasks`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.tasks()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.tasks().on_insert(...)`.
|
||||
pub struct TasksTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<Task>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `tasks`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait TasksTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`TasksTableHandle`], which mediates access to the table `tasks`.
|
||||
fn tasks(&self) -> TasksTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl TasksTableAccess for super::RemoteTables {
|
||||
fn tasks(&self) -> TasksTableHandle<'_> {
|
||||
TasksTableHandle {
|
||||
imp: self.imp.get_table::<Task>("tasks"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TasksInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct TasksDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for TasksTableHandle<'ctx> {
|
||||
type Row = Task;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = Task> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = TasksInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TasksInsertCallbackId {
|
||||
TasksInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: TasksInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = TasksDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TasksDeleteCallbackId {
|
||||
TasksDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: TasksDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TasksUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for TasksTableHandle<'ctx> {
|
||||
type UpdateCallbackId = TasksUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> TasksUpdateCallbackId {
|
||||
TasksUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: TasksUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `id` unique index on the table `tasks`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`TasksIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.tasks().id().find(...)`.
|
||||
pub struct TasksIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<Task, u64>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> TasksTableHandle<'ctx> {
|
||||
/// Get a handle on the `id` unique index on the table `tasks`.
|
||||
pub fn id(&self) -> TasksIdUnique<'ctx> {
|
||||
TasksIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<u64>("id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> TasksIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &u64) -> Option<Task> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<Task>("tasks");
|
||||
_table.add_unique_constraint::<u64>("id", |row| &row.id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<Task>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<Task>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `Task`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait tasksQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `Task`.
|
||||
fn tasks(&self) -> __sdk::__query_builder::Table<Task>;
|
||||
}
|
||||
|
||||
impl tasksQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn tasks(&self) -> __sdk::__query_builder::Table<Task> {
|
||||
__sdk::__query_builder::Table::new("tasks")
|
||||
}
|
||||
}
|
||||
44
marts/generated/src/spacetime/test_procedure.rs
Normal file
44
marts/generated/src/spacetime/test_procedure.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct TestArgs {}
|
||||
|
||||
impl __sdk::InModule for TestArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `test`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait test {
|
||||
fn test(&self) {
|
||||
self.test_then(|_, _| {});
|
||||
}
|
||||
|
||||
fn test_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<String, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl test for super::RemoteProcedures {
|
||||
fn test_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<String, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, String>("test", TestArgs {}, __callback);
|
||||
}
|
||||
}
|
||||
60
marts/generated/src/spacetime/thought_type.rs
Normal file
60
marts/generated/src/spacetime/thought_type.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct Thought {
|
||||
pub id: u64,
|
||||
pub text: String,
|
||||
pub user: __sdk::Identity,
|
||||
pub time: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Thought {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `Thought`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct ThoughtCols {
|
||||
pub id: __sdk::__query_builder::Col<Thought, u64>,
|
||||
pub text: __sdk::__query_builder::Col<Thought, String>,
|
||||
pub user: __sdk::__query_builder::Col<Thought, __sdk::Identity>,
|
||||
pub time: __sdk::__query_builder::Col<Thought, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for Thought {
|
||||
type Cols = ThoughtCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
ThoughtCols {
|
||||
id: __sdk::__query_builder::Col::new(table_name, "id"),
|
||||
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
||||
user: __sdk::__query_builder::Col::new(table_name, "user"),
|
||||
time: __sdk::__query_builder::Col::new(table_name, "time"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `Thought`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct ThoughtIxCols {
|
||||
pub id: __sdk::__query_builder::IxCol<Thought, u64>,
|
||||
pub time: __sdk::__query_builder::IxCol<Thought, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for Thought {
|
||||
type IxCols = ThoughtIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
ThoughtIxCols {
|
||||
id: __sdk::__query_builder::IxCol::new(table_name, "id"),
|
||||
time: __sdk::__query_builder::IxCol::new(table_name, "time"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for Thought {}
|
||||
159
marts/generated/src/spacetime/thoughts_table.rs
Normal file
159
marts/generated/src/spacetime/thoughts_table.rs
Normal file
@@ -0,0 +1,159 @@
|
||||
// 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::thought_type::Thought;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `thoughts`.
|
||||
///
|
||||
/// Obtain a handle from the [`ThoughtsTableAccess::thoughts`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.thoughts()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.thoughts().on_insert(...)`.
|
||||
pub struct ThoughtsTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<Thought>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `thoughts`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait ThoughtsTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`ThoughtsTableHandle`], which mediates access to the table `thoughts`.
|
||||
fn thoughts(&self) -> ThoughtsTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl ThoughtsTableAccess for super::RemoteTables {
|
||||
fn thoughts(&self) -> ThoughtsTableHandle<'_> {
|
||||
ThoughtsTableHandle {
|
||||
imp: self.imp.get_table::<Thought>("thoughts"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ThoughtsInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct ThoughtsDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for ThoughtsTableHandle<'ctx> {
|
||||
type Row = Thought;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = Thought> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = ThoughtsInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ThoughtsInsertCallbackId {
|
||||
ThoughtsInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ThoughtsInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = ThoughtsDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ThoughtsDeleteCallbackId {
|
||||
ThoughtsDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ThoughtsDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ThoughtsUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for ThoughtsTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ThoughtsUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ThoughtsUpdateCallbackId {
|
||||
ThoughtsUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ThoughtsUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `id` unique index on the table `thoughts`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ThoughtsIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.thoughts().id().find(...)`.
|
||||
pub struct ThoughtsIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<Thought, u64>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ThoughtsTableHandle<'ctx> {
|
||||
/// Get a handle on the `id` unique index on the table `thoughts`.
|
||||
pub fn id(&self) -> ThoughtsIdUnique<'ctx> {
|
||||
ThoughtsIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<u64>("id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ThoughtsIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &u64) -> Option<Thought> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
let _table = client_cache.get_or_make_table::<Thought>("thoughts");
|
||||
_table.add_unique_constraint::<u64>("id", |row| &row.id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<Thought>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<Thought>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `Thought`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait thoughtsQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `Thought`.
|
||||
fn thoughts(&self) -> __sdk::__query_builder::Table<Thought>;
|
||||
}
|
||||
|
||||
impl thoughtsQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn thoughts(&self) -> __sdk::__query_builder::Table<Thought> {
|
||||
__sdk::__query_builder::Table::new("thoughts")
|
||||
}
|
||||
}
|
||||
70
marts/generated/src/spacetime/update_activity_reducer.rs
Normal file
70
marts/generated/src/spacetime/update_activity_reducer.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::activity_type::Activity;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct UpdateActivityArgs {
|
||||
pub activity: Activity,
|
||||
}
|
||||
|
||||
impl From<UpdateActivityArgs> for super::Reducer {
|
||||
fn from(args: UpdateActivityArgs) -> Self {
|
||||
Self::UpdateActivity {
|
||||
activity: args.activity,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for UpdateActivityArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `update_activity`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait update_activity {
|
||||
/// Request that the remote module invoke the reducer `update_activity` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`update_activity:update_activity_then`] to run a callback after the reducer completes.
|
||||
fn update_activity(&self, activity: Activity) -> __sdk::Result<()> {
|
||||
self.update_activity_then(activity, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `update_activity` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn update_activity_then(
|
||||
&self,
|
||||
activity: Activity,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl update_activity for super::RemoteReducers {
|
||||
fn update_activity_then(
|
||||
&self,
|
||||
activity: Activity,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(UpdateActivityArgs { activity }, callback)
|
||||
}
|
||||
}
|
||||
70
marts/generated/src/spacetime/update_upcoming_reducer.rs
Normal file
70
marts/generated/src/spacetime/update_upcoming_reducer.rs
Normal file
@@ -0,0 +1,70 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::action_type::Action;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub(super) struct UpdateUpcomingArgs {
|
||||
pub upcoming: Vec<Action>,
|
||||
}
|
||||
|
||||
impl From<UpdateUpcomingArgs> for super::Reducer {
|
||||
fn from(args: UpdateUpcomingArgs) -> Self {
|
||||
Self::UpdateUpcoming {
|
||||
upcoming: args.upcoming,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::InModule for UpdateUpcomingArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the reducer `update_upcoming`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteReducers`].
|
||||
pub trait update_upcoming {
|
||||
/// Request that the remote module invoke the reducer `update_upcoming` to run as soon as possible.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and this method provides no way to listen for its completion status.
|
||||
/// /// Use [`update_upcoming:update_upcoming_then`] to run a callback after the reducer completes.
|
||||
fn update_upcoming(&self, upcoming: Vec<Action>) -> __sdk::Result<()> {
|
||||
self.update_upcoming_then(upcoming, |_, _| {})
|
||||
}
|
||||
|
||||
/// Request that the remote module invoke the reducer `update_upcoming` to run as soon as possible,
|
||||
/// registering `callback` to run when we are notified that the reducer completed.
|
||||
///
|
||||
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||
/// The reducer will run asynchronously in the future,
|
||||
/// and its status can be observed with the `callback`.
|
||||
fn update_upcoming_then(
|
||||
&self,
|
||||
upcoming: Vec<Action>,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()>;
|
||||
}
|
||||
|
||||
impl update_upcoming for super::RemoteReducers {
|
||||
fn update_upcoming_then(
|
||||
&self,
|
||||
upcoming: Vec<Action>,
|
||||
|
||||
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> __sdk::Result<()> {
|
||||
self.imp
|
||||
.invoke_reducer_with_callback(UpdateUpcomingArgs { upcoming }, callback)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user