Skip to content
ImagineWorld

Where to Go from Here

node_idnode-book_oop-to-rust_chapter-25-where-to-go-from-here
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num25
chapter_titleWhere to Go from Here
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Non scholae sed vitae discimus. (We learn not for school, but for life.)

The journey from object-oriented programming to Rust involves more than learning new syntax. It requires adopting different mental models for memory, concurrency, and abstraction. The preceding chapters have covered these foundations: ownership and borrowing, traits as composition mechanisms, error handling through types, and concurrency without data races. With these concepts internalized, the question becomes practical: what do you build with this knowledge, and where do you deepen it?

Rust’s ecosystem has matured rapidly. Domains that once required extensive boilerplate or unsafe code now have well-maintained libraries with ergonomic APIs. The challenge is no longer whether Rust can handle a particular domain but which of several capable libraries best fits the project’s needs. This chapter surveys the major application domains, highlights foundational crates, and suggests paths for continued learning.

Domain-specific directions

Rust serves remarkably diverse purposes. The same language that powers web backends runs on microcontrollers with 32 kilobytes of RAM. This versatility stems from Rust’s zero-cost abstractions and control over memory layout. Different domains emphasize different aspects of the language, and developers often find that focusing on a specific domain accelerates their Rust proficiency.

Web development

Web development in Rust splits between backend services and frontend applications compiled to WebAssembly. The backend story is more mature, with production-grade frameworks handling substantial traffic at companies like Cloudflare, Discord, and Dropbox.

Actix Web and Axum represent the two dominant approaches to web frameworks. Actix Web, built on the Actix actor framework, offers high performance and a comprehensive feature set. Its macro-based routing and middleware system will feel familiar to developers coming from frameworks like ASP.NET or Spring Boot. Axum, developed by the Tokio team, takes a different approach: it builds on the Tower middleware ecosystem and uses Rust’s type system for routing and extraction. Functions become handlers through trait implementations rather than macros. The choice between them often comes down to preference: Actix Web for its maturity and documentation, Axum for its composability and type-driven design.

Database access in Rust ranges from raw SQL to full ORMs. SQLx provides compile-time checked queries against actual databases, catching SQL errors before runtime. Diesel offers a query builder with strong typing, generating SQL through Rust method chains. SeaORM provides an async-first ORM experience closer to Entity Framework or Hibernate. For simpler needs, the database driver crates (tokio-postgres, mysql_async, rusqlite) offer direct access without abstraction layers.

Frontend Rust through WebAssembly enables writing browser applications in Rust. Frameworks like Leptos, Dioxus, and Yew provide component models reminiscent of React. The trade-offs differ from JavaScript frameworks: larger initial bundle sizes but faster execution, stronger typing but more complex build pipelines. This space evolves quickly, with approaches ranging from full Rust frontends to targeted WebAssembly modules for performance-critical code paths.

Command-line applications

Rust excels at command-line tools. Fast startup, single-binary distribution, and cross-platform compilation make it ideal for utilities that users invoke repeatedly. Many Rust developers start here because the domain’s requirements align with Rust’s strengths without requiring deep ecosystem knowledge.

clap handles argument parsing with either derive macros or a builder API. The derive approach annotates a struct with command-line metadata; the library parses arguments into that struct automatically.

For simpler tools, the lighter-weight argh crate provides similar derive-based parsing with minimal dependencies.

Terminal user interfaces use libraries like Ratatui (a maintained fork of tui-rs) for full-screen applications with widgets, or crossterm and termion for lower-level terminal control. These enable building interactive tools like htop-style monitors, text editors, or menu-driven installers. The immediate-mode rendering model differs from retained GUI frameworks, requiring a shift in how applications structure their display logic.

File system operations, typically fraught with platform-specific edge cases, benefit from crates like walkdir for directory traversal and notify for file system watching. These handle the platform differences that would otherwise require conditional compilation.

Embedded systems

Embedded development showcases Rust’s no-runtime, no-garbage-collection design. The language runs on microcontrollers where every byte matters and dynamic allocation may be impossible. This domain requires understanding concepts like no_std (operating without the standard library) and working directly with hardware registers.

