A small rust template with workspace & logging setup.
./Cargo.toml
values are reused across crates/
.
More about workspace configuration here.
crates/bin-client
- logs with log and pretty_env_logger
crates/bin-server
crates/domain
TODO
- cargo-nextest
- clippy
- cargo-outdated
- cargo-audit
- ignores modifications other than
crates/ & Cargo.toml & Cargo.lock
make all
# or
cargo fmt
cargo test
cargo build --release --bin server
cargo build --release --bin client
./target/release/server
RUST_LOG=TRACE ./target/release/client
# or run with:
cargo run --bin server
RUST_LOG=TRACE cargo run --bin client
We get:
- logs from
log
-
domain: guessing: x...
-
- logs & instrumentation from
tracing
-
function{x=4}
-
- concise logging for the client
-
TRACE client > trace
-
https://github.com/rust-unofficial/awesome-rust
- https://github.com/clap-rs/clap A full featured, fast Command Line Argument Parser for Rust
- https://github.com/mikaelmello/inquire A Rust library for building interactive prompts
- https://github.com/SeaQL/sea-orm An async & dynamic ORM for Rust
- https://github.com/launchbadge/sqlx The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL.
- https://github.com/chronotope/chrono Date and time library for Rust
- https://github.com/dylanhart/ulid-rs Universally Unique Lexicographically Sortable Identifiers
- https://github.com/serde-rs/serde Serialization framework for Rust
- https://github.com/serde-rs/json Strongly typed JSON library for Rust
- https://github.com/tokio-rs/prost PROST! a Protocol Buffers implementation for the Rust Language
- https://github.com/seanmonstar/reqwest An easy and powerful Rust HTTP Client
- https://github.com/yewstack/yew Rust / Wasm framework for building client web apps
- https://github.com/tokio-rs/axum Ergonomic and modular web framework built with Tokio, Tower, and Hyper
- https://github.com/hyperium/tonic A native gRPC client & server implementation with async/await support.