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
Copy file name to clipboardExpand all lines: README.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ if let Err(err) = result {
37
37
}
38
38
```
39
39
40
-
*Note that `Ping` does not require authentication, so the call may succeed even if the API token is invalid.*
40
+
*Note that `ping` does not require authentication, so the call may succeed even if the API token is invalid.*
41
41
42
42
If you want to verify the API token, call `verify_api_token`. If the token is invalid, the function will return an error:
43
43
@@ -54,7 +54,7 @@ Call the `write_events` function and hand over a vector with one or more events.
54
54
55
55
Specify `source`, `subject`, `type` (using `ty`), and `data` according to the [CloudEvents](https://docs.eventsourcingdb.io/fundamentals/cloud-events/) format.
56
56
57
-
For `data` provide a json object using a `serde_json:Value`.
57
+
For `data` provide a JSON object using a `serde_json:Value`.
58
58
59
59
The function returns the written events, including the fields added by the server:
60
60
@@ -79,7 +79,7 @@ match result {
79
79
80
80
#### Using the `IsSubjectPristine` precondition
81
81
82
-
If you only want to write events in case a subject (such as `/books/42`) does not yet have any events, use the `IsSubjectPristine`Precondition to create a precondition and pass it in a vector as the second argument:
82
+
If you only want to write events in case a subject (such as `/books/42`) does not yet have any events, use the `IsSubjectPristine`precondition to create a precondition and pass it in a vector as the second argument:
83
83
84
84
```rust
85
85
letresult=client.write_events(
@@ -96,12 +96,12 @@ match result {
96
96
97
97
#### Using the `IsSubjectOnEventId` precondition
98
98
99
-
If you only want to write events in case the last event of a subject (such as `/books/42`) has a specific ID (e.g., `0`), use the `IsSubjectOnEventID` Precondition to create a precondition and pass it in a vector as the second argument:
99
+
If you only want to write events in case the last event of a subject (such as `/books/42`) has a specific ID (e.g., `0`), use the `IsSubjectOnEventId` precondition to create a precondition and pass it in a vector as the second argument:
100
100
101
101
```rust
102
102
letresult=client.write_events(
103
103
vec![event.clone()],
104
-
vec![Precondition::IsSubjectPristine {
104
+
vec![Precondition::IsSubjectOnEventId {
105
105
subject:"/books/42".to_string(),
106
106
event_id:"0".to_string(),
107
107
}],
@@ -123,7 +123,7 @@ The function returns a stream from which you can retrieve one event at a time:
123
123
```rust
124
124
letresult=client
125
125
.read_events("/books/42", Some(
126
-
ReadEventsRequestOptions {
126
+
ReadEventsOptions {
127
127
recursive:false,
128
128
from_latest_event:None,
129
129
order:None,
@@ -150,7 +150,7 @@ If you want to read not only all the events of a subject, but also the events of
150
150
```rust
151
151
letresult=client
152
152
.read_events("/books/42", Some(
153
-
ReadEventsRequestOptions {
153
+
ReadEventsOptions {
154
154
recursive:true,
155
155
..Default::default(),
156
156
}
@@ -167,7 +167,7 @@ By default, events are read in chronological order. To read in anti-chronologica
167
167
```rust
168
168
letresult=client
169
169
.read_events("/books/42", Some(
170
-
ReadEventsRequestOptions {
170
+
ReadEventsOptions {
171
171
recursive:false,
172
172
order:Some(Ordering::Antichronological)
173
173
..Default::default(),
@@ -187,7 +187,7 @@ Specify the ID and whether to include or exclude it, for both the lower and uppe
187
187
```rust
188
188
letresult=client
189
189
.read_events("/books/42", Some(
190
-
ReadEventsRequestOptions {
190
+
ReadEventsOptions {
191
191
recursive:false,
192
192
lower_bound:Some(Bound {
193
193
bound_type:BoundType::Inclusive,
@@ -212,13 +212,13 @@ Possible options are `ReadNothing`, which skips reading entirely, or `ReadyEvery
0 commit comments