Struct spacetimedb::ReducerContext
source · #[non_exhaustive]pub struct ReducerContext {
pub sender: Identity,
pub timestamp: Timestamp,
pub address: Option<Address>,
}
Expand description
A context that any reducer is provided with.
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.sender: Identity
The Identity
of the client that invoked the reducer.
timestamp: Timestamp
The time at which the reducer was started.
address: Option<Address>
The Address
of the client that invoked the reducer.
None
if no Address
was supplied to the /database/call
HTTP endpoint,
or via the CLI’s spacetime call
subcommand.
For automatic reducers, i.e. init
, update
and scheduled reducers,
this will be the module’s Address
.
Trait Implementations§
source§impl Clone for ReducerContext
impl Clone for ReducerContext
source§fn clone(&self) -> ReducerContext
fn clone(&self) -> ReducerContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Copy for ReducerContext
Auto Trait Implementations§
impl Freeze for ReducerContext
impl RefUnwindSafe for ReducerContext
impl Send for ReducerContext
impl Sync for ReducerContext
impl Unpin for ReducerContext
impl UnwindSafe for ReducerContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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