@@ -56,10 +56,6 @@ For example:
56
56
57
57
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#append-duplicate-event
58
58
</xode-block >
59
- <xode-block title =" Rust " >
60
-
61
- <<< @/docs/clients/rust/generated/0.9.9/samples/appending_events.rs#append-duplicate-event
62
- </xode-block >
63
59
</xode-group >
64
60
65
61
will result in only a single event being appended.
@@ -107,7 +103,31 @@ For example if we try and append the same record twice expecting both times that
107
103
</xode-block >
108
104
<xode-block title =" Rust " >
109
105
110
- <<< @/docs/clients/rust/generated/0.9.9/samples/appending_events.rs#append-with-no-stream
106
+ ``` rust
107
+
108
+ let data = TestEvent {
109
+ id : " 1" . to_string (),
110
+ important_data : " some value" . to_string (),
111
+ };
112
+
113
+ let event = EventData :: json (" some-event" , & data )? . id (Uuid :: new_v4 ());
114
+ let options = AppendToStreamOptions :: default (). expected_revision (ExpectedRevision :: NoStream );
115
+
116
+ let _ = client
117
+ . append_to_stream (" same-event-stream" , & options , event )
118
+ . await ? ;
119
+
120
+ let data = TestEvent {
121
+ id : " 2" . to_string (),
122
+ important_data : " some other value" . to_string (),
123
+ };
124
+
125
+ let event = EventData :: json (" some-event" , & data )? . id (Uuid :: new_v4 ());
126
+
127
+ let _ = client
128
+ . append_to_stream (" same-event-stream" , & options , event )
129
+ . await ? ;
130
+ ```
111
131
</xode-block >
112
132
</xode-group >
113
133
@@ -131,10 +151,6 @@ This check can be used to implement optimistic concurrency. When you retrieve a
131
151
132
152
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#append-with-concurrency-check
133
153
</xode-block >
134
- <xode-block title =" Rust " >
135
-
136
- <<< @/docs/clients/rust/generated/0.9.9/samples/appending_events.rs#append-with-concurrency-check
137
- </xode-block >
138
154
</xode-group >
139
155
140
156
<!-- ## Options
@@ -156,8 +172,4 @@ You can provide user credentials to be used to append the data as follows. This
156
172
157
173
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#overriding-user-credentials
158
174
</xode-block >
159
- <xode-block title =" Rust " >
160
-
161
- <<< @/docs/clients/rust/generated/0.9.9/samples/appending_events.rs#overriding-user-credentials
162
- </xode-block >
163
175
</xode-group >
0 commit comments