Files
wickra/examples/rust/Cargo.toml
T
kingchenc 747d1a5b1b 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.
2026-05-23 00:07:07 +02:00

29 lines
991 B
TOML

[package]
name = "wickra-examples"
version = "0.0.0"
publish = false
description = "Runnable Rust examples for the Wickra technical-analysis library."
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme = "README.md"
[lints]
workspace = true
[dependencies]
# All examples sit on top of the indicator engine.
wickra = { path = "../../crates/wickra" }
# The data layer is needed by every example except streaming/parallel: CSV
# reading, the Binance live feed and the resampler all live here. The
# `live-binance` feature is always on for this crate so the live_binance
# binary just compiles.
wickra-data = { path = "../../crates/wickra-data", features = ["live-binance"] }
# fetch_btcusdt parses the Binance REST kline response.
serde_json = "1"
# live_binance uses #[tokio::main]; the current-thread runtime is enough.
tokio = { version = "1", features = ["rt", "macros"] }