The embedded ecosystem organizes around hardware abstraction layers. The embedded-hal crate defines traits for common peripherals: GPIO pins, SPI buses, I2C controllers, timers. Device-specific crates implement these traits for particular microcontrollers. Application code written against embedded-hal traits can run on different hardware with minimal changes, a portability story that C embedded development struggles to match.

Platform-specific HALs exist for popular chip families: stm32f4xx-hal for STM32F4 microcontrollers, nrf52840-hal for Nordic Semiconductor chips, esp-hal for Espressif’s ESP32 family. The probe-rs tool handles flashing and debugging, while defmt provides efficient logging that minimizes the binary size impact typical of string formatting.

Real-time operating systems in Rust include RTIC (Real-Time Interrupt-driven Concurrency), which uses Rust’s type system to guarantee deadlock-free interrupt handling at compile time. Embassy provides an async runtime designed for embedded systems, bringing async/await to microcontrollers. These frameworks demonstrate how Rust’s compile-time guarantees translate into safety properties that traditional embedded C achieves only through careful discipline.

GUI applications

Native GUI development in Rust remains challenging. The domain’s inherent complexity (cross-platform abstractions, accessibility, internationalization) combines with Rust’s ownership rules to create friction around the mutable, interconnected object graphs that GUI toolkits traditionally use. Despite these challenges, several viable approaches exist.

Tauri builds desktop applications using web technologies for the UI while Rust handles the backend logic. Applications ship with the system’s webview rather than bundling Chromium, resulting in smaller binaries than Electron. The model suits developers comfortable with web frontends who want Rust’s performance and safety for business logic.

Native GUI options include egui for immediate-mode interfaces (where the application redraws the entire UI each frame), iced for Elm-inspired declarative UIs, and Slint for a QML-like declarative language with Rust bindings. GTK and Qt bindings exist but require navigating the impedance mismatch between those frameworks’ C/C++ object models and Rust’s ownership system.

Game development overlaps with GUI concerns. The Bevy engine provides an entity-component-system architecture well-suited to Rust, while lower-level libraries like wgpu (for GPU access) and winit (for windowing) enable building custom engines. This domain attracts Rust developers because games benefit from predictable performance without garbage collection pauses.

Systems programming and infrastructure

Systems programming represents Rust’s original target domain. Operating system components, file systems, databases, and network infrastructure all benefit from memory safety without runtime overhead.

Tokio dominates async networking, providing the runtime that powers most Rust network services. Its ecosystem includes tower for middleware composition, hyper for HTTP, and tonic for gRPC. For synchronous networking or when async overhead matters, the standard library’s networking primitives suffice for simpler cases, while mio provides a cross-platform event loop.

Database implementation uses crates like rocksdb bindings for embedded key-value storage, or pure-Rust implementations like sled. The serde ecosystem handles serialization with support for JSON, MessagePack, CBOR, and dozens of other formats through a unified trait interface.

Cryptography crates range from bindings to established C libraries (openssl, ring) to pure-Rust implementations (RustCrypto project). The choice between binding and native implementation involves trade-offs between audit history, performance, and compilation simplicity.

Data processing and scientific computing

Data-intensive applications benefit from Rust’s predictable performance and memory efficiency. While Python remains dominant in data science for its ecosystem and ease of use, Rust increasingly handles the performance-critical layers beneath Python interfaces.

Polars provides a DataFrame library designed from the ground up for performance, often outperforming pandas by significant margins. It can be used directly from Rust or through Python bindings, enabling gradual adoption. For numerical computing, ndarray offers n-dimensional array operations similar to NumPy, though the ecosystem of scientific libraries built atop it remains smaller than Python’s.

Machine learning in Rust ranges from bindings to established frameworks (tch for PyTorch, tensorflow) to native implementations (burn, candle). The native frameworks target inference workloads where deployment simplicity and performance matter more than training flexibility. Running ML models without Python interpreters simplifies deployment in embedded systems, serverless functions, and edge devices.

The ecosystem: key crates

Certain crates appear across domains, forming the foundation of most Rust projects. Learning these well pays dividends regardless of application type.

Serde provides serialization and deserialization through derive macros. A struct annotated with #[derive(Serialize, Deserialize)] can convert to JSON, YAML, TOML, or any format with a serde implementation. The design separates data format from data structure, allowing the same types to serialize to different formats without modification. In my experience, serde appears in nearly every non-trivial Rust project. Its design patterns (visitor traits, derive macros, attribute configuration) recur throughout the ecosystem.

