Simplify boilerplate for learning: drop real protocol code, minimal main.rs

Removed adapters/ (rumqttc MQTT, suppaftp FTPS, reqwest HTTP), plate_changer/
(tokio-serial), discovery/, and cache.rs (rusqlite) — src/printer/ already
covers 'talk to a printer' as simple stubs, so keeping a second, more complex
version alongside it was redundant. main.rs goes from 6 concurrent tasks to
2 (uplink + go2rtc). uplink/ drops channels, jitter, and Send-bound futures.

Verified with cargo build + cargo run --example printer_polymorphism.
This commit is contained in:
2026-08-28 18:22:38 +00:00
parent 5705f36c01
commit d0a17ee50e
16 changed files with 80 additions and 799 deletions
+3 -18
View File
@@ -20,30 +20,15 @@ path = "examples/printer_polymorphism.rs"
[dependencies]
tokio = { version = "1.40", features = ["full"] }
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
tokio-util = { version = "0.7", features = ["codec", "compat"] }
futures-util = "0.3"
rumqttc = "0.24"
reqwest = { version = "0.12", features = ["stream", "json"] }
suppaftp = { version = "6", features = ["async-native-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rusqlite = { version = "0.32", features = ["bundled"] }
tokio-serial = "5.4"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
anyhow = "1"
thiserror = "1"
uuid = { version = "1", features = ["v4", "serde"] }
rand = "0.8"
dotenvy = "0.15"
# continuum-common's rust-core crate (error types, tracing init, G-code helpers)
# lives in the sibling `continuum-common` repo. Once that crate is published to
# a registry or exposed over git, add it here, e.g.:
# continuum-common = { git = "https://git.octoturge.com/Continuum/continuum-common.git", package = "continuum-core" }
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
# Real printer protocol clients (MQTT for Bambu, HTTP for PrusaLink/
# Moonraker, FTPS for gcode transfer) go here once you're ready to build
# past the stubs in src/printer/ — see that module's doc comment.