747d1a5b1b
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.
45 lines
1.4 KiB
TOML
45 lines
1.4 KiB
TOML
[package]
|
|
name = "wickra-data"
|
|
description = "Data sources for Wickra: CSV readers, tick-to-candle aggregator, and live exchange feeds."
|
|
version.workspace = true
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
readme.workspace = true
|
|
keywords.workspace = true
|
|
categories.workspace = true
|
|
documentation = "https://docs.rs/wickra-data"
|
|
|
|
# Render the docs on docs.rs with every feature enabled so the optional
|
|
# live-binance feed is documented (otherwise it is hidden behind its feature).
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
wickra-core = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
csv = "1.3"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# Async / live feeds are opt-in: only pulled when a `live-*` feature is requested.
|
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "net", "time", "io-util"], optional = true }
|
|
tokio-tungstenite = { version = "0.24", optional = true, features = ["native-tls"] }
|
|
futures-util = { version = "0.3", optional = true }
|
|
url = { version = "2", optional = true }
|
|
|
|
[features]
|
|
default = []
|
|
# Each exchange is gated so users only pay for the WS stack they actually want.
|
|
live-binance = ["dep:tokio", "dep:tokio-tungstenite", "dep:futures-util", "dep:url"]
|
|
|
|
[dev-dependencies]
|
|
approx = { workspace = true }
|
|
tempfile = "3"
|