Tokio provides the dominant async runtime. Beyond the runtime itself, the tokio crate includes async versions of standard library primitives: channels, mutexes, file I/O, timers. Understanding Tokio’s task model and spawn semantics is essential for async Rust development.

Tracing offers structured logging and diagnostics. Unlike traditional logging that produces text lines, tracing captures structured data with spans representing operations. This enables filtering by field values, correlating related events, and exporting to observability platforms. The ecosystem includes subscribers for various output formats and backends.

Anyhow and thiserror address error handling ergonomics. Anyhow provides a convenient error type for applications where error types need not be precise, supporting context chaining and backtraces. Thiserror generates error type boilerplate through derive macros, useful for libraries that need well-defined error hierarchies. Many projects use thiserror for library code and anyhow for application code.

Rayon enables data parallelism through parallel iterators. Converting a sequential iterator to a parallel one often requires changing only the import. The library handles work stealing and thread pool management transparently. For CPU-bound work that processes collections, rayon provides parallelism with minimal code changes.

Regex provides regular expression matching with consistent performance guarantees. Unlike regex engines in some languages, Rust’s regex crate guarantees linear-time matching, preventing the denial-of-service vulnerabilities that exponential backtracking can cause.

Chrono and time handle date and time operations. Chrono is more established with broader feature coverage; time is a more recent alternative that avoids some of Chrono’s design decisions. Both handle time zones, parsing, formatting, and arithmetic.

The following diagram shows how foundational crates relate to application domains:

graph TD
    subgraph EM["Embedded"]
        EH["embedded-hal"]
        RT["RTIC"]
    end
    subgraph FC["Foundational Crates"]
        TK["tokio"]
        SD["serde"]
        TR["tracing"]
        AT["anyhow/thiserror"]
    end
    subgraph WB["Web"]
        AX["axum"]
        AW["actix-web"]
        SQ["sqlx"]
    end
    subgraph CL["CLI"]
        CP["clap"]
        RA["ratatui"]
    end
    TK --> WB
    SD --> WB
    TR --> WB
    AT --> WB
    SD --> CL
    TR --> CL
    AT --> CL

[!visual-conversion] Foundational crates support multiple application domains. Print diagram (PDF 622, printed p. 614) recreated in Mermaid; frames, crate labels and the seven crate→domain arrows transcribed as printed (Embedded has no incoming arrow in print).

The official Rust documentation remains the authoritative starting point. “The Rust Programming Language” (known as “the book”) covers the language comprehensively. “Rust by Example” provides interactive code samples for each concept. The standard library documentation, accessible through doc.rust-lang.org, includes extensive examples and cross-references.

For deeper understanding, “Programming Rust” by Blandy, Orendorff, and Tindall offers thorough coverage with attention to systems programming concerns. “Rust for Rustaceans” by Gjengset targets intermediate developers, exploring the nuances that distinguish competent Rust from idiomatic Rust. Jon Gjengset’s

YouTube channel provides long-form coding sessions implementing real systems, valuable for seeing how experienced developers approach problems.

Async Rust deserves dedicated study. The “Async Book” (async-std’s documentation) explains the mental model. Tokio’s documentation includes tutorials progressing from basics to advanced patterns. Understanding futures, pinning, and executor design helps debug the confusing errors that async code sometimes produces.

The Rust community gathers in several places. The official Discord server and users.rust-lang.org forum provide help for specific questions. The “This Week in Rust” newsletter summarizes ecosystem developments. Reading RFCs (Request for Comments) for language features reveals the reasoning behind design decisions, valuable context for understanding why Rust works as it does.

Contributing to open source accelerates learning. Many crates label issues as “good first issue” for newcomers. Even documentation improvements require understanding the code well enough to explain it. The process of having code reviewed by maintainers provides feedback unavailable from solo study.

For OOP developers specifically, pay attention to how Rust codebases solve problems that inheritance would handle in other languages. Study how popular crates like serde achieve extensibility through traits. Notice how error handling flows through large applications. The patterns that feel awkward initially become natural through exposure to well-designed Rust code.

Building proficiency

Reading about Rust differs from writing Rust. The compiler’s error messages, initially overwhelming, become a learning tool. Each error indicates a concept to understand more deeply. The borrow checker’s rejections reveal implicit assumptions about memory and ownership that other languages let slide.

