Skip to content

Commit 48e25d3

Browse files
Merge branch 'main' into connector-api2
2 parents 4d190ab + 2ac5ce6 commit 48e25d3

File tree

187 files changed

+11917
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+11917
-661
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,14 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8-
# ignore:
9-
# - dependency-name: ""
8+
reviewers:
9+
- "SirCipher"
10+
- "horned-sphere"
11+
- package-ecosystem: "npm"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"
15+
open-pull-requests-limit: 0
16+
reviewers:
17+
- "SirCipher"
18+
- "horned-sphere"

.github/workflows/ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
name: Continuous integration
77
env:
8-
latest_version: "1.79.0"
8+
latest_version: "1.80.0"
99

1010
jobs:
1111
test:
@@ -142,3 +142,19 @@ jobs:
142142
with:
143143
token: ${{ secrets.CODECOV_TOKEN }}
144144
fail_ci_if_error: true
145+
146+
build_uis:
147+
name: Build Example Application UIs
148+
runs-on: ubuntu-latest
149+
strategy:
150+
matrix:
151+
include:
152+
- path: "stocks_simulated/ui"
153+
cmd: "npm install && npm run build"
154+
steps:
155+
- name: Checkout repository
156+
uses: actions/checkout@v2
157+
- name: Build UI
158+
run: |
159+
cd ${PWD}/example_apps/${{ matrix.path }}/
160+
${{ matrix.cmd }}

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ members = [
4040
"example_apps/join_value",
4141
"example_apps/aggregations",
4242
"example_apps/time_series",
43-
"example_apps/devguide/2_2/*",
44-
"example_apps/devguide/2_3/*",
43+
"example_apps/devguide",
44+
"example_apps/ripple",
45+
"example_apps/stocks_simulated",
4546
]
4647

