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
feat: add tests and docs for configurable toolchain overrides (#89)
* `4.0.0.beta.3`
* clean up readme and `.gitignore`
* fix center align
* update readme
* add docs and clean up logic for toolchain override
* mv root toolchain file
Community-maintained package to support using [Rust](https://www.rust-lang.org/) inside [Vercel Functions](https://vercel.com/docs/serverless-functions/introduction) as a [Runtime](https://vercel.com/docs/runtimes).
10
16
17
+
</div>
18
+
11
19
## Legacy Runtime
12
20
13
21
The below documentation is for the `vercel_runtime` crate (in beta). If you are looking for the legacy runtime instructions using `vercel_lambda` see [tree/a9495a0](https://github.com/vercel-community/rust/tree/a9495a0f0d882a36ea165f1629fcc79c30bc3108).
@@ -59,7 +67,8 @@ Finally we need a `Cargo.toml` file at the root of your repository.
59
67
# --snip--
60
68
61
69
[dependencies]
62
-
# --snip--
70
+
tokio = { version = "1", features = ["macros"] }
71
+
serde_json = { version = "1", features = ["raw_value"] }
# Note that you need to provide unique names for dynamic paths
84
+
# Note that you need to provide unique names for each binary
76
85
[[bin]]
77
86
name = "user-id"
78
87
path = "api/user/[id].rs"
@@ -81,7 +90,6 @@ path = "api/user/[id].rs"
81
90
name = "group-id"
82
91
path = "api/group/[id].rs"
83
92
84
-
85
93
# --snip--
86
94
```
87
95
@@ -99,13 +107,12 @@ During local development with `vercel dev`, ensure `rust` and `cargo` are alread
99
107
100
108
## Contributing
101
109
102
-
Since this project contains both Rust and Node.js code, you need to install the relevant dependencies. If you're only working on the JavaScript side, you only need to install those dependencies (and vice-versa).
110
+
Since this project contains both Rust and Node.js code, you need to install the relevant dependencies. If you're only working on the TypeScript side, you only need to install those dependencies (and vice-versa).
103
111
104
112
```shell
105
113
# install node dependencies
106
114
pnpm install
107
115
108
-
109
116
# install cargo dependencies
110
117
cargo fetch
111
118
```
@@ -121,6 +128,13 @@ graph TD
121
128
122
129
## FAQ
123
130
131
+
<details>
132
+
<summary>How to specify toolchain overrides</summary>
133
+
134
+
An example on how this can be achieved is using a `rust-toolchain` file adjacent to your `Cargo.toml`. Please refer to [Rust Documentation](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) for more details.
0 commit comments