Start with small projects. Command-line tools, data processors, simple web services. Complete projects teach more than partial explorations of large codebases. The full cycle of design, implementation, testing, and deployment exposes corners of the language that tutorials skip.

Refactor aggressively. Take working code and improve it. Extract functions, introduce traits, simplify error handling. The compiler catches regressions immediately, making refactoring safer than in languages where changes might silently break behavior. This safety enables learning through experimentation.

Performance work teaches low-level concepts. Profile code with tools like perf or cargo-flamegraph. Understand where allocations happen. See how iterator chains compile to tight loops. The performance story connects Rust’s abstractions to machine reality in ways that garbage-collected languages obscure.

Contribute to documentation. Explaining concepts to others requires understanding them fully. Even clarifying a confusing error message in a project’s documentation helps others and deepens your own comprehension.

Rewrite something familiar. Take a tool or library from your OOP background and implement it in Rust. The comparison illuminates both what changes and what remains constant. A dependency injection container becomes unnecessary when dependencies are explicit parameters. A factory pattern simplifies when structs have no inheritance hierarchy. An observer pattern transforms when channels replace callbacks. These rewrites build intuition for Rust idioms faster than greenfield projects.

Read other people’s code. Popular crates on crates.io undergo scrutiny from many developers. Their patterns, while not always perfect, represent tested approaches to common problems. The standard library source code, though sometimes complex, demonstrates idiomatic Rust at its best. Reading code with the question “why did they do it this way?” develops judgment that reading tutorials cannot provide.

What this book did not cover

This book deliberately omits certain advanced topics. Pinning and its interaction with self-referential structures, higher-rank trait bounds, and the intricacies of variance receive no treatment here. These topics matter for library authors and for understanding the deepest layers of async machinery, but they do not prevent the transition from object-oriented thinking to Rust. A developer can write substantial, production-quality Rust without mastering them, returning to study these corners when specific needs arise.

Even the topics this book does cover, from async programming to synchronization primitives, barely scratch the surface. Async Rust alone could fill a dedicated volume exploring executor design, structured concurrency patterns, and the subtleties of cancellation. Lock-free data structures, memory ordering, and the guarantees provided by different atomic operations constitute another book’s worth of material. Each domain surveyed in this chapter has its own ecosystem deep enough to sustain years of specialization.

The goal was never exhaustive coverage. It was to provide enough conceptual foundation that the reader can navigate the rest independently. Understanding ownership and borrowing, recognizing when traits replace inheritance, knowing how error handling flows through a codebase: these fundamentals enable reading documentation, understanding library designs, and diagnosing compiler errors. The specifics of any domain or advanced feature become learnable once the mental model is in place.

At this point, you have enough knowledge to make an informed decision. You understand what Rust offers and what it demands. The ownership system, the borrow checker, the trait-based composition: these are no longer abstract concepts but tools you have seen applied to real problems. Whether Rust fits your projects, your team, and your goals is now a question you can answer from experience rather than speculation. The path forward, whatever direction it takes, begins with that clarity.

Paths Forward

Rust serves diverse domains: web services with Axum or Actix Web, command-line tools with Clap, embedded systems with embedded-hal, native GUIs with various frameworks, and systems infrastructure with Tokio.

Foundational crates recur across domains: serde for serialization, Tokio for async, tracing for diagnostics, anyhow and thiserror for error handling, rayon for parallelism.

Official documentation provides the starting point, supplemented by books like “Programming Rust” and “Rust for Rustaceans.” Community resources include Discord, forums, and the weekly newsletter. Open source contribution offers feedback unavailable from solo study.

Proficiency comes from completed projects, aggressive refactoring, and attention to the compiler’s messages. The transition from OOP to Rust is not merely learning new syntax but adopting different mental models. Those models, once internalized, enable writing software that is safe, fast, and maintainable in ways that traditional object-oriented languages struggle to guarantee.

Thank you for reading this far. The journey from object-oriented programming to Rust is not a small undertaking, and completing it demonstrates genuine commitment to the craft. Whatever you build next, whether it is a command-line tool, a web service, an embedded system, or something entirely different, I hope the concepts explored here serve you well. Rust rewards patience and curiosity. May your compilations be swift, your lifetimes unambiguous, and your programs free of data races.