You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This also allows you to read *all* events ever written. To do so, provide `/` as the subject and set `recursive` to `true`, since all subjects are nested under the root subject.
@@ -170,7 +173,7 @@ let result = client
170
173
..Default::default(),
171
174
}
172
175
))
173
-
.await
176
+
.await;
174
177
```
175
178
176
179
*Note that you can also use the `Chronological` Ordering to explicitly enforce the default order.*
@@ -197,7 +200,7 @@ let result = client
197
200
..Default::default(),
198
201
}
199
202
))
200
-
.await
203
+
.await;
201
204
```
202
205
203
206
#### Starting From the Latest Event of a Given Type
@@ -221,7 +224,7 @@ let result = client
221
224
..Default::default(),
222
225
}
223
226
))
224
-
.await
227
+
.await;
225
228
```
226
229
227
230
*Note that `from_latest_event` and `lower_bound` can not be provided at the same time.*
@@ -233,11 +236,11 @@ To run an EventQL query, call the `run_eventql_query` function and provide the q
233
236
```rust
234
237
letresult=client
235
238
.run_eventql_query("FROM e IN events PROJECT INTO e")
236
-
.await
239
+
.await;
237
240
238
241
matchresult {
239
242
Err(err) =>// ...
240
-
Some(stream) => {
243
+
Ok(mutstream) => {
241
244
whileletSome(row) =stream.next().await {
242
245
// ...
243
246
}
@@ -259,14 +262,15 @@ let result = client
259
262
.observe_events("/books/42", Some(
260
263
ObserveEventsRequestOptions {
261
264
recursive:false,
262
-
..Default::default(),
265
+
from_latest_event:None,
266
+
lower_bound:None,
263
267
}
264
268
))
265
-
.await
269
+
.await;
266
270
267
271
matchresult {
268
272
Err(err) =>// ...
269
-
Some(stream) => {
273
+
Ok(mutstream) => {
270
274
whileletSome(event) =stream.next().await {
271
275
// ...
272
276
}
@@ -349,7 +353,7 @@ To register an event schema, call the `register_event_schema` function and hand
349
353
```rust
350
354
client.register_event_schema(
351
355
"io.eventsourcingdb.library.book-acquired",
352
-
json!({
356
+
&json!({
353
357
"type":"object",
354
358
"properties": {
355
359
"title": { "type":"string" },
@@ -362,7 +366,7 @@ client.register_event_schema(
362
366
"isbn",
363
367
],
364
368
"additionalProperties":false,
365
-
}),
369
+
}).await;,
366
370
)
367
371
```
368
372
@@ -371,7 +375,7 @@ client.register_event_schema(
371
375
To list all subjects, call the `list_subjects` function with `/` as the base subject. The function returns a stream from which you can retrieve one subject at a time:
372
376
373
377
```rust
374
-
letresult:=client.list_subjects("/");
378
+
letresult=client.list_subjects(Some("/")).await;
375
379
matchresult {
376
380
Ok(subjects) =>// ...
377
381
Err(err) =>// ...
@@ -389,7 +393,7 @@ let result := client.list_subjects("/books");
389
393
To list all event types, call the `list_event_types` function. The function returns a stream from which you can retrieve one event type at a time:
0 commit comments