Document Rust binding recovery and remove temp snapshots
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
// 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::auth_identity_type::AuthIdentity;
|
||||
|
||||
/// Table handle for the table `auth_identity`.
|
||||
///
|
||||
/// Obtain a handle from the [`AuthIdentityTableAccess::auth_identity`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.auth_identity()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.auth_identity().on_insert(...)`.
|
||||
pub struct AuthIdentityTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<AuthIdentity>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `auth_identity`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait AuthIdentityTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`AuthIdentityTableHandle`], which mediates access to the table `auth_identity`.
|
||||
fn auth_identity(&self) -> AuthIdentityTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl AuthIdentityTableAccess for super::RemoteTables {
|
||||
fn auth_identity(&self) -> AuthIdentityTableHandle<'_> {
|
||||
AuthIdentityTableHandle {
|
||||
imp: self.imp.get_table::<AuthIdentity>("auth_identity"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthIdentityInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct AuthIdentityDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> {
|
||||
type Row = AuthIdentity;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = AuthIdentity> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = AuthIdentityInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> AuthIdentityInsertCallbackId {
|
||||
AuthIdentityInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: AuthIdentityInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = AuthIdentityDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> AuthIdentityDeleteCallbackId {
|
||||
AuthIdentityDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: AuthIdentityDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthIdentityUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for AuthIdentityTableHandle<'ctx> {
|
||||
type UpdateCallbackId = AuthIdentityUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> AuthIdentityUpdateCallbackId {
|
||||
AuthIdentityUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: AuthIdentityUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `identity_id` unique index on the table `auth_identity`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AuthIdentityIdentityIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.auth_identity().identity_id().find(...)`.
|
||||
pub struct AuthIdentityIdentityIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AuthIdentity, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AuthIdentityTableHandle<'ctx> {
|
||||
/// Get a handle on the `identity_id` unique index on the table `auth_identity`.
|
||||
pub fn identity_id(&self) -> AuthIdentityIdentityIdUnique<'ctx> {
|
||||
AuthIdentityIdentityIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("identity_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AuthIdentityIdentityIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `identity_id` 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<AuthIdentity> {
|
||||
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::<AuthIdentity>("auth_identity");
|
||||
_table.add_unique_constraint::<String>("identity_id", |row| &row.identity_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AuthIdentity>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<AuthIdentity>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AuthIdentity`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait auth_identityQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AuthIdentity`.
|
||||
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity>;
|
||||
}
|
||||
|
||||
impl auth_identityQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity> {
|
||||
__sdk::__query_builder::Table::new("auth_identity")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user