Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ ctx.db // Database access
ctx.sender // Identity of caller
ctx.connectionId // ConnectionId | undefined
ctx.timestamp // Timestamp
ctx.identity // Module's identity
ctx.databaseIdentity // Module's identity
```

</TabItem>
Expand All @@ -763,7 +763,7 @@ ctx.Db // Database access
ctx.Sender // Identity of caller
ctx.ConnectionId // ConnectionId?
ctx.Timestamp // Timestamp
ctx.Identity // Module's identity
ctx.DatabaseIdentity // Module's identity
ctx.Rng // Random number generator
```

Expand All @@ -775,7 +775,7 @@ ctx.db // Database access
ctx.sender() // Identity of caller
ctx.connection_id() // Option<ConnectionId>
ctx.timestamp // Timestamp
ctx.identity() // Module's identity
ctx.database_identity() // Module's identity
ctx.rng() // Random number generator
```

Expand All @@ -787,7 +787,7 @@ ctx.db // Database access (Table accessor)
ctx.sender() // Identity of caller (Identity type)
ctx.connection_id // std::optional<ConnectionId>
ctx.timestamp // Timestamp of current transaction (Timestamp type)
ctx.identity() // Module's own identity (Identity type)
ctx.database_identity() // Module's own identity (Identity type)
ctx.rng() // Random number generator (for seeded randomness)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ SPACETIMEDB_REDUCER(send_reminder, ReducerContext _ctx, ScheduledTask task) {
| `ConnectionId` | `ConnectionId?` | Connection ID of the caller, if available |
| `Timestamp` | `Timestamp` | Time when the reducer was invoked |
| `Rng` | `Random` | Random number generator |
| `Identity` | `Identity` | The module's identity |
| `DatabaseIdentity` | `Identity` | The module's identity |
</TabItem>
<TabItem value="rust" label="Rust">

Expand All @@ -413,7 +413,7 @@ SPACETIMEDB_REDUCER(send_reminder, ReducerContext _ctx, ScheduledTask task) {

**Methods:**

- `identity() -> Identity` - Get the module's identity
- `database_identity() -> Identity` - Get the module's identity
- `rng() -> &StdbRng` - Get the random number generator
- `random<T>() -> T` - Generate a single random value
- `sender_auth() -> &AuthCtx` - Get authorization context for the caller (includes JWT claims and internal call detection)
Expand All @@ -429,7 +429,7 @@ SPACETIMEDB_REDUCER(send_reminder, ReducerContext _ctx, ScheduledTask task) {

**Methods:**

- `identity() -> Identity` - Get the module's identity
- `database_identity() -> Identity` - Get the module's identity
- `rng() -> StdbRng&` - Get the random number generator (deterministic and reproducible)
- `sender_auth() -> const AuthCtx&` - Get authorization context for the caller (includes JWT claims and internal call detection)

Expand Down