Skip to content

Commit 2fd0666

Browse files
committed
Added replace rust filename into rs because of the issue: vuejs/vuepress#1189
1 parent c29b7d7 commit 2fd0666

File tree

7 files changed

+165
-27
lines changed

7 files changed

+165
-27
lines changed

Diff for: docs/clients/grpc/appending-events/README.md

+14-26
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The simplest way to append an event to EventStoreDB is to create an `EventData`
2121
</xode-block>
2222
<xode-block title="Rust">
2323

24-
<<< @/docs/clients/rust/generated/0.9.9/samples/appending_events.rs#append-to-stream
24+
<<< @/docs/clients/rust/generated/1.0.0/samples/appending_events.rust#append-to-stream
2525
</xode-block>
2626
</xode-group>
2727

@@ -56,6 +56,10 @@ For example:
5656

5757
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#append-duplicate-event
5858
</xode-block>
59+
<xode-block title="Rust">
60+
61+
<<< @/docs/clients/rust/generated/1.0.0/samples/appending_events.rust#append-duplicate-event
62+
</xode-block>
5963
</xode-group>
6064

6165
will result in only a single event being appended.
@@ -103,31 +107,7 @@ For example if we try and append the same record twice expecting both times that
103107
</xode-block>
104108
<xode-block title="Rust">
105109

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-
```
110+
<<< @/docs/clients/rust/generated/1.0.0/samples/appending_events.rust#append-with-no-stream
131111
</xode-block>
132112
</xode-group>
133113

@@ -151,6 +131,10 @@ This check can be used to implement optimistic concurrency. When you retrieve a
151131

152132
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#append-with-concurrency-check
153133
</xode-block>
134+
<xode-block title="Rust">
135+
136+
<<< @/docs/clients/rust/generated/1.0.0/samples/appending_events.rust#append-with-concurrency-check
137+
</xode-block>
154138
</xode-group>
155139

156140
<!-- ## Options
@@ -172,4 +156,8 @@ You can provide user credentials to be used to append the data as follows. This
172156

173157
<<< @/docs/clients/java/generated/0.7/samples/appending_events/AppendingEvents.java#overriding-user-credentials
174158
</xode-block>
159+
<xode-block title="Rust">
160+
161+
<<< @/docs/clients/rust/generated/1.0.0/samples/appending_events.rust#overriding-user-credentials
162+
</xode-block>
175163
</xode-group>

Diff for: docs/clients/grpc/getting-started/connecting.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ dotnet add package EventStore.Client.Grpc.Streams --version 20.10
1515
$ dotnet add package Grpc.Net.Client --version 2.34.0
1616
```
1717
</xode-block>
18-
<xode-block title="NodeJS" code="connectionString">
18+
<xode-block title="NodeJS">
1919

2020
```
2121
# Yarn
@@ -42,6 +42,12 @@ implementation 'com.eventstore:db-client-java:0.5'
4242
libraryDependencies += "com.eventstore" % "db-client-java" % "0.6"
4343
```
4444
</xode-block>
45+
<xode-block title="Rust">
46+
47+
```
48+
No additional configuration is needed having Rust installed. Go check https://rustup.rs.
49+
```
50+
</xode-block>
4551
</xode-group>
4652

4753
::: warning Preview clients
@@ -77,6 +83,10 @@ First thing first, we need a client.
7783

7884
<<< @/docs/clients/java/generated/0.7/samples/quick_start/QuickStart.java#createClient
7985
</xode-block>
86+
<xode-block title="Rust" code="connectionString">
87+
88+
<<< @/docs/clients/rust/generated/1.0.0/samples/quickstart.rust#createClient
89+
</xode-block>
8090
</xode-group>
8191

8292
The client instance can be used as a singleton across the whole application. It doesn't need to open or close the connection.
@@ -105,6 +115,10 @@ The code snippet below creates an event object instance, serializes it and puts
105115

106116
<<< @/docs/clients/java/generated/0.7/samples/quick_start/QuickStart.java#createEvent
107117
</xode-block>
118+
<xode-block title="Rust">
119+
120+
<<< @/docs/clients/rust/generated/1.0.0/samples/quickstart.rust#createEvent
121+
</xode-block>
108122
</xode-group>
109123

110124
## Appending events
@@ -126,6 +140,10 @@ In the snippet below, we append the event to the stream `some-stream`.
126140

127141
<<< @/docs/clients/java/generated/0.7/samples/quick_start/QuickStart.java#appendEvents
128142
</xode-block>
143+
<xode-block title="Rust">
144+
145+
<<< @/docs/clients/rust/generated/1.0.0/samples/quickstart.rust#appendEvents
146+
</xode-block>
129147
</xode-group>
130148

