Skip to content

Commit

Permalink
cargo insta accept
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Oct 14, 2024
1 parent c558d0a commit 2a9424e
Showing 1 changed file with 239 additions and 0 deletions.
239 changes: 239 additions & 0 deletions crates/cli/tests/snapshots/codegen__codegen_rust.snap
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ impl add_player for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `add_player`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_add_player {
/// Set the call-reducer flags for the reducer `add_player` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn add_player(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_add_player for super::SetReducerFlags {
fn add_player(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("add_player", flags);
}
}

'''
"add_private_reducer.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -149,6 +171,28 @@ impl add_private for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `add_private`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_add_private {
/// Set the call-reducer flags for the reducer `add_private` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn add_private(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_add_private for super::SetReducerFlags {
fn add_private(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("add_private", flags);
}
}

'''
"baz_type.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -248,6 +292,28 @@ impl delete_player for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `delete_player`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_delete_player {
/// Set the call-reducer flags for the reducer `delete_player` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn delete_player(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_delete_player for super::SetReducerFlags {
fn delete_player(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("delete_player", flags);
}
}

'''
"delete_players_by_name_reducer.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -322,6 +388,28 @@ impl delete_players_by_name for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `delete_players_by_name`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_delete_players_by_name {
/// Set the call-reducer flags for the reducer `delete_players_by_name` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn delete_players_by_name(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_delete_players_by_name for super::SetReducerFlags {
fn delete_players_by_name(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("delete_players_by_name", flags);
}
}

'''
"foobar_type.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -541,6 +629,28 @@ impl identity_connected for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `__identity_connected__`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_identity_connected {
/// Set the call-reducer flags for the reducer `__identity_connected__` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn identity_connected(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_identity_connected for super::SetReducerFlags {
fn identity_connected(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("__identity_connected__", flags);
}
}

'''
"init_reducer.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -612,6 +722,28 @@ impl init for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `__init__`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_init {
/// Set the call-reducer flags for the reducer `__init__` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn init(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_init for super::SetReducerFlags {
fn init(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("__init__", flags);
}
}

'''
"mod.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -845,6 +977,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule {
type Reducer = Reducer;
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;
type DbUpdate = DbUpdate;
type SubscriptionHandle = SubscriptionHandle;
}
Expand All @@ -859,6 +992,21 @@ impl __sdk::spacetime_module::InModule for RemoteReducers {
type Module = RemoteModule;
}

#[doc(hidden)]
/// The `set_reducer_flags` field of [`DbConnection`],
/// with methods provided by extension traits for each reducer defined by the module.
/// Each method sets the flags for the reducer with the same name.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub struct SetReducerFlags {
imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
}

impl __sdk::spacetime_module::InModule for SetReducerFlags {
type Module = RemoteModule;
}

/// The `db` field of [`EventContext`] and [`DbConnection`],
/// with methods provided by extension traits for each table defined by the module.
pub struct RemoteTables {
Expand Down Expand Up @@ -890,6 +1038,13 @@ pub struct DbConnection {
pub db: RemoteTables,
/// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`].
pub reducers: RemoteReducers,
#[doc(hidden)]
/// Access to setting the call-flags of each reducer defined for each reducer defined by the module
/// via extension traits implemented for [`SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub set_reducer_flags: SetReducerFlags,

imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
}
Expand All @@ -901,13 +1056,17 @@ impl __sdk::spacetime_module::InModule for DbConnection {
impl __sdk::db_context::DbContext for DbConnection {
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;

fn db(&self) -> &Self::DbView {
&self.db
}
fn reducers(&self) -> &Self::Reducers {
&self.reducers
}
fn set_reducer_flags(&self) -> &Self::SetReducerFlags {
&self.set_reducer_flags
}

fn is_active(&self) -> bool {
self.imp.is_active()
Expand Down Expand Up @@ -1007,6 +1166,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection {
Self {
db: RemoteTables { imp: imp.clone() },
reducers: RemoteReducers { imp: imp.clone() },
set_reducer_flags: SetReducerFlags { imp: imp.clone() },
imp,
}
}
Expand All @@ -1019,6 +1179,12 @@ pub struct EventContext {
pub db: RemoteTables,
/// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`].
pub reducers: RemoteReducers,
/// Access to setting the call-flags of each reducer defined for each reducer defined by the module
/// via extension traits implemented for [`SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub set_reducer_flags: SetReducerFlags,
/// The event which caused these callbacks to run.
pub event: __sdk::event::Event<Reducer>,
imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
Expand All @@ -1031,13 +1197,17 @@ impl __sdk::spacetime_module::InModule for EventContext {
impl __sdk::db_context::DbContext for EventContext {
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;

fn db(&self) -> &Self::DbView {
&self.db
}
fn reducers(&self) -> &Self::Reducers {
&self.reducers
}
fn set_reducer_flags(&self) -> &Self::SetReducerFlags {
&self.set_reducer_flags
}

fn is_active(&self) -> bool {
self.imp.is_active()
Expand Down Expand Up @@ -1069,6 +1239,7 @@ impl __sdk::spacetime_module::EventContext for EventContext {
Self {
db: RemoteTables { imp: imp.clone() },
reducers: RemoteReducers { imp: imp.clone() },
set_reducer_flags: SetReducerFlags { imp: imp.clone() },
event,
imp,
}
Expand Down Expand Up @@ -1099,11 +1270,13 @@ impl __sdk::spacetime_module::SubscriptionHandle for SubscriptionHandle {
pub trait RemoteDbContext: __sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SetReducerFlags = SetReducerFlags,
SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder<RemoteModule>,
> {}
impl<Ctx: __sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SetReducerFlags = SetReducerFlags,
SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder<RemoteModule>,
>> RemoteDbContext for Ctx {}

Expand Down Expand Up @@ -1663,6 +1836,28 @@ impl query_private for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `query_private`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_query_private {
/// Set the call-reducer flags for the reducer `query_private` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn query_private(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_query_private for super::SetReducerFlags {
fn query_private(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("query_private", flags);
}
}

'''
"repeating_test_arg_table.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -1904,6 +2099,28 @@ impl repeating_test for super::RemoteReducers {
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `repeating_test`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_repeating_test {
/// Set the call-reducer flags for the reducer `repeating_test` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn repeating_test(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_repeating_test for super::SetReducerFlags {
fn repeating_test(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("repeating_test", flags);
}
}

'''
"test_a_table.rs" = '''
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
Expand Down Expand Up @@ -2532,4 +2749,26 @@ arg_4: NamespaceTestF,
}
}

#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `test`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
pub trait set_flags_for_test {
/// Set the call-reducer flags for the reducer `test` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
/// The ability to send over call-reducer flags in the protocol will however remain.
fn test(&self, flags: __ws::CallReducerFlags);
}

impl set_flags_for_test for super::SetReducerFlags {
fn test(&self, flags: __ws::CallReducerFlags) {
self.imp.set_call_reducer_flags("test", flags);
}
}

'''

0 comments on commit 2a9424e

Please sign in to comment.