// 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 SkipCallArgs {} impl From for super::Reducer { fn from(args: SkipCallArgs) -> Self { Self::SkipCall } } impl __sdk::InModule for SkipCallArgs { type Module = super::RemoteModule; } pub struct SkipCallCallbackId(__sdk::CallbackId); #[allow(non_camel_case_types)] /// Extension trait for access to the reducer `skip_call`. /// /// Implemented for [`super::RemoteReducers`]. pub trait skip_call { /// Request that the remote module invoke the reducer `skip_call` 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 its status can be observed by listening for [`Self::on_skip_call`] callbacks. fn skip_call(&self) -> __sdk::Result<()>; /// Register a callback to run whenever we are notified of an invocation of the reducer `skip_call`. /// /// Callbacks should inspect the [`__sdk::ReducerEvent`] contained in the [`super::ReducerEventContext`] /// to determine the reducer's status. /// /// The returned [`SkipCallCallbackId`] can be passed to [`Self::remove_on_skip_call`] /// to cancel the callback. fn on_skip_call( &self, callback: impl FnMut(&super::ReducerEventContext) + Send + 'static, ) -> SkipCallCallbackId; /// Cancel a callback previously registered by [`Self::on_skip_call`], /// causing it not to run in the future. fn remove_on_skip_call(&self, callback: SkipCallCallbackId); } impl skip_call for super::RemoteReducers { fn skip_call(&self) -> __sdk::Result<()> { self.imp.call_reducer("skip_call", SkipCallArgs {}) } fn on_skip_call( &self, mut callback: impl FnMut(&super::ReducerEventContext) + Send + 'static, ) -> SkipCallCallbackId { SkipCallCallbackId(self.imp.on_reducer( "skip_call", Box::new(move |ctx: &super::ReducerEventContext| { #[allow(irrefutable_let_patterns)] let super::ReducerEventContext { event: __sdk::ReducerEvent { reducer: super::Reducer::SkipCall {}, .. }, .. } = ctx else { unreachable!() }; callback(ctx) }), )) } fn remove_on_skip_call(&self, callback: SkipCallCallbackId) { self.imp.remove_on_reducer("skip_call", callback.0) } } #[allow(non_camel_case_types)] #[doc(hidden)] /// Extension trait for setting the call-flags for the reducer `skip_call`. /// /// Implemented for [`super::SetReducerFlags`]. /// /// This type is currently unstable and may be removed without a major version bump. pub trait set_flags_for_skip_call { /// Set the call-reducer flags for the reducer `skip_call` to `flags`. /// /// This type is currently unstable and may be removed without a major version bump. fn skip_call(&self, flags: __ws::CallReducerFlags); } impl set_flags_for_skip_call for super::SetReducerFlags { fn skip_call(&self, flags: __ws::CallReducerFlags) { self.imp.set_call_reducer_flags("skip_call", flags); } }