131149
Here we are appending events without checking if the stream exists or if the stream version matches the expected event version. See more advanced scenarios in [appending events documentation](../appending-events/README.md).
@@ -147,6 +165,10 @@ Finally, we can read events back from the `some-stream` stream.
147165

148166
<<< @/docs/clients/java/generated/0.7/samples/quick_start/QuickStart.java#readStream
149167
</xode-block>
168+
<xode-block title="Rust">
169+
170+
<<< @/docs/clients/rust/generated/1.0.0/samples/quickstart.rust#readStream
171+
</xode-block>
150172
</xode-group>
151173

152174
When you read events from the stream, you get a collection of `ResolvedEvent` structures. The event payload is returned as a byte array and needs to be deserialized. See more advanced scenarios in [reading events documentation](../reading-events/README.md).

Diff for: docs/clients/grpc/reading-events/reading-from-a-stream.md

+24
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ The simplest way to read a stream forwards is to supply a stream name, direction
1919

2020
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-stream
2121
</xode-block>
22+
<xode-block title="Rust">
23+
24+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-stream
25+
</xode-block>
2226
</xode-group>
2327

2428
This will return an enumerable that can be iterated on:
@@ -36,6 +40,10 @@ This will return an enumerable that can be iterated on:
3640

3741
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#iterate-stream
3842
</xode-block>
43+
<xode-block title="Rust">
44+
45+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#iterate-stream
46+
</xode-block>
3947
</xode-group>
4048

4149
There are a number of additional arguments you can provide when reading a stream
@@ -68,6 +76,10 @@ The credentials used to read the data can be supplied. to be used by the subscri
6876

6977
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#overriding-user-credentials
7078
</xode-block>
79+
<xode-block title="Rust">
80+
81+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#overriding-user-credentials
82+
</xode-block>
7183
</xode-group>
7284

7385
## Reading from a revision
@@ -87,6 +99,10 @@ As well as providing a `StreamPosition` you can also provide a specific stream r
8799

88100
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-stream-position
89101
</xode-block>
102+
<xode-block title="Rust">
103+
104+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-position
105+
</xode-block>
90106
</xode-group>
91107

92108
## Reading backwards
@@ -106,6 +122,10 @@ As well as being able to read a stream forwards you can also go backwards. When
106122

107123
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#reading-backwards
108124
</xode-block>
125+
<xode-block title="Rust">
126+
127+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#reading-backwards
128+
</xode-block>
109129
</xode-group>
110130

111131
:::tip
@@ -130,4 +150,8 @@ It is important to check the value of this field before attempting to iterate an
130150

131151
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#checking-for-stream-presence
132152
</xode-block>
153+
<xode-block title="Rust">
154+
155+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#checking-for-stream-presence
156+
</xode-block>
133157
</xode-group>

Diff for: docs/clients/grpc/reading-events/reading-from-the-all-stream.md

+24
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ The simplest way to read the `$all` stream forwards is to supply a direction and
2020

2121
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-all-stream
2222
</xode-block>
23+
<xode-block title="Rust">
24+
25+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-all-stream
26+
</xode-block>
2327
</xode-group>
2428

2529
This will return an AsyncEnumerable that can be iterated on:
@@ -37,6 +41,10 @@ This will return an AsyncEnumerable that can be iterated on:
3741

3842
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-all-stream-iterate
3943
</xode-block>
44+
<xode-block title="Rust">
45+
46+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-all-stream-iterate
47+
</xode-block>
4048
</xode-group>
4149

4250
There are a number of additional arguments you can provide when reading a stream.
@@ -63,6 +71,10 @@ When using projections to create new events you can set whether the generated ev
6371

6472
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-all-stream-resolving-link-Tos
6573
</xode-block>
74+
<xode-block title="Rust">
75+
76+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-all-stream-resolving-link-Tos
77+
</xode-block>
6678
</xode-group>
6779

6880
### configureOperationOptions
@@ -85,6 +97,10 @@ The credentials used to read the data can be supplied. to be used by the subscri
8597

8698
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-all-overriding-user-credentials
8799
</xode-block>
100+
<xode-block title="Rust">
101+
102+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-all-overriding-user-credentials
103+
</xode-block>
88104
</xode-group>
89105

90106
## Reading backwards
@@ -104,6 +120,10 @@ As well as being able to read a stream forwards you can also go backwards. When
104120

105121
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#read-from-all-stream-backwards
106122
</xode-block>
123+
<xode-block title="Rust">
124+
125+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#read-from-all-stream-backwards
126+
</xode-block>
107127
</xode-group>
108128

