Skip to content

Commit c8a8cec

Browse files
committed
fixed missing server annotations
1 parent daae87a commit c8a8cec

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/docs/02-quickstarts/02-c-sharp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ For each `User`, we'll store their `Identity`, an optional name they can set to
8484

8585
In `spacetimedb/Lib.cs`, add the definition of the table `User` to the `Module` class:
8686

87-
```csharp
87+
```csharp server
8888
[Table(Name = "user", Public = true)]
8989
public partial class User
9090
{
@@ -143,7 +143,7 @@ For now, we'll just do a bare minimum of validation, rejecting the empty name. Y
143143

144144
In `spacetimedb/Lib.cs`, add to the `Module` class:
145145

146-
```csharp
146+
```csharp server
147147
/// Takes a name and checks if it's acceptable as a user's name.
148148
private static string ValidateName(string name)
149149
{
@@ -182,7 +182,7 @@ We'll want to validate messages' texts in much the same way we validate users' c
182182

183183
In `spacetimedb/Lib.cs`, add to the `Module` class:
184184

185-
```csharp
185+
```csharp server
186186
/// Takes a message's text and checks if it's acceptable to send.
187187
private static string ValidateMessage(string text)
188188
{

docs/docs/02-quickstarts/03-rust.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spacetime build
6565

6666
To the top of `spacetimedb/src/lib.rs`, add some imports we'll be using:
6767

68-
```rust
68+
```rust server
6969
use spacetimedb::{table, reducer, Table, ReducerContext, Identity, Timestamp};
7070
```
7171

@@ -86,7 +86,7 @@ For each `User`, we'll store their `Identity`, an optional name they can set to
8686

8787
To `spacetimedb/src/lib.rs`, add the definition of the table `User`:
8888

89-
```rust
89+
```rust server
9090
#[table(name = user, public)]
9191
pub struct User {
9292
#[primary_key]
@@ -100,7 +100,7 @@ For each `Message`, we'll store the `Identity` of the user who sent it, the `Tim
100100

101101
To `spacetimedb/src/lib.rs`, add the definition of the table `Message`:
102102

103-
```rust
103+
```rust server
104104
#[table(name = message, public)]
105105
pub struct Message {
106106
sender: Identity,
@@ -119,7 +119,7 @@ It's also possible to call `set_name` via the SpacetimeDB CLI's `spacetime call`
119119

120120
To `spacetimedb/src/lib.rs`, add:
121121

122-
```rust
122+
```rust server
123123
#[reducer]
124124
/// Clients invoke this reducer to set their user names.
125125
pub fn set_name(ctx: &ReducerContext, name: String) -> Result<(), String> {
@@ -143,7 +143,7 @@ For now, we'll just do a bare minimum of validation, rejecting the empty name. Y
143143

144144
To `spacetimedb/src/lib.rs`, add:
145145

146-
```rust
146+
```rust server
147147
/// Takes a name and checks if it's acceptable as a user's name.
148148
fn validate_name(name: String) -> Result<String, String> {
149149
if name.is_empty() {
@@ -160,7 +160,7 @@ We define a reducer `send_message`, which clients will call to send messages. It
160160

161161
To `spacetimedb/src/lib.rs`, add:
162162

163-
```rust
163+
```rust server
164164
#[reducer]
165165
/// Clients invoke this reducer to send messages.
166166
pub fn send_message(ctx: &ReducerContext, text: String) -> Result<(), String> {
@@ -179,7 +179,7 @@ We'll want to validate messages' texts in much the same way we validate users' c
179179

180180
To `spacetimedb/src/lib.rs`, add:
181181

182-
```rust
182+
```rust server
183183
/// Takes a message's text and checks if it's acceptable to send.
184184
fn validate_message(text: String) -> Result<String, String> {
185185
if text.is_empty() {
@@ -203,7 +203,7 @@ We'll use `ctx.db.user().identity().find(ctx.sender)` to look up a `User` row fo
203203

204204
To `spacetimedb/src/lib.rs`, add the definition of the connect reducer:
205205

206-
```rust
206+
```rust server
207207
#[reducer(client_connected)]
208208
// Called when a client connects to a SpacetimeDB database
209209
pub fn client_connected(ctx: &ReducerContext) {
@@ -225,7 +225,7 @@ pub fn client_connected(ctx: &ReducerContext) {
225225

226226
Similarly, whenever a client disconnects, the database will run the `#[reducer(client_disconnected)]` reducer if it's defined. By convention, it's named `client_disconnected`. We'll use it to un-set the `online` status of the `User` for the disconnected client.
227227

228-
```rust
228+
```rust server
229229
#[reducer(client_disconnected)]
230230
// Called when a client disconnects from SpacetimeDB database
231231
pub fn identity_disconnected(ctx: &ReducerContext) {

0 commit comments

Comments
 (0)