#[non_exhaustive]pub struct ReducerEvent<R> {
pub timestamp: Timestamp,
pub status: Status,
pub caller_identity: Identity,
pub caller_connection_id: Option<ConnectionId>,
pub energy_consumed: Option<u128>,
pub reducer: R,
}Expand description
A state change due to a reducer, which may or may not have committed successfully.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timestamp: TimestampThe time at which the reducer was invoked.
status: StatusWhether the reducer committed, was aborted due to insufficient energy, or failed with an error message.
caller_identity: IdentityThe Identity of the SpacetimeDB actor which invoked the reducer.
caller_connection_id: Option<ConnectionId>The ConnectionId of the SpacetimeDB actor which invoked the reducer,
or None for scheduled reducers.
energy_consumed: Option<u128>The amount of energy consumed by the reducer run, in eV. (Not literal eV, but our SpacetimeDB energy unit eV.)
May be None if the module is configured not to broadcast energy consumed.
reducer: RThe Reducer enum defined by the module_bindings, which encodes which reducer ran and its arguments.
Trait Implementations§
Source§impl<R: Clone> Clone for ReducerEvent<R>
impl<R: Clone> Clone for ReducerEvent<R>
Source§fn clone(&self) -> ReducerEvent<R>
fn clone(&self) -> ReducerEvent<R>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<R> Freeze for ReducerEvent<R>where
R: Freeze,
impl<R> RefUnwindSafe for ReducerEvent<R>where
R: RefUnwindSafe,
impl<R> Send for ReducerEvent<R>where
R: Send,
impl<R> Sync for ReducerEvent<R>where
R: Sync,
impl<R> Unpin for ReducerEvent<R>where
R: Unpin,
impl<R> UnwindSafe for ReducerEvent<R>where
R: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more