109129
:::tip
@@ -129,4 +149,8 @@ All system events begin with `$` or `$$` and can be easily ignored by checking t
129149

130150
<<< @/docs/clients/java/generated/0.7/samples/reading_events/ReadingEvents.java#ignore-system-events
131151
</xode-block>
152+
<xode-block title="Rust">
153+
154+
<<< @/docs/clients/rust/generated/1.0.0/samples/reading_events.rust#ignore-system-events
155+
</xode-block>
132156
</xode-group>

Diff for: docs/clients/grpc/subscribing-to-streams/README.md

+44
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ The simplest stream subscription looks like the following :
2727

2828
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-stream
2929
</xode-block>
30+
<xode-block title="Rust">
31+
32+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-stream
33+
</xode-block>
3034
</xode-group>
3135

3236
The provided handler will be called for every event in the stream.
@@ -48,6 +52,10 @@ Subscribing to `$all` is much the same as subscribing to a single stream. The ha
4852

4953
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-all
5054
</xode-block>
55+
<xode-block title="Rust">
56+
57+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-all
58+
</xode-block>
5159
</xode-group>
5260

5361
## Subscribing from a specific position
@@ -81,6 +89,10 @@ The following subscribes to the stream `some-stream` at position `20`, this mean
8189

8290
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-stream-from-position
8391
</xode-block>
92+
<xode-block title="Rust">
93+
94+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-stream-from-position
95+
</xode-block>
8496
</xode-group>
8597

8698
### Subscribing to $all
@@ -104,6 +116,10 @@ Please note that this position will need to be a legitimate position in `$all`.
104116

105117
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-all-from-position
106118
</xode-block>
119+
<xode-block title="Rust">
120+
121+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-all-from-position
122+
</xode-block>
107123
</xode-group>
108124

109125
## Subscribing to a stream for live updates
@@ -123,6 +139,10 @@ You can subscribe to a stream to get live updates by subscribing to the end of t
123139

124140
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-stream-live
125141
</xode-block>
142+
<xode-block title="Rust">
143+
144+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-stream-live
145+
</xode-block>
126146
</xode-group>
127147

128148
And the same works with `$all` :
@@ -140,6 +160,10 @@ And the same works with `$all` :
140160

141161
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-all-live
142162
</xode-block>
163+
<xode-block title="Rust">
164+
165+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-all-live
166+
</xode-block>
143167
</xode-group>
144168

145169
This won't read through the history of the stream, but will rather notify the handler when a new event appears in the respective stream.
@@ -169,6 +193,10 @@ When reading a stream you can specify whether to resolve link-to's or not. By de
169193

170194
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-stream-resolving-linktos
171195
</xode-block>
196+
<xode-block title="Rust">
197+
198+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-stream-resolving-linktos
199+
</xode-block>
172200
</xode-group>
173201

174202
## Dropped subscriptions
@@ -206,6 +234,10 @@ An application, which hosts the subscription, can go offline for a period of tim
206234

207235
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-stream-subscription-dropped
208236
</xode-block>
237+
<xode-block title="Rust">
238+
239+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-stream-subscription-dropped
240+
</xode-block>
209241
</xode-group>
210242

211243
When subscribed to `$all` you want to keep the position of the event in the `$all` stream. As mentioned previously, the `$all` stream position consists of two big integers (prepare and commit positions), not one:
@@ -225,6 +257,10 @@ When subscribed to `$all` you want to keep the position of the event in the `$al
225257

226258
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#subscribe-to-all-subscription-dropped
227259
</xode-block>
260+
<xode-block title="Rust">
261+
262+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#subscribe-to-all-subscription-dropped
263+
</xode-block>
228264
</xode-group>
229265

230266
## Filter options
@@ -246,6 +282,10 @@ A simple stream prefix filter looks like this:
246282

247283
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#stream-prefix-filtered-subscription
248284
</xode-block>
285+
<xode-block title="Rust">
286+
287+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#stream-prefix-filtered-subscription
288+
</xode-block>
249289
</xode-group>
250290

251291
The filtering API is described more in-depth in the [filtering section](./filtering.md).
@@ -269,5 +309,9 @@ The code below shows how you can provide user credentials for a subscription. Wh
269309

270310
<<< @/docs/clients/java/generated/0.7/samples/subscribing_to_stream/SubscribingToStream.java#overriding-user-credentials
271311
</xode-block>
312+
<xode-block title="Rust">
313+
314+
<<< @/docs/clients/rust/generated/1.0.0/samples/subscribing_to_stream.rust#overriding-user-credentials
315+
</xode-block>
272316
</xode-group>
273317

0 commit comments

Comments
 (0)