4748
[workspace.package]
@@ -144,7 +145,7 @@ webpki = "0.22"
144145
webpki-roots = "0.26.3"
145146
tokio-rustls = "0.26"
146147
rustls-pemfile = "2.1.2"
147-
trust-dns-resolver = "0.23.2"
148+
hickory-resolver = "0.24.1"
148149
clap = "4.1"
149150
crossbeam-queue = { version = "0.3" }
150151
crossbeam-channel = { version = "0.5" }
@@ -163,7 +164,7 @@ regex = "1.3.6"
163164
fnv = "1.0.7"
164165
cursive = { default-features = false, version = "0.20" }
165166
duration-str = "0.11.2"
166-
quick-xml = "0.34.0"
167+
quick-xml = "0.36.0"
167168
csv = "1.2"
168169
serde-xml-rs = "0.6"
169170
axum = "0.7.5"

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![Build Status](https://dev.azure.com/swimai-build/swim-rust/_apis/build/status/swimos.swim-rust?branchName=main)](https://dev.azure.com/swimai-build/swim-rust/_build/latest?definitionId=1&branchName=main)
2-
[![codecov](https://codecov.io/gh/swimos/swim-rust/branch/main/graph/badge.svg?token=IVWBLXCGW8)](https://codecov.io/gh/swimos/swim-rust)
31
<a href="https://www.swimos.org"><img src="https://docs.swimos.org/readme/marlin-blue.svg" align="left"></a>
42
<br><br><br><br>
53

@@ -19,18 +17,43 @@ will also allow the subscriber to request changes to the state (for lane kinds t
1917
operate over a web-socket connection and are multiplexed, meaning that links to multiple lanes on the same
2018
host can share a single web-socket connection.
2119

20+
[![SwimOS Crates.io Version][swimos-badge]][swimos-crate]
21+
[![SwimOS Client Crates.io Version][swimos-client-badge]][swimos-client-crate]
22+
[![SwimOS Form Crates.io Version][swimos-form-badge]][swimos-form-crate]
23+
24+
[swimos-badge]: https://img.shields.io/crates/v/swimos?label=swimos
25+
26+
[swimos-crate]: https://crates.io/crates/swimos
27+
28+
[swimos-form-badge]: https://img.shields.io/crates/v/swimos?label=swimos_form
29+
30+
[swimos-form-crate]: https://crates.io/crates/swimos_form
31+
32+
[swimos-client-badge]: https://img.shields.io/crates/v/swimos?label=swimos_client
33+
34+
[swimos-client-crate]: https://crates.io/crates/swimos_client
35+
36+
[Website](https://swimos.org/) | [Developer Guide](https://www.swimos.org/server/rust/developer-guide/) | [Server API Docs](https://docs.rs/swimos/latest/swimos/) | [Client API Docs](https://docs.rs/swimos_client/latest/swimos_client/)
37+
2238
## Usage Guides
2339

2440
[Implementing Swim Agents in Rust](docs/agent.md)
2541

2642
[Building a Swim Server Application](docs/server.md)
2743

44+
[Reference Documentation](https://www.swimos.org/server/rust/)
45+
2846
## Examples
2947

3048
The following example application runs a SwimOS server that hosts a single agent route where each agent instance
3149
has single lane, called `lane`. Each time a changes is made to the lane, it will be printed on the console by the
3250
server.
3351

52+
```toml
53+
[dependencies]
54+
swimos = { version = "0.1.0", features = ["server", "agent"] }
55+
```
56+
3457
```rust
3558
use swimos::{
3659
agent::{
@@ -46,7 +69,6 @@ use swimos::{
4669

4770
#[tokio::main]
4871
pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
49-
5072
// An agent route consists of the agent definition and a lifecycle.
5173
let model = AgentModel::new(ExampleAgent::default, ExampleLifecycle.into_lifecycle());
5274

@@ -80,7 +102,6 @@ struct ExampleLifecycle;
80102
// annotated event handlers methods in the block.
81103
#[lifecycle(ExampleAgent)]
82104
impl ExampleLifecycle {
83-
84105
#[on_event(lane)]
85106
fn lane_event(
86107
&self,
@@ -94,18 +115,24 @@ impl ExampleLifecycle {
94115
})
95116
})
96117
}
97-
98118
}
99119
```
100120

101-
For example, if a Swim client sends an update, with the value `5`, to the agent at the URI `/examples/name` for the
102-
lane `lane`, an instance of `ExampleAgent`, using `ExampleLifecycle`, will be started by the server. The value of the
121+
For example, if a Swim client sends an update, with the value `5`, to the agent at the URI `/examples/name` for the
122+
lane `lane`, an instance of `ExampleAgent`, using `ExampleLifecycle`, will be started by the server. The value of the
103123
lane will then be set to `5` and the following will be printed on the console:
104124

105125
```
106126
Received value: 5 for 'lane' on agent at URI: /examples/name.
107127
```
108128

129+
A number of example applications are available in the [example_apps](example_apps) directory which demonstrate
130+
individual features as well as more comprehensive applications.
131+
109132
## Development
110133

111-
See the [development guide](DEVELOPMENT.md).
134+
See the [development guide](DEVELOPMENT.md).
135+
136+
## License
137+
138+
This project is licensed under the [Apache 2.0 License](LICENSE).

api/formats/swimos_msgpack/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
//! Provides a MessagesPack backend for the Swim serialization system. This consists of two parts:
1818
//!
1919
//! - A function [`read_from_msg_pack`] that will attempt to deserialize any type that implements
20-
//! [`swimos_form::read::StructuralReadable`] from a buffer containing MessagePack data.
20+
//! [`swimos_form::read::StructuralReadable`] from a buffer containing MessagePack data.
2121
//! - The type [`MsgPackInterpreter`] that implements [`swimos_form::write::StructuralWriter`]
22-
//! allowing any type that implements [`swimos_form::write::StructuralWritable`] to be
23-
//! serialized as MessagePack.
22+
//! allowing any type that implements [`swimos_form::write::StructuralWritable`] to be
23+
//! serialized as MessagePack.
2424
//!
2525
//! # Examples
2626
//!

api/formats/swimos_msgpack/src/writer/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ mod tests;
4242
/// MessagePack string and bin values. Records have the following encoding.
4343
///
4444
/// - Attributes are written as MessagePack map where the keys are strings. If there are no
45-
/// attributes an empty map value is still required.
45+
/// attributes an empty map value is still required.
4646
/// - The items in the body follow the attributes immediately. If the body consists entirely of
47-
/// slots it is written as a map. If the body consists of all value items or a mix of value items
48-
/// and slots it is written as an array. When a slot occurs in an array body it is written as
49-
/// an array of size two.
47+
/// slots it is written as a map. If the body consists of all value items or a mix of value items
48+
/// and slots it is written as an array. When a slot occurs in an array body it is written as
49+
/// an array of size two.
5050
///
5151
/// # Type Parameters
5252
///

api/formats/swimos_recon/src/comparator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2022 Swim Inc.
1+
// Copyright 2015-2024 Swim Inc.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

api/formats/swimos_recon/src/comparator/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2022 Swim Inc.
1+
// Copyright 2015-2024 Swim Inc.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

api/formats/swimos_recon/src/hasher/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2022 Swim Inc.
1+
// Copyright 2015-2024 Swim Inc.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

api/formats/swimos_recon/src/hasher/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2022 Swim Inc.
1+
// Copyright 2015-2024 Swim Inc.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)