Certificate
Rust track certificate: pass criteria, project brief, and the rubric for a credible portfolio Rust submission.
Rust — certificate
EXAMPLE
# ===== Award criteria =====
# Pass: >= 70%; Distinction >= 85%.
#
# 1. Project structure (10)
# 2. Idiomatic Rust (15)
# 3. Ownership + borrowing (15)
# 4. Error handling (Result) (10)
# 5. Async (tokio / axum) (15)
# 6. Testing + benchmarks (15)
# 7. Build + deploy (10)
# 8. Communication (10)
# ===== Project brief =====
# Ship a small Rust app or service:
# - Web service with axum or actix (3+ endpoints)
# - SQL (sqlx) or NoSQL (mongodb crate)
# - Custom error type with thiserror; Result everywhere
# - tokio-based async + structured concurrency
# - Tests with cargo test; integration tests using a real DB or testcontainers
# - Cargo clippy + rustfmt in CI
# - Cross-compile to a static musl binary; multi-stage Docker
# - README + ARCHITECTURE doc
# Ideas: URL shortener, key-value store, MQTT bridge, image resizer,
# small load balancer / proxy, OAuth server.
# ===== Sample structure =====
# myapp/
# src/
# main.rs
# lib.rs (most code; main is thin)
# api/ handlers
# domain/ business logic
# storage/ db
# error.rs custom error
# config.rs
# tests/
# integration.rs
# Cargo.toml
# Dockerfile
# README.md
# Cargo.toml
[package]
name = "myapp"
edition = "2021"
rust-version = "1.78"
[dependencies]
tokio = { version = "1", features = ["full"] }
axum = "0.7"
serde = { version = "1", features = ["derive"] }
sqlx = { version = "0.7", features = ["postgres", "runtime-tokio"] }
thiserror = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
[dev-dependencies]
testcontainers = "0.15"
proptest = "1"
# ===== Marking sheet (example) =====
# 1. Structure 9/10 lib + main, modules per concern
# 2. Idiomatic 13/15 clippy clean, small types
# 3. Ownership 14/15 borrow over clone, &str over String in fns
# 4. Errors 10/10 thiserror enum, ? everywhere
# 5. Async 13/15 select! + bounded channels, no spawn-and-forget
# 6. Testing 13/15 table-driven + property tests
# 7. Deploy 10/10 static musl binary, distroless, < 5 MB image
# 8. Communication 9/10 README, ADRs, runbooks
# Total: 91/100 -> Distinction
# ===== Idiomatic checklist =====
# - clippy --all-targets -D warnings green
# - Result<T, MyError> on all fallible APIs; thiserror for the enum
# - tokio::spawn for tasks; structured cancellation via CancellationToken
# - &str / &[T] in signatures; own T only when you keep it
# - tracing for logs + spans
# ===== Patterns to internalise =====
# - cargo workspace if you have > 1 crate
# - cargo machete to find unused deps
# - cargo deny for license + advisory checks
# - axum with Tower middleware for HTTP services
# ===== Pitfalls =====
# - unwrap() everywhere -> defeats Result
# - Cloning to dodge borrows -> hidden allocations
# - panic! in libraries
# - Async without bounded concurrency -> resource starvation
Why it matters
The Rust certificate ships a working async service: idiomatic, well-tested, statically compiled, dockerised. Hit the rubric and you have a strong portfolio piece plus confidence in async Rust, custom errors, sqlx, and Tower middleware. Most of the rubric is "did you follow the conventions" — easy to verify, easy to ship.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Discussion
Loading…