examples: move Rust examples into a top-level examples/rust/ crate
The three Rust examples (backtest, fetch_btcusdt, live_binance) used to
live each in their own crate's examples/ dir, splitting the example set
across crates and burying it inside the source tree. Move them into a new
workspace member crate at `examples/rust/` (package `wickra-examples`,
`publish = false`) so all language examples sit under one top-level
`examples/<lang>/` tree.
* `examples/rust/Cargo.toml` declares the per-binary deps (wickra,
wickra-data with the `live-binance` feature always on, serde_json, tokio
for the macro and current-thread runtime).
* `examples/rust/src/bin/{backtest,fetch_btcusdt,live_binance}.rs` are the
three migrated binaries; their doc-comments and the fetch_btcusdt output
path are updated for the new location and run command
(`cargo run -p wickra-examples --bin <name>`).
* Workspace `Cargo.toml` lists the new member; the now-empty
`[dev-dependencies]` extras (`wickra`, `tokio` in wickra-data and
`serde_json` in wickra) that existed only for these examples are dropped.
* The `[[example]] live_binance` table is removed from wickra-data's
manifest since the file moved out.
* README "Languages" + project-layout, examples/README.md, Quickstart-Rust
and Data-Layer are pointed at the new paths and commands.
`cargo build -p wickra-examples` and `cargo run --release -p wickra-examples
--bin backtest -- examples/data/btcusdt-1d.csv` both succeed; the rest of
the workspace (core, data, wickra) builds, clippies (`--all-targets -D
warnings`) and tests (508 core + 28 data + 1 integration + 74+3+1
doctests) all stay green.
This commit is contained in:
@@ -150,10 +150,10 @@ dropped connection, skips non-kline frames (subscription acks, heartbeats),
|
||||
applies a read timeout and message-size limits, and tracks a closed flag so a
|
||||
deliberately closed stream is not reused.
|
||||
|
||||
A runnable example lives at `crates/wickra-data/examples/live_binance.rs`:
|
||||
A runnable example lives at `examples/rust/src/bin/live_binance.rs`:
|
||||
|
||||
```bash
|
||||
cargo run -p wickra-data --example live_binance --features live-binance
|
||||
cargo run -p wickra-examples --bin live_binance
|
||||
```
|
||||
|
||||
## Example datasets
|
||||
@@ -183,7 +183,7 @@ Binance REST API and needs the system `curl` (shipped with Windows 10+, macOS
|
||||
and Linux):
|
||||
|
||||
```bash
|
||||
cargo run -p wickra --example fetch_btcusdt
|
||||
cargo run -p wickra-examples --bin fetch_btcusdt
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
Reference in New Issue
Block a user