<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>Rust Trends</title>
      <link>https://rust-trends.com</link>
      <description>The premier Rust programming newsletter covering trends, tutorials, and ecosystem updates. Stay current with Rust development.</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://rust-trends.com/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Sun, 01 Mar 2026 00:00:00 +0000</lastBuildDate>
      <item>
          <title>76 - Rust Crosses the Chasm</title>
          <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-crosses-the-chasm/</link>
          <guid>https://rust-trends.com/newsletter/rust-crosses-the-chasm/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-crosses-the-chasm/">&lt;p&gt;Rust has been the language of choice for early adopters for years. This week the evidence suggests it is becoming the language of choice for pragmatists too.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue: Ubuntu naming Rust the language for new foundational system software, a production post-mortem that achieved a 78× speedup by redesigning data layout, and SurrealDB 3.0 shipping as a purpose-built store for AI agent memory.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s dive in.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;ubuntu-names-rust-its-language-for-new-foundational-work&quot;&gt;Ubuntu Names Rust Its Language for New Foundational Work&lt;&#x2F;h1&gt;
&lt;p&gt;Niko Matsakis wrote a &lt;a href=&quot;https:&#x2F;&#x2F;smallcultfollowing.com&#x2F;babysteps&#x2F;blog&#x2F;2026&#x2F;02&#x2F;23&#x2F;ubuntu-rustnation&#x2F;&quot; target=&quot;_blank&quot;&gt;post-Rust Nation UK reflection&lt;&#x2F;a&gt; framing what it means that Ubuntu is now using Rust. His framing is worth taking seriously because he uses it to make a point about what mainstream adoption actually requires, and where Rust still has work to do.&lt;&#x2F;p&gt;
&lt;p&gt;The concrete Ubuntu details: Canonical sponsors the Trifecta Tech Foundation&#x27;s development of sudo-rs and ntpd-rs, and supports the uutils coreutils project. Ubuntu has named Rust, alongside Python, C&#x2F;C++, and Go, as a primary language for new development, and specifically as the language of choice for new foundational efforts replacing C and C++.&lt;&#x2F;p&gt;
&lt;p&gt;Niko frames this through Geoffrey Moore&#x27;s technology adoption lifecycle. Rust has crossed the chasm in some domains, most visibly in data plane infrastructure within companies like Amazon, but it remains nascent in others, including safety-critical software. Ubuntu represents a mainstream adopter, a pragmatic organization choosing Rust not because it is exciting but because it is the best available option for the problem. That is a different and more durable kind of adoption than enthusiast-driven use.&lt;&#x2F;p&gt;
&lt;p&gt;The harder point he makes: &quot;we need to make Rust the best option not just in terms of what it could be but in terms of what it actually is.&quot; Pragmatists do not bet on potential. They need tooling, documentation, hiring pools, and library coverage that works today. That is a challenge the Rust community still needs to meet deliberately.&lt;&#x2F;p&gt;
&lt;p&gt;The Ubuntu signal matters because Canonical is a risk-averse organization with a long institutional memory. When they standardize on a language for system-level infrastructure, they expect to live with that choice for a decade. Rust is now that choice for new work.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Ubuntu replacing C and C++ with Rust for new foundational tooling, including sudo-rs, ntpd-rs, and uutils coreutils, is mainstream adoption in the most literal sense&lt;&#x2F;li&gt;
&lt;li&gt;Niko&#x27;s &quot;crossing the chasm&quot; framing is useful: Rust has crossed in some domains but not others, and treating it as universally adopted or universally nascent both miss the picture&lt;&#x2F;li&gt;
&lt;li&gt;Mainstream pragmatists need Rust to be excellent today, not eventually; the community&#x27;s response to that pressure will determine how far adoption continues to spread&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;78x-faster-what-the-matrix-sdk-taught-us-about-lock-contention&quot;&gt;78× Faster: What the Matrix SDK Taught Us About Lock Contention&lt;&#x2F;h1&gt;
&lt;p&gt;The Matrix Rust SDK&#x27;s room list was freezing. Not briefly, up to five minutes to render a list of rooms. The team at mnt.io wrote a &lt;a href=&quot;https:&#x2F;&#x2F;mnt.io&#x2F;articles&#x2F;about-memory-pressure-lock-contention-and-data-oriented-design&#x2F;&quot; target=&quot;_blank&quot;&gt;detailed post-mortem&lt;&#x2F;a&gt; that is one of the better performance debugging write-ups I have read this year.&lt;&#x2F;p&gt;
&lt;p&gt;The root causes turned out to be two things working together. First, memory pressure: the sorting algorithm was cloning &lt;code&gt;LatestEventValue&lt;&#x2F;code&gt; objects, each 144 bytes, repeatedly during comparisons. Second, lock contention: the sort called into protected data structures 322,042 times, acquiring a lock on each call. The profiler showed 743MB of total allocations and the same number of lock acquisitions just to sort a list.&lt;&#x2F;p&gt;
&lt;p&gt;The fix was data-oriented design, applied specifically. The team introduced a &lt;code&gt;RoomListItem&lt;&#x2F;code&gt; struct at 64 bytes that caches all the fields the sorters actually need, populated once before the sort runs. Instead of reaching through a lock 322,000 times, the sort operates entirely on a flat array of small structs that fits in L1 cache. The sort no longer needed to acquire any locks: the RoomListItem struct carried everything needed, so the protected data was never touched during the sort itself.&lt;&#x2F;p&gt;
&lt;p&gt;The numbers: 53ms down to 0.676ms. Throughput from 18,800 elements per second to 1.4 million. That is a 78× improvement from two structural changes: eliminating clones during comparison and moving lock access out of the hot path.&lt;&#x2F;p&gt;
&lt;p&gt;What makes this write-up worth reading beyond the benchmarks is the diagnosis process. The authors used profiling to identify that the bottleneck was not the algorithm but the data layout, then applied a well-understood technique from game development, data-oriented design, to a Rust application context. The pattern is not specific to the Matrix SDK. Any Rust code that reads from protected data inside a loop is a candidate for this approach.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Lock acquisitions inside sort comparisons compound badly: 322K acquisitions for a single sort pass is a design problem, not a tuning problem, and no amount of lock optimization fixes it&lt;&#x2F;li&gt;
&lt;li&gt;Data-oriented design in Rust means precomputing a cache-friendly struct before the hot path runs, not restructuring your entire domain model; a 64-byte struct that lives in L1 cache is often enough&lt;&#x2F;li&gt;
&lt;li&gt;The 78× speedup came from two changes, fewer allocations and zero locks in the hot path; profiling told them which to fix first&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;surrealdb-3-0-a-database-built-for-ai-agent-memory&quot;&gt;SurrealDB 3.0: A Database Built for AI Agent Memory&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;surrealdb.com&#x2F;blog&#x2F;introducing-surrealdb-3-0--the-future-of-ai-agent-memory&quot; target=&quot;_blank&quot;&gt;SurrealDB 3.0&lt;&#x2F;a&gt;, released February 17, is the most substantial release the project has shipped. The headline positioning is &quot;AI agent memory,&quot; and the features behind it are worth examining rather than dismissing as marketing.&lt;&#x2F;p&gt;
&lt;p&gt;The architecture changes in 3.0 are real improvements. Separation of values from expressions eliminates redundant computation. ID-based storage reduced catalog keys from 80 to 42 bytes. Synced writes are now the default for durability. Over 150 bug fixes shipped. These are the kinds of changes that make a database trustworthy for production, not just interesting in demos.&lt;&#x2F;p&gt;
&lt;p&gt;The AI-specific features center on a few additions. File support via buckets and file pointers lets you store images, audio, and documents alongside structured data, which matters for multimodal agents. Enhanced vector search with compound indexes, prefix and range scans, and concurrent index builds improves retrieval quality for agent memory lookups. The most interesting addition is Surrealism: a WebAssembly extension system that lets you define custom business logic and integrate AI models, including local LLMs and remote APIs, directly in the database layer.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;DEFINE API&lt;&#x2F;code&gt; statement is also notable. It lets you define custom endpoints in SurrealQL, effectively embedding middleware and rate limiting logic in the database without an external service. For agent-first architectures where you want the data and the logic close together, this reduces the number of moving parts.&lt;&#x2F;p&gt;
&lt;p&gt;SurrealDB is written in Rust, which is not the headline of this story but is the reason it can ship a WebAssembly extension system without a separate runtime. The same binary handles query execution, WASM evaluation, and vector search. That kind of integration is hard to achieve in languages that lean on managed runtimes.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The AI agent memory framing is real: file storage, vector search with concurrent indexes, and WASM-based custom logic cover the three things agent memory needs, retrieval, storage, and computation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;DEFINE API&lt;&#x2F;code&gt; is an interesting pattern, embedding endpoint logic in the database reduces the surface area of agent architectures that would otherwise require an API layer between the DB and the agent&lt;&#x2F;li&gt;
&lt;li&gt;150+ bug fixes and architectural durability improvements make this a serious production release, not just a feature drop&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2026&#x2F;02&#x2F;23&#x2F;rust-debugging-survey-2026&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust debugging survey 2026&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
The compiler team wants to know how you debug Rust, submissions open until March 13, and if debugging Rust frustrates you this is your chance to say so with data.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rustfoundation.org&#x2F;media&#x2F;guest-blog-fosdem-2026-rust-devroom-in-review&#x2F;&quot; target=&quot;_blank&quot;&gt;FOSDEM 2026: Rust Devroom in Review&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
A recap of the talks and community projects presented at the Rust devroom at FOSDEM 2026.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2026&#x2F;02&#x2F;13&#x2F;crates.io-malicious-crate-update&#x2F;&quot; target=&quot;_blank&quot;&gt;crates.io malicious crate policy update&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
The crates.io team updated how it communicates malicious crate removals: individual blog posts per removal are being replaced by RustSec advisories, keeping the registry transparent without the noise.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>75 - Rust Is Becoming the AI Runtime</title>
          <pubDate>Sun, 15 Feb 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-is-becoming-the-ai-runtime/</link>
          <guid>https://rust-trends.com/newsletter/rust-is-becoming-the-ai-runtime/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-is-becoming-the-ai-runtime/">&lt;p&gt;When Pydantic needed a sandboxed Python runtime for AI agents, they wrote it in Rust. When someone wanted a 27MB local AI assistant, they chose Rust. When Turso wanted to fix SQLite&#x27;s concurrency model, they rewrote it in Rust. The pattern is hard to ignore.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue: Pydantic&#x27;s Python interpreter written in Rust for AI agents, a local-first AI assistant in a 27MB binary, Turso&#x27;s SQLite rewrite, and running a 4B parameter speech model in the browser with WASM.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;pydantic-builds-a-python-interpreter-in-rust-for-ai&quot;&gt;Pydantic Builds a Python Interpreter in Rust for AI&lt;&#x2F;h1&gt;
&lt;p&gt;The team behind Pydantic released &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pydantic&#x2F;monty&quot; target=&quot;_blank&quot;&gt;Monty&lt;&#x2F;a&gt;, a minimal Python interpreter written in Rust. It&#x27;s not a general-purpose Python runtime. It&#x27;s built specifically for executing AI-generated code with microsecond startup times.&lt;&#x2F;p&gt;
&lt;p&gt;The numbers tell the story: 0.06ms cold start versus 195ms for Docker and 2,800ms for Pyodide. That&#x27;s over 3,000x faster than container-based sandboxing.&lt;&#x2F;p&gt;
&lt;p&gt;The real use case is what Pydantic calls &quot;Code Mode&quot; for AI agents. When an LLM chains multiple tool calls, sending every intermediate result back to the model wastes tokens and adds latency. Monty lets agents generate Python code that runs locally, pausing at external function calls for the host to resolve. Only the final result returns to the LLM. Less token usage, less round-tripping.&lt;&#x2F;p&gt;
&lt;p&gt;The security model is deliberately restrictive. No filesystem access, no network, no environment variables unless explicitly exposed through external functions. Memory limits, stack depth enforcement, and execution timeouts are built in. The interpreter serializes its state for pause and resume across process boundaries. That enables distributed execution.&lt;&#x2F;p&gt;
&lt;p&gt;The HN thread was mixed. Simon Willison got Monty running in WebAssembly and built a working demo. Critics questioned whether restricting Python features (no classes yet) is the right approach versus OS-level sandboxing. The E2B team argued only VMs provide real security guarantees. Fair points, but they miss the target use case. Monty isn&#x27;t competing with Docker for security. It&#x27;s competing on latency in agentic loops where microseconds matter.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;0.06ms cold start makes Monty viable for embedding in AI agent reasoning loops where container overhead is prohibitive&lt;&#x2F;li&gt;
&lt;li&gt;If you&#x27;re building agentic tooling, the snapshot&#x2F;resume pattern is worth borrowing for your own sandboxed execution&lt;&#x2F;li&gt;
&lt;li&gt;Currently experimental with no class support yet, but the &quot;Code Mode&quot; pattern for reducing LLM token usage is worth exploring&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;localgpt-a-27mb-ai-assistant-written-in-rust&quot;&gt;LocalGPT: A 27MB AI Assistant Written in Rust&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;localgpt-app&#x2F;localgpt&quot; target=&quot;_blank&quot;&gt;LocalGPT&lt;&#x2F;a&gt; is a Rust-based AI assistant that ships as a single 27MB binary with zero external dependencies. No Node.js, no Docker, no Python runtime. It launched on February 1 and already has over 800 stars.&lt;&#x2F;p&gt;
&lt;p&gt;The architecture is straightforward. Axum handles HTTP, SQLite with FTS5 provides keyword search, sqlite-vec adds semantic search with local embeddings, and eframe delivers a desktop GUI. The project includes CLI, web UI, desktop, and Telegram bot interfaces. You can build it headless with &lt;code&gt;--no-default-features&lt;&#x2F;code&gt; for servers.&lt;&#x2F;p&gt;
&lt;p&gt;The memory system stands out. Three markdown files define the assistant&#x27;s behavior: MEMORY.md for persistent knowledge, HEARTBEAT.md for autonomous background tasks, and SOUL.md for personality. The hybrid search combines vector similarity with BM25 keyword matching.&lt;&#x2F;p&gt;
&lt;p&gt;The project positions itself as a lightweight alternative to &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;openclaw&#x2F;openclaw&quot; target=&quot;_blank&quot;&gt;OpenClaw&lt;&#x2F;a&gt;, the popular open-source AI assistant. That means roughly 15,000 lines of Rust versus OpenClaw&#x27;s 460,000 lines of TypeScript, with about 45 crates versus a far larger dependency tree.&lt;&#x2F;p&gt;
&lt;p&gt;Commenters on HN raised valid concerns. &quot;Local-first&quot; is misleading when most users need an Anthropic or OpenAI API key. The naming confused people since another &quot;LocalGPT&quot; project already exists. But the technical foundation is solid. Ollama tool calling, a Telegram bot, and a security policy module all shipped within the first ten days. The development pace alone is impressive.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The three-file memory system (MEMORY.md, HEARTBEAT.md, SOUL.md) is a simple pattern worth borrowing for any local AI assistant&lt;&#x2F;li&gt;
&lt;li&gt;The hybrid SQLite FTS5 + vector search pattern is worth studying for other Rust projects that need local knowledge retrieval&lt;&#x2F;li&gt;
&lt;li&gt;Compatible with OpenClaw&#x27;s workspace format, making migration straightforward&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;deep-dive-into-turso-the-sqlite-rewrite-in-rust&quot;&gt;Deep Dive into Turso: The SQLite Rewrite in Rust&lt;&#x2F;h1&gt;
&lt;p&gt;Sylvain Kerkour published a &lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;turso-sqlite&quot; target=&quot;_blank&quot;&gt;detailed look at Turso&lt;&#x2F;a&gt;, which is rewriting SQLite&#x27;s engine in Rust while maintaining file format compatibility.&lt;&#x2F;p&gt;
&lt;p&gt;The motivation goes beyond memory safety. SQLite&#x27;s single-writer limitation blocks modern use cases. Its proprietary TH3 test harness (roughly 45x larger than the public TCL test suite) prevents external contributors from making confident architectural changes. Column typing is weak. Schema modifications are painful. These are real friction points that Rust alone doesn&#x27;t solve, but a full rewrite can address.&lt;&#x2F;p&gt;
&lt;p&gt;Turso adds MVCC for concurrent writes, built-in encryption, and async I&#x2F;O via io_uring. It works both as an in-process embedded database and as a networked database for cloud deployments. That dual capability fills a gap between SQLite&#x27;s simplicity and PostgreSQL&#x27;s scalability.&lt;&#x2F;p&gt;
&lt;p&gt;The HN thread was cautiously skeptical. A major concern was testing. SQLite&#x27;s proprietary TH3 test harness covers decades of production edge cases. A rewrite without access to that suite will have stability gaps. One developer mentioned mirroring data between SQLite and Turso to catch divergences before production. That speaks to the trust gap Turso still needs to close.&lt;&#x2F;p&gt;
&lt;p&gt;Business model sustainability was the other major concern. Turso is VC-backed, and HN commenters cited Elasticsearch&#x27;s license change as a cautionary tale. The SQLite team has maintained their project for over 25 years. Can a startup match that kind of stewardship?&lt;&#x2F;p&gt;
&lt;p&gt;Worth watching, but not ready for production workloads yet.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Turso addresses real SQLite limitations: concurrent writes, encryption, and async I&#x2F;O&lt;&#x2F;li&gt;
&lt;li&gt;The testing gap is the biggest technical risk. SQLite&#x27;s proprietary TH3 harness is roughly 45x larger than the public TCL test suite.&lt;&#x2F;li&gt;
&lt;li&gt;The dual embedded&#x2F;networked architecture fills a real gap for projects that start simple and need to scale&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;running-a-4b-parameter-speech-model-in-the-browser-with-rust&quot;&gt;Running a 4B Parameter Speech Model in the Browser with Rust&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;TrevorS&#x2F;voxtral-mini-realtime-rs&quot; target=&quot;_blank&quot;&gt;Voxtral Mini Realtime&lt;&#x2F;a&gt; is a pure Rust implementation of Mistral&#x27;s speech recognition model. It runs natively and in web browsers through WASM and WebGPU. Getting a 4B parameter model into a browser required solving five hard engineering problems.&lt;&#x2F;p&gt;
&lt;p&gt;The architecture uses the Burn ML framework with two inference paths. The native path loads full f32 SafeTensors (about 9 GB). The browser path uses Q4 quantized GGUF files (about 2.5 GB), sharded into chunks under 512 MB to respect WASM&#x27;s ArrayBuffer limits.&lt;&#x2F;p&gt;
&lt;p&gt;The browser constraints are where this gets interesting. WASM&#x27;s 4 GB address space forced a two-phase loading pattern: parse weights first, drop the reader, then finalize the model. The 1.5 GB embedding table was too large for GPU memory, so they store Q4-quantized embeddings on GPU (216 MB) with CPU-side row lookups. WebGPU doesn&#x27;t support synchronous readback, so the entire decode loop is async. And WebGPU&#x27;s 256 max invocations per workgroup required patching cubecl-wgpu to stay within spec limits.&lt;&#x2F;p&gt;
&lt;p&gt;Custom WGSL shaders handle fused Q4 dequantization and matrix multiplication on the GPU. The quantization itself proved sensitive to audio padding, requiring 76 silence tokens instead of the upstream library&#x27;s 32 to cover all decoder prefix positions.&lt;&#x2F;p&gt;
&lt;p&gt;Community reaction on HN was blunt. Multiple users reported it wasn&#x27;t truly real-time on an M4 Max, and transcription accuracy was inconsistent. The 2.5 GB download raised legitimate UX concerns. But as a proof of concept for client-side ML inference in Rust, the engineering is impressive. Each of those constraints is a problem other developers will face as browser-based ML matures.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;If you&#x27;re targeting WASM for ML inference, budget significant engineering time for memory layout. The 2 GB allocation limit and 4 GB address space require creative workarounds like sharded cursors and two-phase loading&lt;&#x2F;li&gt;
&lt;li&gt;Q4 quantization cuts model size from 9 GB to 2.5 GB, making browser deployment feasible&lt;&#x2F;li&gt;
&lt;li&gt;Privacy-preserving speech recognition without server round-trips is the compelling use case, even if performance needs work&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;j178&#x2F;prek&quot; target=&quot;_blank&quot;&gt;Prek: Pre-Commit Replacement in Rust&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Already adopted by CPython, FastAPI, and Home Assistant&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;smallcultfollowing.com&#x2F;babysteps&#x2F;blog&#x2F;2026&#x2F;02&#x2F;09&#x2F;hello-dada&#x2F;&quot; target=&quot;_blank&quot;&gt;Niko Matsakis Launches Dada Language Series&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Introducing a new language with a fresh take on permissions and mutation&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;internals.rust-lang.org&#x2F;t&#x2F;private-unsafe-fields-are-a-poorly-motivated-feature&#x2F;23976&quot; target=&quot;_blank&quot;&gt;Private Unsafe Fields: A Poorly Motivated Feature?&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Hot Discourse debate on whether this feature solves the right problem&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;artifact-keeper&quot; target=&quot;_blank&quot;&gt;Artifact Keeper: Open-Source Artifactory Alternative&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Self-hosted artifact registry with a Rust backend, supporting 45+ package formats&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.phoronix.com&#x2F;news&#x2F;Rust-Coreutils-FOSDEM-2026&quot; target=&quot;_blank&quot;&gt;Rust Coreutils at FOSDEM 2026&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
uutils marches toward drop-in GNU coreutils replacement&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>74 - When Meta and Anthropic Choose Rust</title>
          <pubDate>Thu, 29 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/when-meta-and-anthropic-choose-rust/</link>
          <guid>https://rust-trends.com/newsletter/when-meta-and-anthropic-choose-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/when-meta-and-anthropic-choose-rust/">&lt;p&gt;Big news from Meta this week. WhatsApp replaced its C++ media handling library with Rust, and the scale is unprecedented: billions of devices across Android, iOS, macOS, Web, and wearables.&lt;&#x2F;p&gt;
&lt;p&gt;This is the largest client-side Rust deployment I&#x27;m aware of. When a company serving 3 billion daily users rewrites critical infrastructure in Rust, it signals something significant about enterprise adoption.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue: WhatsApp&#x27;s Rust migration, why Claude Code uses ripgrep instead of embeddings, PostgreSQL FFI performance gains, async blocking pitfalls, and more.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s dive in.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;whatsapp-rewrites-media-library-in-rust&quot;&gt;WhatsApp Rewrites Media Library in Rust&lt;&#x2F;h1&gt;
&lt;p&gt;Meta&#x27;s engineering team published an &lt;a href=&quot;https:&#x2F;&#x2F;engineering.fb.com&#x2F;2026&#x2F;01&#x2F;27&#x2F;security&#x2F;rust-at-scale-security-whatsapp&#x2F;&quot; target=&quot;_blank&quot;&gt;in-depth writeup&lt;&#x2F;a&gt; on rewriting &quot;wamedia,&quot; WhatsApp&#x27;s media handling library, from C++ to Rust. The numbers tell the story: 160,000 lines of C++ became 90,000 lines of Rust, including tests.&lt;&#x2F;p&gt;
&lt;p&gt;The rewritten library powers a security system called &quot;Kaleidoscope&quot; that validates media files and detects malicious content. Every image, video, and document flowing through WhatsApp now passes through Rust code before reaching users.&lt;&#x2F;p&gt;
&lt;p&gt;What stands out is their migration approach. Instead of a risky big-bang rewrite, Meta ran both implementations in parallel using differential fuzzing. The C++ and Rust versions processed the same inputs, and any discrepancy triggered investigation. This strategy let them catch subtle bugs before they reached production.&lt;&#x2F;p&gt;
&lt;p&gt;The Hacker News discussion praised this approach. One commenter called it &quot;exactly how you do a safe migration at scale.&quot; The binary size overhead (around 200KB) was addressed through Buck2 build optimizations.&lt;&#x2F;p&gt;
&lt;p&gt;Performance and memory usage improved over the original C++. Meta attributes this partly to Rust&#x27;s ownership model encouraging cleaner data flow patterns.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Rust is viable for client-side deployments at massive scale&lt;&#x2F;li&gt;
&lt;li&gt;Differential fuzzing enables safe migrations without big-bang risk&lt;&#x2F;li&gt;
&lt;li&gt;The rewrite reduced code size by 44% while adding comprehensive tests&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;why-claude-code-chose-ripgrep-over-vector-search&quot;&gt;Why Claude Code Chose ripgrep Over Vector Search&lt;&#x2F;h1&gt;
&lt;p&gt;Here&#x27;s a counterintuitive choice: while most AI coding tools rush to implement vector databases and embeddings, Claude Code relies on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep&quot; target=&quot;_blank&quot;&gt;ripgrep&lt;&#x2F;a&gt; for code search. Not RAG pipelines. Just fast, reliable text search written in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Claude Code bundles ripgrep via the &lt;code&gt;@vscode&#x2F;ripgrep&lt;&#x2F;code&gt; npm package, the same battle-tested dependency that powers VS Code&#x27;s search. It works immediately on any codebase with no indexing required.&lt;&#x2F;p&gt;
&lt;p&gt;The advantages are significant: exact matches instead of semantic approximations, automatic &lt;code&gt;.gitignore&lt;&#x2F;code&gt; respect, and predictable behavior. You know exactly what it&#x27;s searching.&lt;&#x2F;p&gt;
&lt;p&gt;A Hacker News commenter pointed out this is still technically RAG, just using information retrieval techniques that have existed for decades. Sometimes proven approaches beat newer alternatives.&lt;&#x2F;p&gt;
&lt;p&gt;I wrote a &lt;a href=&quot;&#x2F;posts&#x2F;ripgrep-claude-code&#x2F;&quot; target=&quot;_blank&quot;&gt;deeper dive on this topic&lt;&#x2F;a&gt; covering ripgrep&#x27;s architecture, the VS Code connection, and configuration tips for Claude Code users.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Zero indexing time means instant productivity on new codebases&lt;&#x2F;li&gt;
&lt;li&gt;Exact text matching avoids semantic drift of embeddings&lt;&#x2F;li&gt;
&lt;li&gt;ripgrep demonstrates Rust&#x27;s value proposition: C-level performance with memory safety&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;replacing-protobuf-with-direct-rust-ffi&quot;&gt;Replacing Protobuf with Direct Rust FFI&lt;&#x2F;h1&gt;
&lt;p&gt;A detailed post from &lt;a href=&quot;https:&#x2F;&#x2F;pgdog.dev&#x2F;blog&#x2F;replace-protobuf-with-rust&quot; target=&quot;_blank&quot;&gt;PgDog&lt;&#x2F;a&gt; shows how they eliminated Protocol Buffers by using direct C-to-Rust FFI bindings. The performance gains are substantial: 5.45x faster parsing and 9.64x faster deparsing compared to the Protobuf version.&lt;&#x2F;p&gt;
&lt;p&gt;The approach bypasses serialization entirely. Instead of converting data to Protobuf format and back, they pass pointers directly between C and Rust code. This works because PgDog controls both sides of the interface, so they don&#x27;t need language-agnostic serialization.&lt;&#x2F;p&gt;
&lt;p&gt;The tradeoff is clear: you lose cross-language compatibility but gain significant performance. For internal services where you control the entire stack, removing the serialization layer cuts out both latency and complexity.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Direct FFI can dramatically outperform serialization-based approaches&lt;&#x2F;li&gt;
&lt;li&gt;Consider this when you control both ends and need maximum performance&lt;&#x2F;li&gt;
&lt;li&gt;The 5-10x speedup comes from eliminating data transformation entirely&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;the-hidden-bottleneck-blocking-in-async-rust&quot;&gt;The Hidden Bottleneck: Blocking in Async Rust&lt;&#x2F;h1&gt;
&lt;p&gt;A walkthrough from &lt;a href=&quot;https:&#x2F;&#x2F;cong-or.xyz&#x2F;blocking-async-rust.html&quot; target=&quot;_blank&quot;&gt;cong-or.xyz&lt;&#x2F;a&gt; tackles one of the most common async Rust mistakes: accidentally blocking the runtime. This bug works fine in testing but tanks performance in production.&lt;&#x2F;p&gt;
&lt;p&gt;The article explains why calling synchronous code (file I&#x2F;O, CPU-heavy computations, or blocking network calls) inside an async context starves other tasks. The Tokio runtime can&#x27;t preempt your code, so one blocking call holds up the entire thread pool.&lt;&#x2F;p&gt;
&lt;p&gt;The fix depends on the situation. For CPU-bound work, use &lt;code&gt;spawn_blocking&lt;&#x2F;code&gt; to move it off the async threads. For blocking I&#x2F;O, switch to async alternatives or wrap in &lt;code&gt;spawn_blocking&lt;&#x2F;code&gt;. The post includes concrete examples showing the performance difference.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Blocking calls inside async functions prevent other tasks from running&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;spawn_blocking&lt;&#x2F;code&gt; for CPU-bound or unavoidably blocking operations&lt;&#x2F;li&gt;
&lt;li&gt;Profile your async code to find hidden synchronous bottlenecks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;simd-programming-in-pure-rust&quot;&gt;SIMD Programming in Pure Rust&lt;&#x2F;h1&gt;
&lt;p&gt;Sylvain Kerkour published a &lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;introduction-rust-simd&quot; target=&quot;_blank&quot;&gt;practical introduction to SIMD in Rust&lt;&#x2F;a&gt; that cuts through the complexity. Instead of diving into architecture-specific intrinsics, the guide focuses on portable SIMD using the experimental std::simd module.&lt;&#x2F;p&gt;
&lt;p&gt;The tutorial builds up from basic vector operations to real speedups. What makes it valuable is the emphasis on when SIMD helps versus when it doesn&#x27;t. Spoiler: if your data isn&#x27;t already contiguous in memory, you&#x27;ll spend more time shuffling bytes than computing.&lt;&#x2F;p&gt;
&lt;p&gt;The portable approach means your code works on x86, ARM, and WebAssembly without conditional compilation. You write once, and the compiler picks the best instructions for each target.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;std::simd provides portable SIMD without platform-specific intrinsics&lt;&#x2F;li&gt;
&lt;li&gt;Memory layout matters more than instruction choice for real speedups&lt;&#x2F;li&gt;
&lt;li&gt;Start with the high-level API before reaching for raw intrinsics&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;lucasgelfond&#x2F;zerobrew&quot; target=&quot;_blank&quot;&gt;zerobrew: Faster Homebrew Alternative&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;11happy&#x2F;cpx&quot; target=&quot;_blank&quot;&gt;cpx: Modern cp Replacement&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;antoine.vandecreme.net&#x2F;blog&#x2F;rust-closures&#x2F;&quot; target=&quot;_blank&quot;&gt;Understanding Rust Closures&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.ratatui-ruby.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;RatatuiRuby&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Why Claude Code Chose ripgrep Over Vector Search</title>
          <pubDate>Thu, 29 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/ripgrep-claude-code/</link>
          <guid>https://rust-trends.com/posts/ripgrep-claude-code/</guid>
          <description xml:base="https://rust-trends.com/posts/ripgrep-claude-code/">&lt;p&gt;Here&#x27;s a question worth pondering: when every AI coding tool is rushing to implement vector databases and embeddings, why did Anthropic choose a command-line grep replacement instead?&lt;&#x2F;p&gt;
&lt;p&gt;Claude Code, Anthropic&#x27;s agentic coding assistant, relies on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep&quot; target=&quot;_blank&quot;&gt;ripgrep&lt;&#x2F;a&gt; for code search. Not embeddings. Not RAG pipelines. Just fast, reliable text search written in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;This isn&#x27;t a minor implementation detail. It reveals something important about how effective AI coding assistants actually work.&lt;&#x2F;p&gt;</description>
      </item>
      <item>
          <title>73 - From Lab to Factory: Rust in Production</title>
          <pubDate>Sun, 30 Nov 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/from-lab-to-factory-rust-in-production/</link>
          <guid>https://rust-trends.com/newsletter/from-lab-to-factory-rust-in-production/</guid>
          <description xml:base="https://rust-trends.com/newsletter/from-lab-to-factory-rust-in-production/">&lt;p&gt;Robots, cars, compilers, and the glue holding it all together.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue: how Rust is powering real-world robotics at Copper, mobility systems at Toyota, and how the Rust Infra Team keeps your builds and crates running like clockwork.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s dive in.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;cut-your-rust-build-times-dramatically-sponsored&quot;&gt;Cut your Rust build times dramatically [sponsored]&lt;&#x2F;h1&gt;
&lt;p&gt;Slow Rust builds add up fast. Teams that switch to Depot&#x27;s high-performance GitHub Actions Runners often see 40–60% faster build times. With warm caching and powerful remote machines, Depot helps eliminate CI bottlenecks and gives developers back hours of lost time. &lt;a href=&quot;https:&#x2F;&#x2F;fandf.co&#x2F;4oqd2pB&quot; target=&quot;_blank&quot;&gt;This guide breaks down exactly how to achieve those gains in your own pipeline&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;P.S. Join &lt;a href=&quot;https:&#x2F;&#x2F;fandf.co&#x2F;4p74UL4&quot; target=&quot;_blank&quot;&gt;Depot&#x27;s Advent of Code 2025 challenge&lt;&#x2F;a&gt; and compete for prizes while solving puzzles and optimizing builds.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;woven-by-toyota-rust-in-real-world-mobility&quot;&gt;Woven by Toyota: Rust in Real-World Mobility&lt;&#x2F;h1&gt;
&lt;p&gt;I watched the &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qjXIseet-kM&quot; target=&quot;_blank&quot;&gt;interview with Pete LeVasseur&lt;&#x2F;a&gt;, linked via Filtra, and it&#x27;s a good reminder that Rust isn&#x27;t just winning in dev tools and backend systems. Woven by Toyota is using it to push forward the future of mobility, real cars, real data, real-time safety. That&#x27;s a much harder problem space than web apps, and hearing engineers talk about Rust in that context is refreshing.&lt;&#x2F;p&gt;
&lt;p&gt;The main theme that stood out is how Rust enables predictability and correctness in critical systems. When you&#x27;re building platforms that interact with physical environments, vehicles, sensors, city infrastructure, you can&#x27;t afford runtime surprises. Rust&#x27;s compile-time guarantees aren&#x27;t just &quot;nice to have,&quot; they become operational necessities.&lt;&#x2F;p&gt;
&lt;p&gt;A second takeaway is the mindset shift: Toyota isn&#x27;t just a car company anymore. They&#x27;re treating mobility as a software problem. Rust helps them think in terms of components, safety boundaries, and modular runtimes that can evolve over time. It shows how Rust is slowly embedding itself into domains where reliability once meant C and C++ were the only options.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to see how Rust is used when hardware meets mobility at scale, this interview is worth the time.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Rust is gaining traction in industries where safety and correctness are non-negotiable.&lt;&#x2F;li&gt;
&lt;li&gt;Predictability at compile time is becoming a competitive advantage.&lt;&#x2F;li&gt;
&lt;li&gt;Toyota is treating mobility as a modular, evolving software system.&lt;&#x2F;li&gt;
&lt;li&gt;Real-world Rust adoption is accelerating beyond &quot;developer hype&quot; into operational use.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;copper-robotics-rust-in-the-driver-s-seat&quot;&gt;Copper Robotics: Rust in the Driver&#x27;s Seat&lt;&#x2F;h1&gt;
&lt;p&gt;When I spoke with Guillaume Binet, founder of Copper Robotics, it was clear this wasn&#x27;t just another robotics SDK. &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;copper-project&#x2F;copper-rs&quot; target=&quot;_blank&quot;&gt;Copper&lt;&#x2F;a&gt; is a rethink of how robots are programmed, and it&#x27;s built from the ground up in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;The core idea is simple: if a robot receives the same sensor input, it should always produce the same output. Obvious? Maybe. But in practice, that level of determinism is surprisingly hard to achieve, especially with traditional robotics stacks. With ROS, for example, deterministically replaying logs is nearly impossible. Copper, by contrast, guarantees deterministic replay of logged data, which makes debugging and validation dramatically easier.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s not just about determinism, though. ROS also comes with heavy dependencies, often tied to a specific Ubuntu version. That adds friction, or forces teams to containerize with Docker just to stay sane. C++ by itself isn&#x27;t the issue, there are deterministic runtimes out there, but most are proprietary and come with their own baggage. Rust helps sidestep all of that. It gives you reliable, portable performance and reduces your reliance on OS-level quirks.&lt;&#x2F;p&gt;
&lt;p&gt;Copper takes full advantage of Rust&#x27;s strengths. It gives you memory safety without garbage collection, fearless concurrency, and zero-cost abstractions. But more than that, it lets developers, especially those with backgrounds in math or physics, write expressive, high-level logic using functional patterns that feel familiar to anyone coming from Python. That kind of clarity is rare in robotics, and sorely needed.&lt;&#x2F;p&gt;
&lt;p&gt;Unlike ROS, which drags along databases and service layers (great for cloud services, not for real-time embedded systems), Copper is built for the edge. It runs lean. It runs fast. And it runs where it matters: from simulation to production, without needing to rewrite or re-architect.&lt;&#x2F;p&gt;
&lt;p&gt;Copper isn&#x27;t trying to be everything. It&#x27;s focused. It solves real problems. And it uses Rust not because it&#x27;s cool, but because it&#x27;s the best tool for the job.&lt;&#x2F;p&gt;
&lt;p&gt;If you&#x27;re building robotics software, or thinking about it, this is a project worth checking out. The &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;copper-project&#x2F;copper-rs&quot; target=&quot;_blank&quot;&gt;GitHub repo&lt;&#x2F;a&gt; is open and the community is growing.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s a great example of Rust moving robotics forward, not just in theory, but in production.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;rust-infrastructure-the-unsung-backbone&quot;&gt;Rust Infrastructure: The Unsung Backbone&lt;&#x2F;h1&gt;
&lt;p&gt;In a &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;11&#x2F;25&#x2F;interview-with-jan-david-nose&#x2F;&quot; target=&quot;_blank&quot;&gt;recent interview&lt;&#x2F;a&gt;, Jan David Nose from the Infrastructure Team of the Rust Project shared what keeps the ecosystem running behind the scenes. From CI pipelines to crate delivery, the Infra Team handles the critical stuff that makes Rust feel smooth and reliable—builds, testing, deploys, and tooling.&lt;&#x2F;p&gt;
&lt;p&gt;One standout is &lt;strong&gt;Crater&lt;&#x2F;strong&gt;, Rust&#x27;s large-scale regression tester. It checks public crates against compiler changes to catch breakage early, a key part of maintaining Rust&#x27;s famously stable ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;But with Rust&#x27;s growing popularity, challenges scale too: millions of build-minutes a month, platform support, and supply chain security are now central concerns.&lt;&#x2F;p&gt;
&lt;p&gt;So next time &lt;code&gt;cargo build&lt;&#x2F;code&gt; just works, now you know who to thank.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s05e05-canonical&#x2F;&quot; target=&quot;_blank&quot;&gt;Ubuntu Migrating to Rust: uutils and sudo-rs Shipping by Default&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Lessons learned from Canonical&#x27;s VP of Engineering on bringing Rust utilities to Ubuntu by default.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1p8tbdd&#x2F;some_neat_things_about_rust_you_might_not_know&#x2F;&quot; target=&quot;_blank&quot;&gt;Some Neat Things About Rust You Might Not Know&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Community-shared lesser-known Rust features and tips.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=monOq_uHHcg&quot; target=&quot;_blank&quot;&gt;Interview: Christian Legnitto, Maintainer of rust-gpu and rust-cuda&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Deep dive into GPU programming with Rust and the challenges of maintaining these cutting-edge projects.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>72 - From Experimental to Enterprise: Rust&#x27;s Production Moment</title>
          <pubDate>Sun, 16 Nov 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/experimental-to-enterprise-rust-production/</link>
          <guid>https://rust-trends.com/newsletter/experimental-to-enterprise-rust-production/</guid>
          <description xml:base="https://rust-trends.com/newsletter/experimental-to-enterprise-rust-production/">&lt;p&gt;Sometimes enterprise adoption happens quietly, then all at once.&lt;&#x2F;p&gt;
&lt;p&gt;This week, AWS promoted Rust from &quot;experimental&quot; to generally available on Lambda, backed by their full SLA. Google published data showing Rust code in Android has &lt;strong&gt;1000x fewer memory vulnerabilities&lt;&#x2F;strong&gt; than C&#x2F;C++, while simultaneously improving development velocity by every meaningful metric. And JetBrains explored why Rust and Python are becoming partners rather than competitors.&lt;&#x2F;p&gt;
&lt;p&gt;These aren&#x27;t just announcements, they&#x27;re data points in a larger story: Rust is crossing the production chasm. From serverless functions to mobile operating systems, the &quot;memory-safe future&quot; isn&#x27;t theoretical anymore. It&#x27;s shipping at scale, backed by SLAs, and proving that faster development is safer development.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s look at the numbers.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;improve-your-rust-build-times-sponsored&quot;&gt;Improve your Rust build times [sponsored]&lt;&#x2F;h1&gt;
&lt;p&gt;Building the Zed code editor reveals just how much build times can vary. We cut build time from 43 to 26 minutes, a 61% improvement by using Depot&#x27;s GitHub Action Runners. &lt;a href=&quot;https:&#x2F;&#x2F;fandf.co&#x2F;3Li2r1p&quot; target=&quot;_blank&quot;&gt;Let&#x27;s enhance your Rust build speed&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;aws-lambda-officially-supports-rust-with-production-sla&quot;&gt;AWS Lambda Officially Supports Rust with Production SLA&lt;&#x2F;h1&gt;
&lt;p&gt;AWS Lambda has promoted Rust from &quot;experimental&quot; to &lt;strong&gt;Generally Available&lt;&#x2F;strong&gt; status, complete with AWS Support and the full Lambda availability SLA. &lt;a href=&quot;https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;compute&#x2F;building-serverless-applications-with-rust-on-aws-lambda&#x2F;&quot; target=&quot;_blank&quot;&gt;The announcement&lt;&#x2F;a&gt; marks a fundamental shift: Rust is now officially backed for business-critical serverless applications across all AWS Regions, including GovCloud and China.&lt;&#x2F;p&gt;
&lt;p&gt;The runtime uses Amazon Linux 2023 (&lt;code&gt;provided.al2023&lt;&#x2F;code&gt; or &lt;code&gt;provided.al2&lt;&#x2F;code&gt;) since Rust compiles to native machine code rather than requiring a language-specific runtime. You&#x27;ll use the &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;lambda_runtime&quot; target=&quot;_blank&quot;&gt;lambda_runtime crate&lt;&#x2F;a&gt; to handle the Lambda event processing, and AWS recommends &lt;strong&gt;Cargo Lambda&lt;&#x2F;strong&gt; for streamlined development, testing, and deployment workflows.&lt;&#x2F;p&gt;
&lt;p&gt;What changed? This isn&#x27;t a new technical capability, Rust has worked on Lambda for years. What&#x27;s new is AWS putting their name behind it with SLA guarantees and roadmap commitments. That&#x27;s the difference between &quot;experimentally supported&quot; and &quot;bet your production workload on it.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;For teams evaluating Rust for serverless architectures, the calculation just shifted. You&#x27;re no longer early adopters. You&#x27;re using a GA service with enterprise support.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;google-security-rust-in-android-delivers-1000x-fewer-vulnerabilities&quot;&gt;Google Security: Rust in Android Delivers 1000x Fewer Vulnerabilities&lt;&#x2F;h1&gt;
&lt;p&gt;Here&#x27;s the data that settles the memory safety debate. Google&#x27;s Android Security team published &lt;a href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2025&#x2F;11&#x2F;rust-in-android-move-fast-fix-things.html&quot; target=&quot;_blank&quot;&gt;comprehensive metrics&lt;&#x2F;a&gt; on Rust adoption in Android, and the numbers are staggering. Memory safety vulnerabilities in Rust code occur at a rate of &lt;strong&gt;0.2 per million lines of code&lt;&#x2F;strong&gt;. In C&#x2F;C++? Around &lt;strong&gt;1,000 per million lines&lt;&#x2F;strong&gt;. That&#x27;s not 10% better or 2x better, it&#x27;s a &lt;strong&gt;1000x reduction&lt;&#x2F;strong&gt; in vulnerability density.&lt;&#x2F;p&gt;
&lt;p&gt;But here&#x27;s what makes this story remarkable: Rust isn&#x27;t just safer. It&#x27;s faster to develop.&lt;&#x2F;p&gt;
&lt;p&gt;Google measured development velocity using the DORA framework and found that Rust changes require &lt;strong&gt;20% fewer revisions&lt;&#x2F;strong&gt; than equivalent C++ code, spend &lt;strong&gt;25% less time in code review&lt;&#x2F;strong&gt;, and have a &lt;strong&gt;4x lower rollback rate&lt;&#x2F;strong&gt; for medium and large changes. Their conclusion: &quot;Secure code development is simultaneously faster development.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Android now has roughly 5 million lines of Rust in production, powering everything from the Nearby Presence protocol to MLS encryption for RCS, Chromium parsers for PNG and JSON, and even the first production Rust driver in Linux kernel 6.12 (an Arm GPU driver collaboration).&lt;&#x2F;p&gt;
&lt;p&gt;The article includes a fascinating near-miss case study: &lt;strong&gt;CVE-2025-48530&lt;&#x2F;strong&gt;, a linear buffer overflow in the CrabbyAVIF library caught before release. The vulnerability would have been exploitable in C&#x2F;C++, but Android&#x27;s Scudo hardened allocator made it non-exploitable. Defense in depth works, but starting with memory-safe code is the better strategy.&lt;&#x2F;p&gt;
&lt;p&gt;The takeaway? Memory safety vulnerabilities have dropped below &lt;strong&gt;20% of total Android vulnerabilities&lt;&#x2F;strong&gt; for the first time in 2025. This isn&#x27;t incremental progress. It&#x27;s a sea change in platform security, backed by data across millions of lines of production code.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;jetbrains-analysis-rust-vs-python-partners-not-competitors&quot;&gt;JetBrains Analysis: Rust vs Python—Partners, Not Competitors&lt;&#x2F;h1&gt;
&lt;p&gt;The Python vs Rust debate misses the point. They&#x27;re increasingly complementary, not competitive.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.jetbrains.com&#x2F;rust&#x2F;2025&#x2F;11&#x2F;10&#x2F;rust-vs-python-finding-the-right-balance-between-speed-and-simplicity&#x2F;&quot; target=&quot;_blank&quot;&gt;JetBrains&#x27; analysis&lt;&#x2F;a&gt; highlights the philosophical divide: Python prioritizes rapid iteration and accessibility (57% developer adoption, up from 32% in 2017). Rust prioritizes compile-time safety and performance (11% adoption with 80%+ retention for 9 consecutive years as &quot;Most Admired&quot;).&lt;&#x2F;p&gt;
&lt;p&gt;The technical differences are fundamental:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Memory&lt;&#x2F;strong&gt;: Rust&#x27;s ownership rules prevent null pointers and dangling references at compile time. Python relies on garbage collection with unpredictable pauses.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Concurrency&lt;&#x2F;strong&gt;: Rust enables true multicore parallelism. Python&#x27;s GIL limits CPU-bound concurrency.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Type systems&lt;&#x2F;strong&gt;: Rust catches errors before execution with static typing. Python trades early detection for flexibility with dynamic typing.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;But here&#x27;s the trend that matters: &lt;strong&gt;Rust is powering high-performance components inside Python applications&lt;&#x2F;strong&gt;. Tools like &lt;strong&gt;Polars&lt;&#x2F;strong&gt; (DataFrames), &lt;strong&gt;Ruff&lt;&#x2F;strong&gt; (linting), and &lt;strong&gt;uv&lt;&#x2F;strong&gt; (package management) deliver &quot;modest to dramatic speed-ups&quot; by compiling Rust to native machine code with zero-cost abstractions and no GC overhead.&lt;&#x2F;p&gt;
&lt;p&gt;The future isn&#x27;t &quot;Rust or Python.&quot; It&#x27;s &quot;Python for rapid development, Rust where performance matters,&quot; often within the same application. That&#x27;s not compromise, it&#x27;s choosing the right tool for each layer of the stack.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;the-state-of-simd-in-rust-safer-more-mature-still-evolving&quot;&gt;The State of SIMD in Rust: Safer, More Mature, Still Evolving&lt;&#x2F;h1&gt;
&lt;p&gt;SIMD in Rust crossed a major usability threshold: &lt;strong&gt;most intrinsics are no longer unsafe to call&lt;&#x2F;strong&gt; as of Rust 1.87.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;shnatsel.medium.com&#x2F;the-state-of-simd-in-rust-in-2025-32c263e5f53d&quot; target=&quot;_blank&quot;&gt;Shnatsel&#x27;s 2025 analysis&lt;&#x2F;a&gt; breaks down four approaches to SIMD in ascending order of effort: autovectorization, intrinsics, portable SIMD abstractions, and manual assembly.&lt;&#x2F;p&gt;
&lt;p&gt;The decision framework is straightforward:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero dependencies, minimal hassle?&lt;&#x2F;strong&gt; → Autovectorization (let LLVM handle it)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Porting C code or targeting specific hardware?&lt;&#x2F;strong&gt; → Intrinsics (now much safer)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Everything else?&lt;&#x2F;strong&gt; → Portable SIMD abstractions&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The portable SIMD library ecosystem is maturing but still fragmented. &lt;strong&gt;pulp&lt;&#x2F;strong&gt; offers built-in multiversioning and powers the &lt;code&gt;faer&lt;&#x2F;code&gt; linear algebra library, with support for NEON, AVX2, and AVX-512. &lt;strong&gt;macerator&lt;&#x2F;strong&gt; (a pulp fork) adds better generic programming support and expanded instruction sets. &lt;strong&gt;wide&lt;&#x2F;strong&gt; is noted as mature and complete for broader use cases.&lt;&#x2F;p&gt;
&lt;p&gt;The barrier to entry dropped significantly with safer intrinsics, but choosing the right abstraction layer still requires understanding your performance constraints and target platforms. SIMD in Rust is production-ready—just know which tool matches your needs.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;11&#x2F;10&#x2F;Rust-1.91.1&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust 1.91.1 Released&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Point release fixing critical WebAssembly linker failures and Cargo file locking on illumos systems.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rustfoundation.org&#x2F;media&#x2F;announcing-the-rust-foundation-maintainers-fund&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Foundation Announces Maintainers Fund&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
New fund for long-term support of Rust maintainers, starting with $100K focused on Compiler and Language teams.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;smallcultfollowing.com&#x2F;babysteps&#x2F;blog&#x2F;2025&#x2F;11&#x2F;10&#x2F;just-call-clone&#x2F;&quot; target=&quot;_blank&quot;&gt;Niko Matsakis: Just Call Clone (or Alias)&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Memory optimization insights from Rust language team member on when cloning is the right choice.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;engineering-a-rust-optimization-quiz&quot; target=&quot;_blank&quot;&gt;Engineering a Rust Optimization Quiz&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Fasterthanlime&#x27;s deep dive into compiler optimizations with interactive examples.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;blog&#x2F;defensive-programming&#x2F;&quot; target=&quot;_blank&quot;&gt;Patterns for Defensive Programming in Rust&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;
Comprehensive guide to writing robust, error-resistant Rust code.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>71 - Production Rust at Internet Scale</title>
          <pubDate>Sun, 02 Nov 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/production-rust-internet-scale/</link>
          <guid>https://rust-trends.com/newsletter/production-rust-internet-scale/</guid>
          <description xml:base="https://rust-trends.com/newsletter/production-rust-internet-scale/">&lt;p&gt;Here&#x27;s a question worth pondering: when is &quot;unmaintained&quot; not actually a problem?&lt;&#x2F;p&gt;
&lt;p&gt;This week, a frustrated developer sparked one of the most honest conversations about Rust&#x27;s ecosystem maturity I&#x27;ve seen in months. Their concern? Too many crates haven&#x27;t been touched in years, maintained by solo developers, while competitors like Go have corporate-backed libraries. The community&#x27;s response revealed something fascinating about how Rust code ages differently.&lt;&#x2F;p&gt;
&lt;p&gt;Meanwhile, Cloudflare is proving that production Rust isn&#x27;t just ready it&#x27;s rewriting the rules. They&#x27;re handling 90 million requests per second with 70% less CPU than nginx. And if you&#x27;ve ever wondered whether choosing between &lt;code&gt;std::sync::Mutex&lt;&#x2F;code&gt; and &lt;code&gt;parking_lot&lt;&#x2F;code&gt; actually matters, new benchmarks show the performance gap is way more nuanced than &quot;just use parking_lot.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;From internet-scale infrastructure to the hidden complexities of diagnostic rendering, this edition dives deep into what it really means to ship Rust in production.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s get into it.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;how-cloudflare-handles-90-million-requests-per-second-with-rust&quot;&gt;How Cloudflare Handles 90 Million Requests Per Second with Rust&lt;&#x2F;h1&gt;
&lt;p&gt;Ever wondered what it takes to handle a quarter of the internet&#x27;s traffic? In a recent &lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s05e03-cloudflare&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust in Production podcast episode&lt;&#x2F;a&gt;, Cloudflare engineers Edward Wang and Kevin Guthrie share how they replaced nginx with &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;pingora&quot; target=&quot;_blank&quot;&gt;Pingora&lt;&#x2F;a&gt;, their Rust-based HTTP proxy.&lt;&#x2F;p&gt;
&lt;p&gt;The numbers are striking: 90 million requests per second with &lt;strong&gt;70% less CPU&lt;&#x2F;strong&gt; and &lt;strong&gt;67% less memory&lt;&#x2F;strong&gt; compared to their nginx infrastructure. The key? Moving from multi-process to multi-threaded architecture, enabled by Rust&#x27;s memory safety guarantees.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-it-works&quot;&gt;Why It Works&lt;&#x2F;h2&gt;
&lt;p&gt;nginx&#x27;s process-based model couldn&#x27;t share connections efficiently at Cloudflare&#x27;s scale. Pingora leverages &lt;a href=&quot;https:&#x2F;&#x2F;tokio.rs&quot; target=&quot;_blank&quot;&gt;Tokio&lt;&#x2F;a&gt; for async operations and integrates &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rustls&#x2F;rustls&quot; target=&quot;_blank&quot;&gt;Rustls&lt;&#x2F;a&gt; for TLS. The result: 5ms faster median TTFB and better resource utilization across hundreds of data centers.&lt;&#x2F;p&gt;
&lt;p&gt;Cloudflare open-sourced &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;shellflip&quot; target=&quot;_blank&quot;&gt;shellflip&lt;&#x2F;a&gt; for graceful process restarts and uses &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;xacrimon&#x2F;dashmap&quot; target=&quot;_blank&quot;&gt;DashMap&lt;&#x2F;a&gt; for high-performance concurrent operations. They also built custom tooling for logging and metrics, critical when running Rust at internet scale.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-community-impact&quot;&gt;The Community Impact&lt;&#x2F;h2&gt;
&lt;p&gt;While Pingora is a framework requiring code, &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;blog&#x2F;introducing-river&#x2F;&quot; target=&quot;_blank&quot;&gt;River&lt;&#x2F;a&gt; a collaboration between Prossimo, Cloudflare, Shopify, and Chainguard, aims to be a ready-to-run nginx replacement with load balancing, KDL configuration, and WASM scriptability.&lt;&#x2F;p&gt;
&lt;p&gt;The takeaway? Async Rust handles internet-scale workloads, memory safety enables confident refactoring, and open sourcing core infrastructure elevates the entire ecosystem. If you&#x27;re building network services in Rust, this &lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s05e03-cloudflare&#x2F;&quot; target=&quot;_blank&quot;&gt;episode&lt;&#x2F;a&gt; is required listening.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;the-secret-behind-rust-s-beautiful-error-messages&quot;&gt;The Secret Behind Rust&#x27;s Beautiful Error Messages&lt;&#x2F;h1&gt;
&lt;p&gt;If you&#x27;ve ever compiled Rust code, you know the feeling: an error message that doesn&#x27;t just tell you what went wrong, but guides you toward the solution. Those beautifully formatted diagnostics? They&#x27;re the result of over a decade of intentional design by hundreds of contributors.&lt;&#x2F;p&gt;
&lt;p&gt;And now, that same power is becoming available to everyone.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;from-compiler-to-ecosystem&quot;&gt;From Compiler to Ecosystem&lt;&#x2F;h2&gt;
&lt;p&gt;Back in March 2019, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;issues&#x2F;59346&quot; target=&quot;_blank&quot;&gt;someone proposed&lt;&#x2F;a&gt; extracting the compiler&#x27;s error formatting into a standalone crate. Enter &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;annotate-snippets-rs&quot; target=&quot;_blank&quot;&gt;annotate-snippets&lt;&#x2F;a&gt;, created by Zibi Braniecki (ICU4X, Firefox i18n). Today, &lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-project-goals&#x2F;2024h2&#x2F;annotate-snippets.html&quot; target=&quot;_blank&quot;&gt;rustc is switching to use it by default&lt;&#x2F;a&gt;, a six-year journey coming full circle.&lt;&#x2F;p&gt;
&lt;p&gt;As &lt;a href=&quot;https:&#x2F;&#x2F;kobzol.github.io&#x2F;rust&#x2F;rustc&#x2F;2025&#x2F;05&#x2F;16&#x2F;evolution-of-rustc-errors.html&quot; target=&quot;_blank&quot;&gt;Jakub Beránek documented&lt;&#x2F;a&gt;, those error messages represent &quot;continuous design, implementation, review and testing by hundreds of contributors over ten years.&quot; Every colored highlight and helpful arrow required deliberate craft.&lt;&#x2F;p&gt;
&lt;p&gt;Now that capability is packaged as a general-purpose library, already used by ~9,000 projects. The integration work—handling rustc&#x27;s complex needs, porting thousands of UI tests, fixing bugs has been meticulous, led by Scott Schafer (Muscraft).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-coming&quot;&gt;What&#x27;s Coming&lt;&#x2F;h2&gt;
&lt;p&gt;The library supports &lt;strong&gt;Unicode decorations&lt;&#x2F;strong&gt; for even more polished output (try &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;crate-ci&#x2F;typos&quot; target=&quot;_blank&quot;&gt;typos&lt;&#x2F;a&gt; to see it in action). Once it&#x27;s the standard renderer, the library can evolve independently of compiler releases, and the ecosystem gets consistent, high-quality diagnostics.&lt;&#x2F;p&gt;
&lt;p&gt;You might know &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zkat&#x2F;miette&quot; target=&quot;_blank&quot;&gt;miette&lt;&#x2F;a&gt;, a full diagnostic framework. annotate-snippets is different it&#x27;s purely the renderer, but battle-tested by rustc itself. As &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oli-obk&quot; target=&quot;_blank&quot;&gt;oli-obk noted&lt;&#x2F;a&gt;: &quot;use it and get pretty diagnostics instead of rolling your own.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Rust could have shipped &quot;good enough&quot; errors. Instead, the community invested a decade perfecting them. Now that investment multiplies across every tool that adopts &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;annotate-snippets-rs&quot; target=&quot;_blank&quot;&gt;annotate-snippets&lt;&#x2F;a&gt;. Build something excellent once, then share it widely.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;the-great-rust-maintenance-debate-when-unmaintained-doesn-t-mean-broken&quot;&gt;The Great Rust Maintenance Debate: When &quot;Unmaintained&quot; Doesn&#x27;t Mean Broken&lt;&#x2F;h1&gt;
&lt;p&gt;A &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1ojb87w&#x2F;frustrated_by_lack_of_maintained_crates&#x2F;&quot; target=&quot;_blank&quot;&gt;heated Reddit discussion&lt;&#x2F;a&gt; sparked honest conversations about what &quot;maintenance&quot; really means. The concern? Too many crates haven&#x27;t been touched in years, maintained by solo developers, while Go has corporate-backed libraries. Add FFI wrappers around C libraries, and Rust&#x27;s safety benefits feel like a facade.&lt;&#x2F;p&gt;
&lt;p&gt;But here&#x27;s the twist: the community pushes back hard. User trailing_zero_count shared &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;serde_json_any_key&quot; target=&quot;_blank&quot;&gt;serde_json_any_key&lt;&#x2F;a&gt;—500K downloads, no updates in 3 years, zero issues. Why update? It&#x27;s &lt;strong&gt;done&lt;&#x2F;strong&gt;. fxhash went 8 years without changes because its hash algorithm simply didn&#x27;t need updates. Safe Rust code doesn&#x27;t rot like other languages.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-reality-is-more-complex&quot;&gt;The Reality Is More Complex&lt;&#x2F;h2&gt;
&lt;p&gt;A &lt;a href=&quot;https:&#x2F;&#x2F;00f.net&#x2F;2025&#x2F;10&#x2F;17&#x2F;state-of-the-rust-ecosystem&#x2F;&quot; target=&quot;_blank&quot;&gt;comprehensive October 2025 analysis by Frank Denis&lt;&#x2F;a&gt; reveals the other side: &lt;strong&gt;45.2%&lt;&#x2F;strong&gt; of 200,000+ crates haven&#x27;t been updated in 2+ years, and &lt;strong&gt;249 abandoned dependencies&lt;&#x2F;strong&gt; exist in the top 1,000 most-downloaded crates. quickcheck: unmaintained 4.8 years, 52 dependents. fxhash? Now officially &lt;a href=&quot;https:&#x2F;&#x2F;rustsec.org&#x2F;advisories&#x2F;RUSTSEC-2025-0057.html&quot; target=&quot;_blank&quot;&gt;unmaintained&lt;&#x2F;a&gt;, migrate to rustc-hash.&lt;&#x2F;p&gt;
&lt;p&gt;On FFI wrappers: yes, they depend on C, but battle-tested C libraries have decades of hardening. The Rust wrapper gives &lt;em&gt;your&lt;&#x2F;em&gt; application code, the untested part, memory safety guarantees. Even Python&#x27;s popular libraries wrap C&#x2F;C++. Pure Rust alternatives like &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Eugeny&#x2F;russh&quot; target=&quot;_blank&quot;&gt;russh&lt;&#x2F;a&gt; (1.5M downloads) are emerging, just not at enterprise speed.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;stone-soup-economics&quot;&gt;Stone Soup Economics&lt;&#x2F;h2&gt;
&lt;p&gt;The uncomfortable truth: companies profit from volunteer-maintained open source while contributing little. The solution? &quot;Fork, clone, maintain, push PR during work hours. Not for all crates, just one.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;blog&#x2F;long-term-rust-maintenance&#x2F;&quot; target=&quot;_blank&quot;&gt;Long-term maintenance strategies&lt;&#x2F;a&gt; matter: minimize dependencies, prefer 1.0+ crates, use Dependabot, budget time for upstream contributions. Use Go where it dominates (containerization). Use Rust where it excels (parsing, systems programming, web services).&lt;&#x2F;p&gt;
&lt;p&gt;The debate reflects Rust&#x27;s adolescence. The language is mature; the ecosystem is maturing. The question isn&#x27;t whether to use Rust, but whether your organization can participate not just extract.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;mutex-showdown-when-parking-lot-beats-std-and-when-it-doesn-t&quot;&gt;Mutex Showdown: When parking_lot Beats std (And When It Doesn&#x27;t)&lt;&#x2F;h1&gt;
&lt;p&gt;Think all mutexes are created equal? A &lt;a href=&quot;https:&#x2F;&#x2F;blog.cuongle.dev&#x2F;p&#x2F;inside-rusts-std-and-parking-lot-mutexes-who-win&quot; target=&quot;_blank&quot;&gt;detailed deep-dive by Cuong Le&lt;&#x2F;a&gt; reveals the choice between &lt;code&gt;std::sync::Mutex&lt;&#x2F;code&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Amanieu&#x2F;parking_lot&quot; target=&quot;_blank&quot;&gt;parking_lot&lt;&#x2F;a&gt; is more nuanced than &quot;just use parking_lot.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;std wins&lt;&#x2F;strong&gt; by 9% in short-hold scenarios with moderate contention. &lt;strong&gt;parking_lot dominates&lt;&#x2F;strong&gt; elsewhere: 18.5% faster in bursty workloads, 261.6% higher throughput preventing monopolization, and 49x better fairness under heavy contention (3.67ms vs 188.73ms latency variation).&lt;&#x2F;p&gt;
&lt;p&gt;The starvation problem is dramatic: with one aggressive thread, std showed &lt;strong&gt;95.3% variation&lt;&#x2F;strong&gt; in lock acquisitions—some threads barely got the lock. parking_lot: &lt;strong&gt;1.9% variation&lt;&#x2F;strong&gt;. Why? std&#x27;s futex uses &quot;barging&quot; (any thread grabs the lock), maximizing throughput but causing starvation. parking_lot implements &quot;eventual fairness&quot;—unfair for performance, but forces fair unlocks every ~0.5ms to prevent starvation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Use std&lt;&#x2F;strong&gt; for: low-moderate contention, brief critical sections, no dependencies, debugging panics. &lt;strong&gt;Use parking_lot&lt;&#x2F;strong&gt; for: fairness guarantees, monopolization risk, bursty workloads, predictable latency. Performance isn&#x27;t one-dimensional—sometimes fairness matters more than raw speed.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;predr.ag&#x2F;blog&#x2F;ghosts-in-the-compilation&#x2F;&quot; target=&quot;_blank&quot;&gt;Ghosts in the compilation: debugging cargo-semver-checks build failures that users couldn&#x27;t reproduce&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;signal-app-rust&quot; target=&quot;_blank&quot;&gt;How Signal uses Rust to secure the communications of millions&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.0xshadow.dev&#x2F;posts&#x2F;coding-agent-in-rust&#x2F;coding-agent-in-rust-introduction&#x2F;&quot; target=&quot;_blank&quot;&gt;Building a CLI coding agent from scratch in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;10&#x2F;30&#x2F;Rust-1.91.0&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Release 1.91.0&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>70 - Foundation Moves and Performance Breakthroughs</title>
          <pubDate>Sun, 14 Sep 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-foundation-performance-breakthroughs-2025/</link>
          <guid>https://rust-trends.com/newsletter/rust-foundation-performance-breakthroughs-2025/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-foundation-performance-breakthroughs-2025/">&lt;p&gt;Major developments are reshaping Rust&#x27;s ecosystem landscape. The Rust Foundation launched its Innovation Lab to support critical projects, while performance improvements are accelerating across build tools and compiler optimization. From Mac-specific build gains to structured project goals delivering real results, the ecosystem shows remarkable momentum across all fronts.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;stop-waiting-for-slow-rust-builds-in-ci-sponsored&quot;&gt;Stop waiting for slow Rust builds in CI [sponsored]&lt;&#x2F;h1&gt;
&lt;p&gt;Are your Rust builds painfully slow? With Depot&#x27;s remote caching and accelerated build infrastructure, teams are seeing up to 6x faster Docker builds and dramatically reduced GitHub Actions costs. Their new depot cargo command automatically handles sccache setup and connection to Depot Cache, so you can focus on building great Rust projects faster than ever. &lt;a href=&quot;https:&#x2F;&#x2F;bit.ly&#x2F;4mDKNmf&quot; target=&quot;_blank&quot;&gt;Get the guide to faster Rust builds in CI&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;faster-rust-builds-on-mac&quot;&gt;Faster Rust builds on Mac&lt;&#x2F;h1&gt;
&lt;p&gt;Nicholas Nethercote discovered a simple macOS setting change that dramatically speeds up Rust builds. The key: disable XProtect scanning for Terminal by adding it as a &quot;developer tool&quot; in System Settings. This reduced the Rust compiler test suite from 9m42s to 3m33s.&lt;&#x2F;p&gt;
&lt;p&gt;The fix works because macOS scans every new executable for malware, hitting build scripts and test binaries hardest. After adding Terminal to developer tools, restart your terminal. Build scripts that took 0.48-3.88 seconds now complete in 0.06-0.14 seconds, with similar gains for cargo test and frequent rebuild cycles.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;nnethercote.github.io&#x2F;2025&#x2F;09&#x2F;04&#x2F;faster-rust-builds-on-mac.html&quot; target=&quot;_blank&quot;&gt;Faster Rust builds on Mac analysis&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;rust-compiler-performance-survey-results-reveal-developer-priorities&quot;&gt;Rust Compiler performance survey results reveal developer priorities&lt;&#x2F;h1&gt;
&lt;p&gt;The first-ever Rust compiler performance survey received over 3,700 responses, revealing critical pain points. 45% of former Rust users cited long compile times as a reason for leaving, while 55% of current users wait over 10 seconds for rebuilds. The team found that 60% of developers use cargo check as their primary command after code changes, but cache sharing between cargo check and cargo build remains a major friction point.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;09&#x2F;10&#x2F;rust-compiler-performance-survey-2025-results&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust compiler performance survey 2025 results&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;rust-foundation-launches-innovation-lab-with-rustls&quot;&gt;Rust Foundation launches Innovation Lab with Rustls&lt;&#x2F;h1&gt;
&lt;p&gt;The Rust Foundation announced its Innovation Lab at RustConf 2025, providing governance oversight and fiscal sponsorship for critical projects. Rustls, a modern TLS library emphasizing security and performance, becomes the inaugural project. The lab offers stable infrastructure for key ecosystem tools.&lt;&#x2F;p&gt;
&lt;p&gt;This initiative addresses the sustainability challenge facing essential Rust libraries. With proper funding and governance, projects like Rustls can focus on development rather than maintenance concerns.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;09&#x2F;03&#x2F;welcoming-the-rust-innovation-lab&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Foundation Innovation Lab announcement&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;rust-project-goals-drive-structured-progress-across-ecosystem&quot;&gt;Rust project goals drive structured progress across ecosystem&lt;&#x2F;h1&gt;
&lt;p&gt;The Rust project&#x27;s goal-setting process continues delivering major achievements. &lt;a href=&quot;https:&#x2F;&#x2F;releases.rs&#x2F;docs&#x2F;1.85.0&#x2F;&quot; target=&quot;_blank&quot;&gt;Async closures stabilized in Rust 1.85&lt;&#x2F;a&gt; (February 2025), while &lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-project-goals&#x2F;2025h1&#x2F;rfl.html&quot; target=&quot;_blank&quot;&gt;Linux kernel tooling support&lt;&#x2F;a&gt; advanced with stable compiler flags work.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;inside-rust&#x2F;2025&#x2F;06&#x2F;23&#x2F;project-goals-2025h2-call-for-submissions&#x2F;&quot; target=&quot;_blank&quot;&gt;2025H2 goals submission process&lt;&#x2F;a&gt; recently closed, with proposed initiatives including reflection and comptime, production-ready Cranelift backend, and continued async improvements. The structured approach that delivered the Rust 2024 edition now tackles next-generation language capabilities.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-project-goals&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;Explore the complete Rust project goals program and achievements&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;releases.rs&#x2F;docs&#x2F;1.90.0&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust 1.90.0 beta arrives September 18&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: The upcoming release includes stabilized features from recent RFCs and performance improvements identified in the compiler survey.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;inside-rust&#x2F;2025&#x2F;07&#x2F;21&#x2F;sunsetting-the-rustwasm-github-org&#x2F;&quot; target=&quot;_blank&quot;&gt;rustwasm organization archiving in September&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: The transition marks ecosystem maturity as wasm-bindgen moves to dedicated maintainership, ensuring continuity for WebAssembly development.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>69 - Rust&#x27;s Enterprise Breakthrough Year</title>
          <pubDate>Sun, 31 Aug 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-enterprise-breakthrough-2025/</link>
          <guid>https://rust-trends.com/newsletter/rust-enterprise-breakthrough-2025/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-enterprise-breakthrough-2025/">&lt;p&gt;Welcome back to Rust Trends!&lt;&#x2F;p&gt;
&lt;p&gt;Something remarkable happened while you were enjoying your summer break: Rust quietly crossed the enterprise chasm. We&#x27;re witnessing an adoption surge that only comes once in a programming language&#x27;s lifetime, 68.75% enterprise growth, faster compile times, and Fortune 500 companies betting their infrastructure on memory safety.&lt;&#x2F;p&gt;
&lt;p&gt;This isn&#x27;t just another year for Rust. This is &lt;strong&gt;the&lt;&#x2F;strong&gt; year.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-enterprise-surge-68-75-growth-can-t-be-ignored&quot;&gt;The Enterprise Surge: 68.75% Growth Can&#x27;t Be Ignored&lt;&#x2F;h2&gt;
&lt;p&gt;Let&#x27;s be honest, when AWS, Microsoft, Google, and Meta all doubled down on Rust, we knew something significant was happening. The numbers don&#x27;t lie: commercial Rust usage exploded by &lt;strong&gt;68.75%&lt;&#x2F;strong&gt; between 2021-2024, and throughout 2025 we&#x27;ve seen that trend accelerate. (&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;02&#x2F;13&#x2F;2024-State-Of-Rust-Survey-results&#x2F;&quot; target=&quot;_blank&quot;&gt;Official 2024 State of Rust Survey Results&lt;&#x2F;a&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Shopify&#x27;s Big Move&lt;&#x2F;strong&gt;: Back in 2022, &lt;a href=&quot;https:&#x2F;&#x2F;rustfoundation.org&#x2F;media&#x2F;welcoming-shopify-as-our-inaugural-gold-member&#x2F;&quot; target=&quot;_blank&quot;&gt;Shopify became the Rust Foundation&#x27;s inaugural Gold member&lt;&#x2F;a&gt;, and their commitment continues to grow. Their &lt;a href=&quot;https:&#x2F;&#x2F;shopify.engineering&#x2F;porting-yjit-ruby-compiler-to-rust&quot; target=&quot;_blank&quot;&gt;YJIT Ruby compiler implementation using Rust&lt;&#x2F;a&gt; has been a game-changer for Ruby performance. This isn&#x27;t just about supporting open source; it&#x27;s about betting their infrastructure on Rust&#x27;s future.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The AWS Effect&lt;&#x2F;strong&gt;: Amazon&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;firecracker-microvm.github.io&#x2F;&quot; target=&quot;_blank&quot;&gt;Firecracker microVMs written in Rust&lt;&#x2F;a&gt; continue to prove Rust&#x27;s enterprise readiness. When you&#x27;re managing millions of serverless functions, memory safety isn&#x27;t just nice to have, it&#x27;s mission-critical.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Rust at Microsoft – Security-Driven Push&lt;&#x2F;strong&gt; (May 2025) At Rust Nation UK, Microsoft, &lt;a href=&quot;https:&#x2F;&#x2F;www.infoq.com&#x2F;news&#x2F;2025&#x2F;05&#x2F;microsoft-cto-rust-commitment&#x2F;?utm_source=chatgpt.com&quot; target=&quot;_blank&quot;&gt;Azure CTO Mark Russinovich detailed why Microsoft is scaling Rust adoption&lt;&#x2F;a&gt;. A decade of data showed that 70 percent of security vulnerabilities originated from unsafe memory usage in C&#x2F;C++ code. Rust’s ownership model and memory safety directly address this risk. Microsoft is accelerating its migration from vulnerable C&#x2F;C++ to safer Rust, especially for security-critical infrastructure.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Cloudflare Builds High-Performance AI Inference Engine in Rust&lt;&#x2F;strong&gt; (August 2025)
Cloudflare developed &lt;a href=&quot;https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;cloudflares-most-efficient-ai-inference-engine&#x2F;&quot; target=&quot;_blank&quot;&gt;Infire, a custom LLM inference engine written in Rust&lt;&#x2F;a&gt;. Infire delivers faster inference (up to 7% faster than vLLM) with lower CPU overhead and more efficient GPU utilization. It now powers Llama 3.1 8B on Cloudflare’s edge network. &lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Why Now?&lt;&#x2F;strong&gt;: The primary enterprise use cases tell the story: cloud infrastructure, high-frequency trading, blockchain, and IoT networks. These aren&#x27;t experiments anymore; they&#x27;re production workloads handling billions of requests.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-compilation-revolution-30-faster-builds&quot;&gt;The Compilation Revolution: 30% Faster Builds&lt;&#x2F;h2&gt;
&lt;p&gt;Remember when Rust compile times were the running joke in our community? Those days are fading. The performance improvements this year have been substantial:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;30%+ wall-time reduction&lt;&#x2F;strong&gt; through the new &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;05&#x2F;17&#x2F;enabling-rust-lld-on-linux&#x2F;&quot; target=&quot;_blank&quot;&gt;rust-lld linker&lt;&#x2F;a&gt; as default on Linux, with some benchmarks showing even larger gains.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Automatic cache cleanup&lt;&#x2F;strong&gt; in &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;06&#x2F;26&#x2F;Rust-1.88.0&#x2F;&quot; target=&quot;_blank&quot;&gt;Cargo&lt;&#x2F;a&gt;, so no more manual disk cleanup.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;What Changed?&lt;&#x2F;strong&gt; Recent Rust releases delivered major compiler optimizations, better dependency resolution, and defaulting to faster linkers. The sustained focus on compiler performance is transforming the development experience, making Rust not just safer than C++, but faster to iterate with.&lt;&#x2F;p&gt;
&lt;p&gt;Developer Experience: Faster compilation means tighter feedback loops, more experimentation, and ultimately, a smoother workflow.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;ai-rust-the-unlikely-power-couple&quot;&gt;AI &amp;amp; Rust: The Unlikely Power Couple&lt;&#x2F;h2&gt;
&lt;p&gt;Python still rules machine learning research, but in 2025 Rust has carved out a clear role in production. AI workloads demand predictable performance, tight memory control, and reliability at scale, areas where Rust excels. The result: teams prototype in Python, then deploy with Rust.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Candle&lt;&#x2F;strong&gt; by Hugging Face is a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;huggingface&#x2F;candle&quot; target=&quot;_blank&quot;&gt;Rust-native ML framework built for inference, not training&lt;&#x2F;a&gt;. It’s designed for serverless and edge environments where low latency and small binaries matter.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Burn&lt;&#x2F;strong&gt; is &lt;a href=&quot;https:&#x2F;&#x2F;burn.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;another Rust-based deep learning framework&lt;&#x2F;a&gt;. It focuses on modular design and flexible backends, and is gaining attention for research and experimentation in Rust’s ecosystem.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rust–Python integration&lt;&#x2F;strong&gt; is rising fast. Usage of &lt;a href=&quot;https:&#x2F;&#x2F;pyo3.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust for Python extensions&lt;&#x2F;a&gt; grew 22% year-over-year, showing how teams combine Python’s ergonomics with Rust’s performance in production.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WebAssembly synergy&lt;&#x2F;strong&gt; is giving edge AI new life. Candle already runs models directly in browsers via WASM, delivering near-native performance without a heavyweight runtime.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The Bottom Line: Rust is not replacing Python in AI, but it’s becoming the language of choice for turning research prototypes into production-grade, efficient inference systems.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tooling-spotlight-zed-editor&quot;&gt;Tooling Spotlight: Zed Editor&lt;&#x2F;h2&gt;
&lt;p&gt;Speaking of developer experience, &lt;a href=&quot;https:&#x2F;&#x2F;zed.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Zed code editor&lt;&#x2F;a&gt; has been making waves this year. This Rust-written editor has been challenging VS Code&#x27;s dominance, and the performance difference is noticeable. The collaborative features have proven innovative.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Why It Matters&lt;&#x2F;strong&gt;: When developers increasingly choose tools written in Rust for their daily workflow, it reflects the language&#x27;s maturity and ecosystem health.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;looking-ahead-the-rust-vision-doc&quot;&gt;Looking Ahead: The Rust Vision Doc&lt;&#x2F;h2&gt;
&lt;p&gt;The Rust team has been developing a high-level roadmap for the next few years. With the language&#x27;s 10-year anniversary having passed this May (May 15, 2025), this year has been perfect for reflecting on how far we&#x27;ve come and where we&#x27;re heading.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2025 Focus&lt;&#x2F;strong&gt;: Rust’s H1 2025 efforts prioritized stabilizing compiler flags and tooling rather than launching new language features—a maturity-oriented shift that enterprises wanted to see. The language’s broader adoption in sectors like cloud, AI, and embedded systems suggests Rust’s role is expanding beyond traditional systems programming and more becoming a foundational language for enterprise infrastructure.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.tiobe.com&#x2F;tiobe-index&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust programming language hits #13 on TIOBE Index&lt;&#x2F;a&gt; (February 2025 peak) and currently at #18&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;docs&#x2F;trusted-publishing&quot; target=&quot;_blank&quot;&gt;Crates.io Trusted Publishing with OpenID Connect&lt;&#x2F;a&gt; for secure CI&#x2F;CD pipelines&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;the-inflection-point&quot;&gt;The Inflection Point&lt;&#x2F;h2&gt;
&lt;p&gt;Looking at the data from 2024&#x2F;2025, one thing becomes crystal clear: we&#x27;re witnessing Rust&#x27;s transition from &quot;promising systems language&quot; to &quot;essential enterprise technology.&quot; The 68.75% adoption surge isn&#x27;t just growth it&#x27;s validation of a fundamental shift in how we think about systems programming.&lt;&#x2F;p&gt;
&lt;p&gt;The Perfect Storm: Three factors converged this year to create Rust&#x27;s breakthrough moment:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Enterprise readiness&lt;&#x2F;strong&gt; through proven production deployments&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Developer productivity&lt;&#x2F;strong&gt; via faster compile times&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Market timing&lt;&#x2F;strong&gt; as AI workloads demand memory-safe performance&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The combination of memory safety, performance, and ecosystem maturity has proven compelling. With compile times now faster and performance comparable to C++, the business case has written itself.&lt;&#x2F;p&gt;
&lt;p&gt;But here&#x27;s what excites me most: we&#x27;re still in the early innings. If this is what Rust adoption looks like when the language is still evolving, imagine the landscape in 2026.&lt;&#x2F;p&gt;
&lt;p&gt;What are you building with Rust this year? Hit reply and let me know, I love hearing about real-world Rust projects, and your stories often become the insights that shape these newsletters!&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;

&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Want to sponsor Rust Trends? We reach thousands of Rust developers biweekly. &lt;a href=&quot;mailto:contact@rust-trends.com&quot;&gt;Get in touch!&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>68 - Special: Rust Your Way Through Summer - Join the Coding Contest &amp; Win Prizes!</title>
          <pubDate>Tue, 01 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/join-the-rust-programming-contest-win-a-keychron-q1-airpods-pro-2-or-oura-ring-4/</link>
          <guid>https://rust-trends.com/newsletter/join-the-rust-programming-contest-win-a-keychron-q1-airpods-pro-2-or-oura-ring-4/</guid>
          <description xml:base="https://rust-trends.com/newsletter/join-the-rust-programming-contest-win-a-keychron-q1-airpods-pro-2-or-oura-ring-4/">&lt;br&gt;
&lt;p&gt;While you&#x27;re soaking up the sun or taking a well-earned summer break, why not squeeze in some Rust? We are launching the &lt;strong&gt;Rust-Trends Contest&lt;&#x2F;strong&gt; on CodeCrafters from &lt;strong&gt;July 1 to August 1&lt;&#x2F;strong&gt; — the perfect way to make your summer both relaxing and productive.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-is-the-rust-trends-summer-contest&quot;&gt;What is the Rust-Trends Summer Contest?&lt;&#x2F;h2&gt;
&lt;p&gt;This is a Rust programming contest run with CodeCrafters, where you’ll solve hands-on coding challenges, like &lt;strong&gt;building your own shell&lt;&#x2F;strong&gt;,  and earn points as you go.&lt;&#x2F;p&gt;
&lt;p&gt;It’s all about real-world Rust, community spirit, and a touch of summer competition.&lt;&#x2F;p&gt;
&lt;p&gt;Join here: &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join_team?invite_code=a207679ba061d1e4&quot; target=&quot;_blank&quot;&gt;Rust-Trends Team on CodeCrafters&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-it-works&quot;&gt;How It Works&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Complete coding stages to earn points:
&lt;ul&gt;
&lt;li&gt;Very Easy: 5 pts&lt;&#x2F;li&gt;
&lt;li&gt;Easy: 15 pts&lt;&#x2F;li&gt;
&lt;li&gt;Medium: 30 pts&lt;&#x2F;li&gt;
&lt;li&gt;Hard: 50 pts&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Points count only once per unique stage (per person, not per language).&lt;&#x2F;li&gt;
&lt;li&gt;Score resets after the contest ends on August 1.&lt;&#x2F;li&gt;
&lt;li&gt;Top 15 show up on the leaderboard.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;prizes-for-the-top-rustacean&quot;&gt;Prizes for the Top Rustacean&lt;&#x2F;h2&gt;
&lt;p&gt;The highest scorer on August 1 gets to choose one of:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keychron Q1 Pro&lt;&#x2F;strong&gt; (for the keyboard connoisseurs)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Oura Ring 4 Black&lt;&#x2F;strong&gt; (wellness meets developer life)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Apple AirPods Pro 2&lt;&#x2F;strong&gt; (code in noise-cancelling peace)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You’ll need a &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;CodeCrafters subscription - 40% OFF&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; to be eligible for prizes, but participation is open to everyone. Just want to build and learn Rust this summer? That’s totally fine too, e.g. the build your own shell challenge is completely free this month.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;make-this-summer-count&quot;&gt;Make This Summer Count&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Build real, portfolio-worthy Rust projects&lt;&#x2F;li&gt;
&lt;li&gt;Learn at your own pace, whether you&#x27;re at the beach or your desk&lt;&#x2F;li&gt;
&lt;li&gt;Subscription might be reimbursable by your employer&lt;&#x2F;li&gt;
&lt;li&gt;You’ll also be supporting Rust-Trends if you go premium, use this &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;referral link to get 40% off&lt;&#x2F;a&gt; ❤️&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;play-it-straight&quot;&gt;Play It Straight&lt;&#x2F;h2&gt;
&lt;p&gt;CodeCrafters has strong anti-cheat protections in place. Any funny business leads to a &lt;strong&gt;1-year ban&lt;&#x2F;strong&gt;. Let’s keep it cool and code clean.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;I&#x27;ll be following the &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;contests&#x2F;rust-trends-1&quot; target=&quot;_blank&quot;&gt;leaderboard&lt;&#x2F;a&gt; and sharing community highlights during July. It’s a chill but competitive way to sharpen your skills this summer.&lt;&#x2F;p&gt;
&lt;p&gt;Ready to Rust your way through the holidays?&lt;&#x2F;p&gt;
&lt;p&gt;Catch you on the leaderboard 🦀&lt;&#x2F;p&gt;
&lt;p&gt;Cheers,
Bob&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>67 - Untangling Rust Errors &amp; the bzip2 Rewrite</title>
          <pubDate>Sun, 22 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/untangling-rust-errors-the-bzip2-rewrite/</link>
          <guid>https://rust-trends.com/newsletter/untangling-rust-errors-the-bzip2-rewrite/</guid>
          <description xml:base="https://rust-trends.com/newsletter/untangling-rust-errors-the-bzip2-rewrite/">&lt;br&gt;
Ever stared at a 500-line error enum and wondered where it all went wrong? This week we&#x27;re diving into error organization (because yes, there&#x27;s actually a right way to do it). Plus, bzip2 goes full-Rust and the compiler team wants your performance feedback.
&lt;p&gt;Let&#x27;s jump in.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deep-dive-organizing-errors-without-losing-your-mind&quot;&gt;Deep Dive – Organizing Errors Without Losing Your Mind&lt;&#x2F;h2&gt;
&lt;p&gt;Let&#x27;s be honest, Rust&#x27;s error system is powerful, but once your project gets big, it can turn into spaghetti. Two great writeups tackle this: &lt;a href=&quot;https:&#x2F;&#x2F;sabrinajewson.org&#x2F;blog&#x2F;errors&quot; target=&quot;_blank&quot;&gt;Sabrina Jewson&lt;&#x2F;a&gt; shares how to modularize errors in medium-sized codebases, and &lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;rust-organize-errors-large-projects&quot; target=&quot;_blank&quot;&gt;Sylvain Kerkour&lt;&#x2F;a&gt; dives into managing errors across large, multi-crate systems.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-problem&quot;&gt;The Problem&lt;&#x2F;h3&gt;
&lt;p&gt;A single Error enum for everything starts out fine… until it bloats. You lose context, leak internal details, and tightly couple your modules. Suddenly, moving one module breaks everything.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;sabrina-s-approach-modular-errors&quot;&gt;Sabrina&#x27;s Approach: Modular Errors&lt;&#x2F;h4&gt;
&lt;p&gt;Keep errors local. Each module defines its own error enum. Only expose higher-level errors at public boundaries.&lt;&#x2F;p&gt;
&lt;p&gt;Why it works:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Keeps context specific&lt;&#x2F;li&gt;
&lt;li&gt;Avoids leaky abstractions&lt;&#x2F;li&gt;
&lt;li&gt;Encourages clean, reusable modules&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Takeaway: Let your modules own their errors. It&#x27;s like keeping tools in the right drawer.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;sylvain-s-approach-scalable-crate-level-errors&quot;&gt;Sylvain&#x27;s Approach: Scalable Crate-Level Errors&lt;&#x2F;h4&gt;
&lt;p&gt;For bigger systems, define per-crate errors and bubble them up with context using tools like snafu.&lt;&#x2F;p&gt;
&lt;p&gt;Why it works:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Maintains backtrace and call context&lt;&#x2F;li&gt;
&lt;li&gt;Keeps crate boundaries clean&lt;&#x2F;li&gt;
&lt;li&gt;Scales well with many moving parts&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Takeaway: Wrap errors up the stack with context. Your future self debugging a production issue will thank you.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;my-3-key-takeaways&quot;&gt;My 3 Key Takeaways:&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Start modular: Even small projects benefit from localized error types&lt;&#x2F;li&gt;
&lt;li&gt;Scale with context: Use crates like &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;snafu&quot; target=&quot;_blank&quot;&gt;snafu&lt;&#x2F;a&gt; or &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;thiserror&quot; target=&quot;_blank&quot;&gt;thiserror&lt;&#x2F;a&gt; to add clarity without boilerplate&lt;&#x2F;li&gt;
&lt;li&gt;Errors are architecture: Clean error design helps you reason about your system as a whole&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Got a project that&#x27;s growing fast? This is the moment to invest in smart error handling—it&#x27;ll save you hours later.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;bzip2-goes-all-rust&quot;&gt;bzip2 Goes All-Rust&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;trifectatech.org&#x2F;blog&#x2F;bzip2-crate-switches-from-c-to-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;bzip2 crate&lt;&#x2F;a&gt; just dropped C and went full-Rust with version 0.6.0, thanks to the Trifecta Tech Foundation. Under the hood, it now defaults to libbz2-rs-sys—a pure Rust reimplementation. The old C version? Still there if you need it, but Rust is the new default.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-this-rocks&quot;&gt;Why This Rocks&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Faster&lt;&#x2F;strong&gt;: Compression is ~10–15% quicker, decompression ~5–10%. Real, measurable gains&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cross-compilation friendly&lt;&#x2F;strong&gt;: No more dealing with C toolchains. WebAssembly, Android, Windows, it all just works&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Clean &amp;amp; Safe&lt;&#x2F;strong&gt;: MIRI-compliant, symbol-safe, and audited by Radically Open Security&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;If your project depends on .bz2, this update gives you speed, simplicity, and less C-induced pain. It&#x27;s a drop-in upgrade with real perks.&lt;&#x2F;p&gt;
&lt;p&gt;What I love here is how this project takes a crusty old C tool and gives it new life in Rust, without breaking things or adding complexity. It&#x27;s a solid reminder that &quot;rewrite in Rust&quot; can actually work—especially when done with care.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;community-call-rust-compiler-performance-survey-2025&quot;&gt;Community Call – Rust Compiler Performance Survey 2025&lt;&#x2F;h2&gt;
&lt;p&gt;Rust compile times still too slow for your taste? Now&#x27;s your chance to help fix that. The Rust team just launched the 2025 Compiler Performance Survey, and they want your feedback on how rustc performs in the real world.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s quick (about 10 minutes), totally anonymous, and open until July 7. Whether you&#x27;re a daily cargo build warrior or just annoyed by slow incremental builds, your input will help shape future compiler improvements.&lt;&#x2F;p&gt;
&lt;p&gt;👉 &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;06&#x2F;16&#x2F;rust-compiler-performance-survey-2025&#x2F;&quot; target=&quot;_blank&quot;&gt;Take the survey here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s help make Rust compile faster than your morning coffee brew.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;zed.dev&#x2F;blog&#x2F;debugger&quot; target=&quot;_blank&quot;&gt;Zed Debugger&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.efinancialcareers.com&#x2F;news&#x2F;rust-replacing-c-programming-language-hedge-fund?_bhlid=f1533afd4f488671c72d3c031c6cb50189713c84&quot; target=&quot;_blank&quot;&gt;Rust replacing C programming language&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blogs.gnome.org&#x2F;sophieh&#x2F;2025&#x2F;06&#x2F;13&#x2F;making-gnomes-gdkpixbuf-image-loading-safer&#x2F;&quot; target=&quot;_blank&quot;&gt;Making GDKPixbuf image loading safer&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>66 - Rust, Rewinded: Debug Smarter, Build Faster</title>
          <pubDate>Sun, 08 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-rewinded-debug-smarter-build-faster/</link>
          <guid>https://rust-trends.com/newsletter/rust-rewinded-debug-smarter-build-faster/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-rewinded-debug-smarter-build-faster/">&lt;br&gt;
Ever feel like you’re writing Rust with one hand tied behind your back while a C programmer whispers outdated advice in your ear? This week, we’re kicking things off with a guide that actually gets you, and no, it doesn’t start with “first, write a memory allocator.” We’ve also got a wild experiment trying to make Rust’s link times faster than your coffee maker. And if you’ve ever dreamed of debugging by jumping back in time, you’re gonna want to see what’s cooking there. So pour something strong, get comfy, and let’s get into it.
&lt;p&gt;Let’s dive in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-for-c-programmers&quot;&gt;Rust for C Programmers&lt;&#x2F;h2&gt;
&lt;p&gt;As someone who came into Rust with a C background already under my belt, I found Rust for C Programmers to be a neat project, well thought out and refreshingly to-the-point. It’s a resource that respects your experience, trims the fat, and walks you through Rust’s more mind-bending features without over-explaining the obvious.&lt;&#x2F;p&gt;
&lt;p&gt;You can read it online at &lt;a href=&quot;https:&#x2F;&#x2F;rust-for-c-programmers.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust for C programmers&lt;&#x2F;a&gt;, and it’s entirely free.&lt;&#x2F;p&gt;
&lt;p&gt;What sparked my interest wasn’t just the book itself, but also a recent Reddit thread that brought it back into the spotlight. Folks over at &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1kwml10&#x2F;the_online_version_of_the_book_rust_for_c&#x2F;&quot; target=&quot;_blank&quot;&gt;&#x2F;r&#x2F;rust&lt;&#x2F;a&gt; had a good mix of appreciation and critique. Some praised the clean structure and practical focus, while others wished it were a bit shorter or included async and macro chapters (which are apparently in the works). It was clear from the comments that the book fills a very real need: bridging the mental model of C with the safety and modern features of Rust.&lt;&#x2F;p&gt;
&lt;p&gt;The book itself is around 500 pages, but it reads faster than you’d think. It skips hand-holding and dives straight into how Rust approaches memory, ownership, and lifetimes differently. What I liked most is that it doesn’t try to be an exhaustive Rust encyclopedia. It knows its audience. It skips compiler internals and focuses on what actually matters when you’re coming from a background of malloc, pointers, and structs.&lt;&#x2F;p&gt;
&lt;p&gt;If you’re already comfortable with systems-level thinking and want a Rust book that talks your language, this is worth a read. Whether you’re just testing the waters or sharpening your understanding, it hits a nice balance of technical depth and straight talk.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;faster-linking-for-rust-david-lattimore-s-mission-to-make-compilation-snappy-again&quot;&gt;Faster Linking for Rust: David Lattimore’s Mission to Make Compilation Snappy Again&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;what-if-your-rust-builds-finished-before-you-stood-up-to-get-coffee&quot;&gt;What if your Rust builds finished before you stood up to get coffee?&lt;&#x2F;h3&gt;
&lt;p&gt;That’s the vision David Lattimore is chasing. On a self-imposed sabbatical, he’s doing something most developers wouldn’t dare: writing a new Linux linker from scratch, tailored for performance, especially during development cycles. It’s called Wild, and it might just change how fast Rust compiles feel for all of us.&lt;&#x2F;p&gt;
&lt;p&gt;In a compelling &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=zwO3Vnp7DrY&quot; target=&quot;_blank&quot;&gt;podcast episode&lt;&#x2F;a&gt;, David walks through the technical motivations behind Wild, how linking really works, and why it remains such a huge bottleneck for Rust builds, especially at the end of a long dependency chain. Meanwhile, the &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1l3kagf&#x2F;podcast_david_lattimore_faster_linker_faster&#x2F;&quot; target=&quot;_blank&quot;&gt;Reddit thread&lt;&#x2F;a&gt; highlights just how excited the community is to finally see an alternative that puts developer speed first.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-wild-matters&quot;&gt;Why Wild matters&lt;&#x2F;h3&gt;
&lt;p&gt;David started Wild in late 2023, and is still going strong, aiming for three things:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Speed: Link times are often the slowest part of the Rust build process. Wild is explicitly built for low-latency, parallelized linking.&lt;&#x2F;li&gt;
&lt;li&gt;Compatibility: It works today with Clang and supports most real-world linker flags.&lt;&#x2F;li&gt;
&lt;li&gt;Incrementality: Although not yet implemented, it’s part of the long-term vision to make linking more dynamic and modular.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Despite being early-stage, Wild is already usable. David has been dogfooding it for six months on his own Rust projects. And even better: it’s open source and welcoming contributors.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;technical-deep-dives&quot;&gt;Technical Deep Dives&lt;&#x2F;h3&gt;
&lt;p&gt;The episode also peels back the curtain on:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;What a linker actually does (hint: it’s not just fusing binaries).&lt;&#x2F;li&gt;
&lt;li&gt;Why debug info bloats memory usage.&lt;&#x2F;li&gt;
&lt;li&gt;The intricacies of cross-compilation and relocations.&lt;&#x2F;li&gt;
&lt;li&gt;When to return Result vs. panic! in systems code.&lt;&#x2F;li&gt;
&lt;li&gt;How linker flag complexity evolved over decades (and why David ignores most of them unless they’re used in the wild, pun intended).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;One of the most fascinating takeaways: Rust and its ecosystem still rely heavily on C&#x2F;C++ toolchains at the linking stage. Wild aims to bring some Rust-native speed and modularity to that last mile of compilation.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;takeaways&quot;&gt;Takeaways&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Wild is real: And already usable if you’re on Linux and can configure your toolchain to use Clang.&lt;&#x2F;li&gt;
&lt;li&gt;Linking is still a black box for most developers — but it doesn’t have to be.&lt;&#x2F;li&gt;
&lt;li&gt;Rust enables fearless, multithreaded systems programming — Wild’s architecture is a showcase for what Rust makes possible.&lt;&#x2F;li&gt;
&lt;li&gt;There’s room to contribute: If you want to help, Wild’s repo is open, and David welcomes contributors.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;blockquote&gt;
&lt;p&gt;“I want to regain that feeling of spontaneity and instantaneousness in a compiled language like Rust.”&lt;&#x2F;p&gt;
&lt;p&gt;— David Lattimore&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;If you’ve ever waited on a slow cargo build, Wild might be the breath of fresh air you didn’t know you needed. Keep an eye on it and maybe even contribute.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;firedbg-rust-debugging-but-with-a-rewind-button&quot;&gt;FireDBG, Rust Debugging, but with a Rewind Button&lt;&#x2F;h2&gt;
&lt;p&gt;I came across a project recently that’s worth your radar: &lt;a href=&quot;https:&#x2F;&#x2F;firedbg.sea-ql.org&#x2F;&quot; target=&quot;_blank&quot;&gt;FireDBG&lt;&#x2F;a&gt;, a time-travel visual debugger made specifically for Rust, by the folks over at SeaQL. The idea behind it is simple but powerful—debug your program like it’s a movie. Step forward, step backward, pause, rewind, and see exactly how things played out, all in a structured visual call tree.&lt;&#x2F;p&gt;
&lt;p&gt;What caught my attention is how it tries to solve a real pain point in debugging Rust: context. Not just what went wrong, but how your program got there. FireDBG records execution into a .firedbg.ss file that you can load in Visual Studio Code with their extension. It lets you explore function calls, variable states, and thread activity across the full timeline of a run. And yes, you can go backwards.&lt;&#x2F;p&gt;
&lt;p&gt;There’s also a CLI version if you’re not into visual tools, but the VS Code integration seems to be where the main experience is built. They even provide a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;SeaQL&#x2F;FireDBG.Rust.Testbench&quot; target=&quot;_blank&quot;&gt;testbench repo&lt;&#x2F;a&gt; to help you try it out without wiring up your own project first.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;SeaQL&#x2F;FireDBG.for.Rust&quot; target=&quot;_blank&quot;&gt;GitHub repo&lt;&#x2F;a&gt; shows they’ve put serious thought into it, plenty of documentation, a clean design, and an emphasis on usability. There&#x27;s also been some chatter on &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;18fz013&#x2F;introducing_firedbg_a_time_travel_visual_debugger&#x2F;&quot; target=&quot;_blank&quot;&gt;&#x2F;r&#x2F;rust&lt;&#x2F;a&gt; that echoes the same sentiment: this isn’t just a clever demo. It’s a real attempt at giving Rust developers modern debugging tools.&lt;&#x2F;p&gt;
&lt;p&gt;Even if you’re not jumping to use it today, it’s the kind of project that pushes Rust tooling in the right direction. Definitely something to keep an eye on, especially if your current debugging strategy still involves a lot of println!.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.evolvebenchmark.com&#x2F;blog-posts&#x2F;how-we-wrap-external-c-and-cpp-libraries-in-rust&quot; target=&quot;_blank&quot;&gt;How we wrap external C and C++ libraries in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;d34dl0ck.me&#x2F;rust-bites-designing-error-types-in-rust-libraries&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;Designing Error Types in Rust Libraries&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rivet.gg&#x2F;blog&#x2F;2025-06-02-faster-route-propagation-by-rewriting-our-traefik-gateway-in-rust&quot; target=&quot;_blank&quot;&gt;2,000x faster route propagation by rewriting our Traefik gateway in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Cross-Compiling for Raspberry Pi with Docker</title>
          <pubDate>Fri, 25 Apr 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/cross-compiling-for-raspberry-pi-with-docker/</link>
          <guid>https://rust-trends.com/posts/cross-compiling-for-raspberry-pi-with-docker/</guid>
          <description xml:base="https://rust-trends.com/posts/cross-compiling-for-raspberry-pi-with-docker/">&lt;p&gt;So, I recently had to cross-compile a Rust project targeting a Raspberry Pi 4. Now, if you&#x27;ve ever wrestled with getting all the right libraries, sysroots, and toolchains lined up for ARM64, you know it can get messy faster than a &lt;code&gt;cargo check&lt;&#x2F;code&gt; on a broken dependency tree.&lt;&#x2F;p&gt;
&lt;p&gt;Instead of going down the rabbit hole of manually setting up sysroots or trying to copy over dev libraries from my Pi (been there, done that), I spun up a Docker container to emulate the environment. Not only did this isolate all the dependencies neatly, but it also let me keep my host setup clean and reproducible.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-dockerfile&quot;&gt;The Dockerfile&lt;&#x2F;h2&gt;
&lt;p&gt;We start from &lt;code&gt;debian:bookworm-slim&lt;&#x2F;code&gt; and install a bunch of goodies:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;gcc-aarch64-linux-gnu&lt;&#x2F;code&gt; toolchain for compiling to ARM64&lt;&#x2F;li&gt;
&lt;li&gt;Rust via &lt;code&gt;rustup&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Dev libraries like &lt;code&gt;libasound2-dev&lt;&#x2F;code&gt; and &lt;code&gt;libssl-dev&lt;&#x2F;code&gt; (which my project needed)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;We also add the &lt;code&gt;aarch64-unknown-linux-gnu&lt;&#x2F;code&gt; Rust target and set up the linker to match.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;dockerfile&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-dockerfile &quot;&gt;&lt;code class=&quot;language-dockerfile&quot; data-lang=&quot;dockerfile&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;FROM&lt;&#x2F;span&gt;&lt;span&gt; debian:bookworm-slim
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;RUN &lt;&#x2F;span&gt;&lt;span&gt;apt-get update &amp;amp;&amp;amp; apt-get install -y \
&lt;&#x2F;span&gt;&lt;span&gt;    curl gcc-aarch64-linux-gnu build-essential pkg-config \
&lt;&#x2F;span&gt;&lt;span&gt;    libasound2-dev libssl-dev ca-certificates \
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;amp;&amp;amp; rm -rf &#x2F;var&#x2F;lib&#x2F;apt&#x2F;lists&#x2F;*
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;RUN &lt;&#x2F;span&gt;&lt;span&gt;curl https:&#x2F;&#x2F;sh.rustup.rs -sSf | sh -s -- -y
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;ENV &lt;&#x2F;span&gt;&lt;span&gt;PATH=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;root&#x2F;.cargo&#x2F;bin:${PATH}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;RUN &lt;&#x2F;span&gt;&lt;span&gt;rustup target add aarch64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;ENV &lt;&#x2F;span&gt;&lt;span&gt;CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;WORKDIR &lt;&#x2F;span&gt;&lt;span&gt;&#x2F;workspace
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To build the image, you need to have &lt;a href=&quot;https:&#x2F;&#x2F;www.docker.com&#x2F;&quot;&gt;Docker&lt;&#x2F;a&gt; installed and standing in the same directory as the Dockerfile.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span&gt; rust-pi-cross .
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And to jump inside the container and open a shell, in this case bash:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span&gt; run&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --rm -it -v&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;your&#x2F;project&#x2F;path:&#x2F;workspace rust-pi-cross bash
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#x2F;your&#x2F;project&#x2F;path&lt;&#x2F;code&gt; the location of your project on your host machine.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;&#x2F;workspace&lt;&#x2F;code&gt; the location of your project inside the container.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;rust-pi-cross&lt;&#x2F;code&gt; the name of the Docker image.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;bash&lt;&#x2F;code&gt; the command to run inside the container.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Inside the container, just cd into your project and run:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Inside the container
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --release --target&lt;&#x2F;span&gt;&lt;span&gt; aarch64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;why-docker&quot;&gt;Why Docker?&lt;&#x2F;h2&gt;
&lt;p&gt;You can cross-compile without Docker using cross or manually installing sysroots, but I liked this approach because:
•	I needed dev versions of libasound2, and this gave me a full Debian userland to work with.
•	It’s reproducible. Anyone on the team can build the same image and get the exact same result.
•	No pollution on my host machine—bliss.&lt;&#x2F;p&gt;
&lt;p&gt;The resulting binary lives inside the container at:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Inside the container
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;&#x2F;workspace&#x2F;target&#x2F;aarch64-unknown-linux-gnu&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;your-binary&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or on your host machine via the mounted volume:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## On your host machine
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;&#x2F;your&#x2F;project&#x2F;path&#x2F;target&#x2F;aarch64-unknown-linux-gnu&#x2F;release&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;your-binary&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That is it for this short tutorial. Let me know what your thoughts are on this approach and drop a message.&lt;&#x2F;p&gt;
&lt;center&gt;
&lt;h2 id=&quot;share&quot;&gt;Share&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;news.ycombinator.com&#x2F;submitlink?u=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;cross-compiling-for-raspberry-pi-with-docker&#x2F;&quot;&gt;Hacker News&lt;&#x2F;a&gt;    &lt;a href=&quot;https:&#x2F;&#x2F;reddit.com&#x2F;r&#x2F;rust&#x2F;submit?url=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;cross-compiling-for-raspberry-pi-with-docker&#x2F;&quot;&gt;Reddit&lt;&#x2F;a&gt;   &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;shareArticle?mini=true&amp;amp;url=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;cross-compiling-for-raspberry-pi-with-docker&#x2F;&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;center&gt;
</description>
      </item>
      <item>
          <title>Ferrocene Language Specification Donated to the Rust Project</title>
          <pubDate>Sat, 29 Mar 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/ferrocene-language-specification-donated-to-the-rust-project/</link>
          <guid>https://rust-trends.com/posts/ferrocene-language-specification-donated-to-the-rust-project/</guid>
          <description xml:base="https://rust-trends.com/posts/ferrocene-language-specification-donated-to-the-rust-project/">&lt;p&gt;Ferrous Systems recently donated the &lt;a href=&quot;https:&#x2F;&#x2F;spec.ferrocene.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Ferrocene Language Specification&lt;&#x2F;a&gt; (&lt;strong&gt;FLS&lt;&#x2F;strong&gt;) to the Rust Project, marking a significant milestone toward formalizing the Rust programming language. This article explains the impact and importance of this contribution.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-is-the-ferrocene-language-specification&quot;&gt;What is the Ferrocene Language Specification?&lt;&#x2F;h2&gt;
&lt;p&gt;The Ferrocene Language Specification provides a detailed, formal description of Rust’s syntax, semantics, and compiler behavior. Originally developed by &lt;a href=&quot;https:&#x2F;&#x2F;ferrous-systems.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Ferrous Systems&lt;&#x2F;a&gt; in 2022 to meet the demands of safety-critical software certification, the FLS precisely documents how Rust behaves, especially the subset supported by Ferrocene, a Rust compiler designed for regulated industries.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;about-ferrous-systems-and-the-rust-foundation&quot;&gt;About Ferrous Systems and the Rust Foundation&lt;&#x2F;h2&gt;
&lt;p&gt;Ferrous Systems has been deeply involved in the Rust ecosystem, providing consulting and tooling tailored for safety-critical industries. Recognizing the importance of a formal specification, Ferrous developed the FLS to support Rust’s adoption in regulated domains.&lt;&#x2F;p&gt;
&lt;p&gt;The Rust Foundation, the nonprofit steward of Rust, facilitated this donation, recognizing it as a crucial step toward an official Rust specification. This collaborative effort now positions Rust alongside languages like C and C++, which already have formal standards.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;implications-for-rust-s-future&quot;&gt;Implications for Rust’s Future&lt;&#x2F;h2&gt;
&lt;p&gt;With the integration of the Ferrocene specification, Rust moves closer to having an authoritative standard document. This helps:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Standardization:&lt;&#x2F;strong&gt; Rust gains clarity and consistency, making future changes more transparent and predictable. Whereas Rust previously relied on “the compiler is the spec”&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Improved Tooling:&lt;&#x2F;strong&gt; Compiler developers, linters, and analysis tools benefit from a formal reference, enabling more robust tooling and ecosystem support.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Safety-Critical Adoption:&lt;&#x2F;strong&gt; Companies working in safety-critical sectors such as automotive or aerospace can now more easily certify Rust-based applications, removing a key barrier to adoption.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;key-takeaways-for-developers-and-the-community&quot;&gt;Key Takeaways for Developers and the Community&lt;&#x2F;h2&gt;
&lt;p&gt;For Rust developers, an official specification will serve as a definitive guide, improving clarity, stability, and confidence, especially when writing complex or unsafe code.&lt;&#x2F;p&gt;
&lt;p&gt;Companies benefit from a clearer certification path, encouraging broader enterprise and critical infrastructure adoption of Rust.&lt;&#x2F;p&gt;
&lt;p&gt;The open-source community gains a single, unified specification, reducing confusion and fostering trust. Ferrous Systems&#x27; donation emphasizes the collaborative strength of Rust’s ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;In summary, Ferrous Systems&#x27; donation of the Ferrocene specification is a significant leap forward for Rust, solidifying its place as a robust, trustworthy language for both everyday and safety-critical applications.&lt;&#x2F;p&gt;
&lt;p&gt;If you want to read more about this on Reddit, a post started by Steve Klabnik, you can find it &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1jkfovo&#x2F;ferrous_systems_donates_ferrocene_language&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>60 - From DNS Servers to JSON Speed: What’s New in Rust</title>
          <pubDate>Sun, 02 Mar 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/from-dns-servers-to-json-speed-what-s-new-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/from-dns-servers-to-json-speed-what-s-new-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/from-dns-servers-to-json-speed-what-s-new-in-rust/">&lt;br&gt;
We’ve got another exciting edition of Rust Trends lined up for you. This week, we’re diving into practical Rust projects like building a DNS server, exploring advanced concepts like sans I&#x2F;O design with the 9p protocol, and learning how to speed up JSON decoding with the Arrow-rs library. Plus, we’ve got some great community content, from astrodynamics in Rust to switching from Python to Rust insights.
&lt;p&gt;Whether you’re here for new features, project inspiration, or a dose of Rusty goodness, there’s something for everyone. Let’s jump right in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-a-dns-server-in-rust-behind-the-scenes&quot;&gt;Building a DNS Server in Rust: Behind the Scenes&lt;&#x2F;h2&gt;
&lt;p&gt;Ever wondered what it takes to build a DNS server from scratch? In collaboration with Codecrafters, &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;building-a-dns-server-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;my latest blog&lt;&#x2F;a&gt; post takes you on a deep dive into creating a DNS server using Rust. This post covers everything from parsing packets to handling requests efficiently, and if you’re up for a challenge yourself, you can try Codecrafters for free!&lt;&#x2F;p&gt;
&lt;p&gt;By using &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join-track&#x2F;rust?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;my referral&lt;&#x2F;a&gt; link when signing up, you’ll not only support my content but also get hands-on with awesome coding challenges. Check it out!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-s-next-ergonomic-boost-async-closures-if-let-while-chains&quot;&gt;Rust’s Next Ergonomic Boost: Async Closures &amp;amp; If&#x2F;Let While Chains&lt;&#x2F;h2&gt;
&lt;p&gt;This week, I stumbled upon a fascinating read: &lt;a href=&quot;https:&#x2F;&#x2F;www.sminez.dev&#x2F;socrates-is-a-state-machine&#x2F;&quot; target=&quot;_blank&quot;&gt;“Socrates is a state machine”&lt;&#x2F;a&gt; on Reddit. The article dives into how Rust’s async&#x2F;await can be used to build a state machine for the 9p protocol, using a “sans I&#x2F;O” design.&lt;&#x2F;p&gt;
&lt;p&gt;But what does all this mean? “Sans I&#x2F;O” is all about keeping protocol logic separate from input&#x2F;output operations, making your code more flexible and testable. The 9p protocol, originally from Plan 9 OS, is used for networked file systems, think of it like a messenger that helps different systems share files seamlessly.&lt;&#x2F;p&gt;
&lt;p&gt;If you’re into building modular and reusable code, this is a must-read!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;fast-columnar-json-decoding-with-arrow-rs&quot;&gt;Fast Columnar JSON Decoding with Arrow-rs&lt;&#x2F;h2&gt;
&lt;p&gt;If you’ve ever felt the pain of slow JSON deserialization in streaming applications, this one’s for you! In their latest article, &lt;a href=&quot;https:&#x2F;&#x2F;www.arroyo.dev&#x2F;blog&#x2F;fast-arrow-json-decoding&quot; target=&quot;_blank&quot;&gt;“Fast columnar JSON decoding”&lt;&#x2F;a&gt;, Arroyo dives into how the arrow-rs library can supercharge performance by using a columnar data format.&lt;&#x2F;p&gt;
&lt;p&gt;By decoding JSON into Arrow batches directly, arrow-rs avoids a lot of overhead, making it up to 2.3x faster than traditional row-based methods. The post also covers practical examples and benchmarks, showing where the real gains come in.&lt;&#x2F;p&gt;
&lt;p&gt;If you’re dealing with high-throughput data or just want a speed boost in your Rust applications, this is a must-read!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;lox-space&#x2F;lox&quot; target=&quot;_blank&quot;&gt;Oxidized Astrodynamics&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jtv5sNoSc-M&amp;ab_channel=PragmaticAILabs&quot; target=&quot;_blank&quot;&gt;Switching from Python to Rust (podcast)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1j13qos&#x2F;what_language_is_rust_written_in_like_python_is&#x2F;&quot; target=&quot;_blank&quot;&gt;What language is Rust written in?&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Building a DNS Server in Rust: Part 1 of 2</title>
          <pubDate>Fri, 28 Feb 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/building-a-dns-server-in-rust/</link>
          <guid>https://rust-trends.com/posts/building-a-dns-server-in-rust/</guid>
          <description xml:base="https://rust-trends.com/posts/building-a-dns-server-in-rust/">&lt;h2 id=&quot;introduction-why-build-a-dns-server&quot;&gt;Introduction: Why Build a DNS Server?&lt;&#x2F;h2&gt;
&lt;p&gt;Imagine typing a web address into your browser, and behind the scenes, a digital detective springs into action translating that friendly URL into the cryptic IP address where the website lives. This is the magic of DNS (Domain Name System), a cornerstone of the internet’s functionality. Inspired by the hands-on learning approach championed by Code Crafters, this tutorial will guide you through building your own DNS server from scratch using Rust! You’ll not only deepen your understanding of how the web operates but also gain practical experience with Rust’s networking capabilities. Let’s dive in and unravel the mystery behind how the internet finds what you’re looking for!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-codecrafters&quot;&gt;Why Codecrafters?&lt;&#x2F;h3&gt;
&lt;p&gt;Codecrafters provides hands-on system-building challenges, guiding you to create complex applications, like Redis, HTTP Server, and DNS servers—entirely from scratch. If you love learning by doing, this is the perfect platform for you.&lt;&#x2F;p&gt;
&lt;p&gt;Sign up using &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join-track&#x2F;rust?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;my referral link&lt;&#x2F;a&gt; to support my content and unlock a 40% discount on your subscription. The best part? You can try it for free, no strings attached! If you go for a paid subscription, you might even qualify for reimbursement from your employer, so don’t miss out on this opportunity to level up your skills!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-you-ll-learn&quot;&gt;What You’ll Learn&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Part 1:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Understanding DNS requests and responses.&lt;&#x2F;li&gt;
&lt;li&gt;Handling UDP packets in Rust.&lt;&#x2F;li&gt;
&lt;li&gt;Parsing and constructing DNS packets.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Part 2:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Implementing decompression of DNS packets.&lt;&#x2F;li&gt;
&lt;li&gt;Forwarding DNS queries to resolvers.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;accompanying-github-repository&quot;&gt;Accompanying GitHub Repository&lt;&#x2F;h3&gt;
&lt;p&gt;The complete source code for this tutorial is available on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;dns-server-tutorial&quot; target=&quot;_blank&quot;&gt;Github&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before diving in, ensure you have the following:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Rust installed: If you haven’t, install it using &lt;a href=&quot;https:&#x2F;&#x2F;rustup.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;rustup&lt;&#x2F;a&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;code&gt;curl --proto &#x27;=https&#x27; --tlsv1.2 -sSf https:&#x2F;&#x2F;sh.rustup.rs | sh&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Basic knowledge of Rust: Familiarity with variables, functions, structs, and enums.&lt;&#x2F;li&gt;
&lt;li&gt;Basic networking concepts: Understanding of DNS resolution, and the differences between UDP and TCP.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To test your DNS server, use tools like &lt;code&gt;dig&lt;&#x2F;code&gt; or &lt;code&gt;nslookup&lt;&#x2F;code&gt;. To install &lt;code&gt;dig&lt;&#x2F;code&gt;, run:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Ubuntu
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; apt-get install dnsutils
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## macOS
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;brew&lt;&#x2F;span&gt;&lt;span&gt; install bind
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Later on we will explain how to use the dig tool to test our DNS server.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;understanding-dns-a-quick-crash-course&quot;&gt;Understanding DNS: A Quick Crash Course&lt;&#x2F;h2&gt;
&lt;p&gt;A DNS request involves:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;A client (like your browser) sending a DNS query to a server.&lt;&#x2F;li&gt;
&lt;li&gt;The server responds with an IP address (or forwards the query).&lt;&#x2F;li&gt;
&lt;li&gt;The client uses that IP to establish a connection.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;DNS messages are encoded as binary data to ensure efficient transmission over the network. This means we will be working with raw bytes rather than plain text. A request typically includes:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Header: Contains metadata.&lt;&#x2F;li&gt;
&lt;li&gt;Question: The domain name being queried.&lt;&#x2F;li&gt;
&lt;li&gt;Answer (in response): The resolved IP address.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The full specification is available in &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035&quot; target=&quot;_blank&quot;&gt;RFC 1035&lt;&#x2F;a&gt; I’ll refer to it throughout this article and highlight the most relevant chapters. If you want a step-by-step walkthrough of the DNS protocol, I recommend &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;EmilHernvall&#x2F;dnsguide&#x2F;blob&#x2F;b52da3b32b27c81e5c6729ac14fe01fef8b1b593&#x2F;chapter1.md&quot; target=&quot;_blank&quot;&gt;this article&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;One of the great things about Rust is its strong type system, which allows us to define structures that closely resemble the DNS message format as specified in RFC 1035.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;setting-up-the-project&quot;&gt;Setting Up the Project&lt;&#x2F;h2&gt;
&lt;p&gt;Let’s create a Rust project for our DNS server:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; new dns-server
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; dns-server
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Open your preferred text editor and navigate to the project directory. If you’re looking for a recommendation, &lt;a href=&quot;https:&#x2F;&#x2F;zed.dev&quot; target=&quot;_blank&quot;&gt;Zed&lt;&#x2F;a&gt; is a great option.&lt;&#x2F;p&gt;
&lt;p&gt;Now, open Cargo.toml and add dependencies:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[dependencies]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;clap&lt;&#x2F;span&gt;&lt;span&gt; = { version = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;4.5.28&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, features = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;] &lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;thiserror&lt;&#x2F;span&gt;&lt;span&gt; = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;1.0.38&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Another way of doing the same is using &lt;code&gt;cargo add&lt;&#x2F;code&gt; in the project directory:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; add clap&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --features&lt;&#x2F;span&gt;&lt;span&gt; derive
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; add thiserror
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;clap&#x2F;latest&#x2F;clap&#x2F;&quot; target=&quot;_blank&quot;&gt;Clap&lt;&#x2F;a&gt; is a powerful and intuitive command-line argument parser for Rust, supporting subcommands, flags, options, and arguments.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;thiserror&#x2F;latest&#x2F;thiserror&#x2F;&quot; target=&quot;_blank&quot;&gt;Thiserror&lt;&#x2F;a&gt; is a lightweight crate for defining custom error types with Rust’s Error trait.&lt;&#x2F;p&gt;
&lt;p&gt;Now let&#x27;s start writing our DNS server...&lt;&#x2F;p&gt;
&lt;h2 id=&quot;defining-dns-header-structure&quot;&gt;Defining DNS Header structure&lt;&#x2F;h2&gt;
&lt;p&gt;To handle a DNS request, we first need to define the structure of a DNS message. Let’s start by defining the DNS Header in a separate file called &lt;code&gt;dns.rs&lt;&#x2F;code&gt;. The DNS header structure is defined in &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-4.1.1&quot; target=&quot;_blank&quot;&gt;RFC 1035 - 4.1.1&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub struct &lt;&#x2F;span&gt;&lt;span&gt;Header {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;id&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;,      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; identifier
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;qr&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;bool&lt;&#x2F;span&gt;&lt;span&gt;,     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; 0 for query, 1 for response
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;opcode&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;,   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; 0 for standard query
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;aa&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;bool&lt;&#x2F;span&gt;&lt;span&gt;,     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; authoritative answer
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;tc&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;bool&lt;&#x2F;span&gt;&lt;span&gt;,     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; truncated message
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rd&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;bool&lt;&#x2F;span&gt;&lt;span&gt;,     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; recursion desired
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ra&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;bool&lt;&#x2F;span&gt;&lt;span&gt;,     &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; recursion available
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;z&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;,        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; reserved for future use
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rcode&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;,    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; 0 for no error
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;qdcount&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; number of entries in the question section
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ancount&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; number of resource records in the answer section
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;nscount&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; number of name server resource records in the authority records section
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;arcount&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; number of resource records in the additional records section
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You do not need to know the meaning of each field in the DNS header. The fields are used by the DNS protocol to indicate the type of message, the status of the message, and the number of resource records in each section of the message among other things.&lt;&#x2F;p&gt;
&lt;p&gt;Since DNS messages are transmitted as raw binary data, we need to convert our Header struct into a byte array (serialization). When receiving a DNS request, we perform deserialization to reconstruct the Header from raw bytes.&lt;&#x2F;p&gt;
&lt;p&gt;Note that network byte order is big-endian (be) hence our use of the function &lt;code&gt;u16::to_be_bytes()&lt;&#x2F;code&gt; and &lt;code&gt;u16::from_be_bytes()&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;Header {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;const &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;DNS_HEADER_LEN&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;usize &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Serialize the header into a byte array
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = Vec::with_capacity(Header::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;DNS_HEADER_LEN&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.id.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.qr as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;) &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7
&lt;&#x2F;span&gt;&lt;span&gt;                | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.opcode &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3
&lt;&#x2F;span&gt;&lt;span&gt;                | (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.aa as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;) &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2
&lt;&#x2F;span&gt;&lt;span&gt;                | (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.tc as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;) &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;                | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rd as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;        );
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;((&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.ra as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;) &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7 &lt;&#x2F;span&gt;&lt;span&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.z &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4 &lt;&#x2F;span&gt;&lt;span&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rcode);
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.qdcount.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.ancount.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.nscount.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.arcount.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        buf
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Deserialize the header from a byte array
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;from_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;buf&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) -&amp;gt; Result&amp;lt;Header, ErrorCondition&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;() &amp;lt; Header::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;DNS_HEADER_LEN &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;Err(ErrorCondition::DeserializationErr(
&lt;&#x2F;span&gt;&lt;span&gt;                &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Buffer length is less than header length&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),
&lt;&#x2F;span&gt;&lt;span&gt;            ));
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        Ok(Header {
&lt;&#x2F;span&gt;&lt;span&gt;            id: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]]),
&lt;&#x2F;span&gt;&lt;span&gt;            qr: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b1000_0000&lt;&#x2F;span&gt;&lt;span&gt;) != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            opcode: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0111_1000&lt;&#x2F;span&gt;&lt;span&gt;) &amp;gt;&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            aa: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0000_0100&lt;&#x2F;span&gt;&lt;span&gt;) != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            tc: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0000_0010&lt;&#x2F;span&gt;&lt;span&gt;) != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            rd: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0000_0001&lt;&#x2F;span&gt;&lt;span&gt;) != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            ra: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b1000_0000&lt;&#x2F;span&gt;&lt;span&gt;) != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            z: (buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0111_0000&lt;&#x2F;span&gt;&lt;span&gt;) &amp;gt;&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            rcode: buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;] &amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0b0000_1111&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            qdcount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;]]),
&lt;&#x2F;span&gt;&lt;span&gt;            ancount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;]]),
&lt;&#x2F;span&gt;&lt;span&gt;            nscount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;9&lt;&#x2F;span&gt;&lt;span&gt;]]),
&lt;&#x2F;span&gt;&lt;span&gt;            arcount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;11&lt;&#x2F;span&gt;&lt;span&gt;]]),
&lt;&#x2F;span&gt;&lt;span&gt;        })
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Since we added an Error type to the deserialization function we need to include &lt;code&gt;thiserror&lt;&#x2F;code&gt; and define them. I will define the ErrorCondition enum at the top of the file.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;thiserror::Error;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug, Error)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub enum &lt;&#x2F;span&gt;&lt;span&gt;ErrorCondition {
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;error&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Serialization Error: {0}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;    SerializationErr(String),
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;error&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Deserialization Error: {0}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;    DeserializationErr(String),
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub struct &lt;&#x2F;span&gt;&lt;span&gt;Header {
&lt;&#x2F;span&gt;&lt;span&gt; ...
&lt;&#x2F;span&gt;&lt;span&gt; ...
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now we are going to implement the main loop where we will receive DNS queries from clients and send back responses. To start, we’ll implement a simple DNS server that decodes the DNS header and prints the query.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;main.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::net::UdpSocket;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mod &lt;&#x2F;span&gt;&lt;span&gt;dns;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;dns::Header;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; socket = UdpSocket::bind(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.0.0.0:1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not bind to port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;512&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;DNS server is running at port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;loop &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span&gt;(len, addr) = socket.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;recv_from&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; buf).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not receive data&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; header = Header::from_bytes(&amp;amp;buf[..len]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS header&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received query from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{} {:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, addr, header);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Our current code contains several &lt;code&gt;expect&lt;&#x2F;code&gt; calls, which we’ll refine later. This exemplifies one of Rust’s key strengths: explicit error handling, ensuring that nothing is left to implicit behavior.&lt;&#x2F;p&gt;
&lt;p&gt;In the main function, we create a UDP socket bound to port 1053 and initialize a 512-byte buffer. We then print a message indicating that the DNS server is running. Inside the loop, the server listens for incoming requests, parses the DNS header, and prints the query details, continuously processing requests until stopped with &lt;code&gt;Ctrl+C&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Now, let’s run the server! Open a terminal and start the DNS server: &lt;code&gt;cargo run&lt;&#x2F;code&gt;. Open another terminal and run &lt;code&gt;dig @localhost -p 1053 rust-trends.com&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Since we have not implemented DNS query processing, &lt;code&gt;dig&lt;&#x2F;code&gt; won’t receive a valid response. Instead, it may retry a few times before giving up. Because &lt;strong&gt;UDP&lt;&#x2F;strong&gt; is an unreliable protocol, dig simply attempts the query again if no response is received.&lt;&#x2F;p&gt;
&lt;p&gt;Example output from our server:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo run
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;DNS&lt;&#x2F;span&gt;&lt;span&gt; server is running at port 1053
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Received&lt;&#x2F;span&gt;&lt;span&gt; query from 127.0.0.1:63928 Header { id: 22295, qr: false, opcode: 0, aa: false, tc: false, rd: true, ra: false, z: 2, rcode: 0, qdcount: 1, ancount: 0, nscount: 0, arcount: 1 }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Code for this part can be found in the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;dns-server-tutorial&quot; target=&quot;_blank&quot;&gt;Github&lt;&#x2F;a&gt; Repository under &lt;code&gt;step 1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Wow! We’re running a DNS server in Rust! Are you curious how the rest of the request looks like? Let&#x27;s print it out!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;printing-the-dns-request&quot;&gt;Printing the DNS Request&lt;&#x2F;h2&gt;
&lt;p&gt;Before parsing the full DNS request, let’s first inspect the raw data. The function below prints the incoming bytes in a structured hex format, similar to how hex editors display binary files. This helps us visualize the request and debug potential issues.&lt;&#x2F;p&gt;
&lt;p&gt;If you’ve done low-level programming before, you’re probably familiar with hex editors. It has a convenient layout of printing bytes. An example of such a great editor can be found at &lt;a href=&quot;https:&#x2F;&#x2F;hexed.it&#x2F;&quot; target=&quot;_blank&quot;&gt;hexed.it&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Let’s take inspiration from this and extend main.rs to print the DNS request.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;main.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::net::UdpSocket;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mod &lt;&#x2F;span&gt;&lt;span&gt;dns;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;dns::Header;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Debug print hex bytes of a buffer 16 bytes width followed by the ASCII representation of the bytes
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;buf&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;(i, chunk) in buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;chunks&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;enumerate&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;        print!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:08x}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, i * &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; byte in chunk {
&lt;&#x2F;span&gt;&lt;span&gt;            print!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:02x} &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, byte);
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;_ in &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;..(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16 &lt;&#x2F;span&gt;&lt;span&gt;- chunk.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;()) {
&lt;&#x2F;span&gt;&lt;span&gt;            print!(&amp;quot;   &amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        print!(&amp;quot;  &amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; byte in chunk {
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;*byte &amp;gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;32 &lt;&#x2F;span&gt;&lt;span&gt;&amp;amp;&amp;amp; *byte &amp;lt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;126 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;                print!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, *byte as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;char&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;            } &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;                print!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;            }
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        println!();
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; socket = UdpSocket::bind(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.0.0.0:1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not bind to port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;512&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;DNS server is running at port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;loop &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span&gt;(len, addr) = socket.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;recv_from&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; buf).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not receive data&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received query from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; with length &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; bytes&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, addr, len);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buf[..len]);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; header = Header::from_bytes(&amp;amp;buf[..len]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS header&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, header);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, let’s run the server and send a DNS request using dig &lt;code&gt;dig @localhost -p 1053 rust-trends.com&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;DNS&lt;&#x2F;span&gt;&lt;span&gt; server is running at port 1053
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Received&lt;&#x2F;span&gt;&lt;span&gt; query from 127.0.0.1:62942 with length 44 bytes
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000000:&lt;&#x2F;span&gt;&lt;span&gt; 3e 3f 01 20 00 01 00 00 00 00 00 01 0b 72 75 73   &amp;gt;?. .........rus
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000010:&lt;&#x2F;span&gt;&lt;span&gt; 74 2d 74 72 65 6e 64 73 03 63 6f 6d 00 00 01 00   t-trends.com....
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000020:&lt;&#x2F;span&gt;&lt;span&gt; 01 00 00 29 10 00 00 00 00 00 00 00               ...)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;........
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Header &lt;&#x2F;span&gt;&lt;span&gt;{ id: 15935, qr: false, opcode: 0, aa: false, tc: false, rd: true, ra: false, z: 2, rcode: 0, qdcount: 1, ancount: 0, nscount: 0, arcount: 1 }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Each line in the output represents 16 bytes of the request. The first column is the byte offset (e.g., 00000000). The next columns show the hexadecimal values of the bytes. Finally, the rightmost column prints the ASCII representation of printable characters, replacing non-printable bytes with dots (.).&lt;&#x2F;p&gt;
&lt;p&gt;This debug information is useful for understanding the DNS request. Did you notice the quirk where z is set to 2? It&#x27;s a reserved field that can be used for future extensions and was expected to be zero. Huh!? What&#x27;s that about? You can read more about it at &lt;a href=&quot;https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;questions&#x2F;591203&#x2F;understanding-the-digs-dns-query-does-dig-set-non-zero-value-for-z-field&quot; target=&quot;_blank&quot;&gt;StackExchange&lt;&#x2F;a&gt;. Apperently RFC&#x27;s get amended. For now, we’ll ignore it and move on....&lt;&#x2F;p&gt;
&lt;p&gt;Since the DNS header is always 12 bytes, and our total request length is 44 bytes, we can infer that the remaining 32 bytes correspond to the Question Section. Next, we’ll decode it to extract the domain name being queried.&lt;&#x2F;p&gt;
&lt;p&gt;Code for this part can be found in the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;dns-server-tutorial&quot; target=&quot;_blank&quot;&gt;Github&lt;&#x2F;a&gt; Repository under &lt;code&gt;step 1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;defining-the-dns-question-structure&quot;&gt;Defining the DNS Question Structure&lt;&#x2F;h2&gt;
&lt;p&gt;In the Domain Name System (DNS), a question is a structured query that specifies the domain name and the type of record being requested. This structure is fundamental to DNS resolution and is formally defined in &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-4.1.2&quot; target=&quot;_blank&quot;&gt;RFC 1035, Section 4.1.2&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;A DNS question consists of three fields:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;QNAME: The domain name being queried, represented as a sequence of labels. Each label is encoded as a length-prefixed string, and the entire name is terminated with a zero byte.&lt;&#x2F;li&gt;
&lt;li&gt;QTYPE: Specifies the type of DNS record being requested (e.g., A for IPv4 addresses, AAAA for IPv6 addresses, MX for mail exchange records).&lt;&#x2F;li&gt;
&lt;li&gt;QCLASS: Indicates the class of the query, with the most common value being IN (Internet).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;qname-encoding-details&quot;&gt;QNAME Encoding Details&lt;&#x2F;h3&gt;
&lt;p&gt;DNS uses a compact encoding for domain names:
1.	Each label (e.g., “www”, “rust-trends”, “com”) is prefixed by a single byte indicating its length.
2.	Labels are concatenated sequentially.
3.	The entire sequence is terminated with a zero byte (0x00).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-dns-question-for-www-rust-trends-com&quot;&gt;Example DNS Question for www.rust-trends.com&lt;&#x2F;h3&gt;
&lt;p&gt;A DNS query for &lt;code&gt;www.rust-trends.com&lt;&#x2F;code&gt; requesting an A record (IPv4 address) in the Internet class would be structured as follows:&lt;&#x2F;p&gt;
&lt;h4 id=&quot;qname-encoding&quot;&gt;QNAME Encoding&lt;&#x2F;h4&gt;
&lt;p&gt;The domain name &quot;www.rust-trends.com&quot; is split into labels:
•	&quot;www&quot; → 3 characters
•	&quot;rust-trends&quot; → 11 characters
•	&quot;com&quot; → 3 characters&lt;&#x2F;p&gt;
&lt;p&gt;DNS encoding rules:
•	Each label is prefixed by its length as a single byte.
•	The entire domain is terminated with a 0x00 byte.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;encoded-qname&quot;&gt;Encoded QNAME:&lt;&#x2F;h4&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;[03] &amp;#39;w&amp;#39; &amp;#39;w &amp;#39;w&amp;#39; [0B] &amp;#39;r&amp;#39; &amp;#39;u&amp;#39; &amp;#39;s&amp;#39; &amp;#39;t&amp;#39; &amp;#39;-&amp;#39; &amp;#39;t&amp;#39; &amp;#39;r&amp;#39; &amp;#39;e&amp;#39; &amp;#39;n&amp;#39; &amp;#39;d&amp;#39; &amp;#39;s&amp;#39; [03] &amp;#39;c&amp;#39; &amp;#39;o&amp;#39; &amp;#39;m&amp;#39; [00]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## in bytes
&lt;&#x2F;span&gt;&lt;span&gt;03 77 77 77 0B 72 75 73 74 2D 74 72 65 6E 64 73 03 63 6F 6D 00
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Breaking it down:
-	03 → Length of &quot;www&quot;, followed by ASCII 77 77 77 (www).
-	0B → Length of &quot;rust-trends&quot;, followed by ASCII 72 75 73 74 2D 74 72 65 6E 64 73 (rust-trends).
-	03 → Length of &quot;com&quot;, followed by ASCII 63 6F 6D (com).
-	00 → End of QNAME.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;complete-dns-question-structure&quot;&gt;Complete DNS Question Structure&lt;&#x2F;h4&gt;
&lt;p&gt;A complete DNS question includes:
-	QNAME → Encoded domain name.
-	QTYPE → 00 01 (A record).
-	QCLASS → 00 01 (Internet class).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Final binary representation:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;[03] &amp;#39;w&amp;#39; &amp;#39;w &amp;#39;w&amp;#39; [0B] &amp;#39;r&amp;#39; &amp;#39;u&amp;#39; &amp;#39;s&amp;#39; &amp;#39;t&amp;#39; &amp;#39;-&amp;#39; &amp;#39;t&amp;#39; &amp;#39;r&amp;#39; &amp;#39;e&amp;#39; &amp;#39;n&amp;#39; &amp;#39;d&amp;#39; &amp;#39;s&amp;#39; [03] &amp;#39;c&amp;#39; &amp;#39;o&amp;#39; &amp;#39;m&amp;#39; [00] [00] [01] [00] [01]
&lt;&#x2F;span&gt;&lt;span&gt;03 77 77 77 0B 72 75 73 74 2D 74 72 65 6E 64 73 03 63 6F 6D 00  00 01  00 01
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is how a DNS client would structure a query to resolve www.rust-trends.com into an IPv4 address.&lt;&#x2F;p&gt;
&lt;p&gt;How should we structure this? Instead of storing the domain name as a single string, we break it down into its individual labels (e.g., www, rust-trends, com). This allows for more efficient processing when serializing and handling compressed DNS messages later. We can represent QTYPE and QCLASS as enums.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;...
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub struct &lt;&#x2F;span&gt;&lt;span&gt;Question {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: Vec&amp;lt;Label&amp;gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;qtype&lt;&#x2F;span&gt;&lt;span&gt;: Type,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;qclass&lt;&#x2F;span&gt;&lt;span&gt;: Class,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug, Clone)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub struct &lt;&#x2F;span&gt;&lt;span&gt;Label(String);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For the Types we can look at &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-3.2.3&quot; target=&quot;_blank&quot;&gt;section 3.2.3&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-3.2.2&quot; target=&quot;_blank&quot;&gt;section 3.2.2&lt;&#x2F;a&gt; of the RFC. Note that Types used in Resource Records are a subset of Types used in Questions, so for sake of simplicity we will use the same enum for both.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;...
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug, Clone)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub enum &lt;&#x2F;span&gt;&lt;span&gt;Type {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Below are Resource Record Types and QTYPES
&lt;&#x2F;span&gt;&lt;span&gt;    A = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a host address
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NS &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; an authoritative name server
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MD &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a mail destination (Obsolete - use MX)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MF &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a mail forwarder (Obsolete - use MX)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CNAME &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; the canonical name for an alias
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;SOA &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; marks the start of a zone of authority
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MB &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a mailbox domain name (EXPERIMENTAL)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MG &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a mail group member (EXPERIMENTAL)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MR &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;9&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a mail rename domain name (EXPERIMENTAL)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NULL &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a null RR (EXPERIMENTAL)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;WKS &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;11&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a well known service description
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;PTR &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; a domain name pointer
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HINFO &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;13&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; host information
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MINFO &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;14&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; mailbox or mail list information
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MX &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; mail exchange
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;TXT &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; text strings
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Below are only QTYPES
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;AXFR &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;252&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; A request for a transfer of an entire zone
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILB &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;253&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; A request for mailbox-related records (MB, MG or MR)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILA &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;254&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; A request for mail agent RRs (Obsolete - see MX)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;_ALL_ &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;255&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; A request for all records
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, we define the QCLASS enum, as described in &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-3.2.4&quot; target=&quot;_blank&quot;&gt;section 3.2.4&lt;&#x2F;a&gt;, we will only be using the Internet class, but for the sake of completeness, we will add the other values in the enum:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;...
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub enum &lt;&#x2F;span&gt;&lt;span&gt;Class {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;IN &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; the Internet
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CS &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; the CSNET class (Obsolete - used only for examples in some obsolete RFCs)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CH &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; the CHAOS class
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HS &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Hesiod [Dyer 87]
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s add the functionality to and deserialize the Question part of DNS query:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;Question {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; The from_bytes() function reconstructs a Question struct by iterating through the buffer, extracting labels,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; parsing the query type and class.
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;from_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;buf&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) -&amp;gt; Result&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;Self&lt;&#x2F;span&gt;&lt;span&gt;, ErrorCondition&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; index = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; labels: Vec&amp;lt;Label&amp;gt; = Vec::new();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Labels:&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;while&lt;&#x2F;span&gt;&lt;span&gt; buf[index] != &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; len = buf[index] as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;usize&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;            index += &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;            labels.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(Label::new(&amp;amp;buf[index..index + len])?);
&lt;&#x2F;span&gt;&lt;span&gt;            println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, labels); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; For debugging purposes
&lt;&#x2F;span&gt;&lt;span&gt;            index += len;
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        index += &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; qtype = Type::from_bytes(&amp;amp;buf[index..index + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;])?;
&lt;&#x2F;span&gt;&lt;span&gt;        index += &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; qclass = Class::from_bytes(&amp;amp;buf[index..index + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;])?;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        Ok(Question {
&lt;&#x2F;span&gt;&lt;span&gt;            name: labels,
&lt;&#x2F;span&gt;&lt;span&gt;            qtype,
&lt;&#x2F;span&gt;&lt;span&gt;            qclass,
&lt;&#x2F;span&gt;&lt;span&gt;        })
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = Vec::new();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Write the labels to the buffer and add . inbetween and end with 0
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; label in &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.name {
&lt;&#x2F;span&gt;&lt;span&gt;            buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(label.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;() as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;            buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(label.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;as_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Write the question type and class to the buffer
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.qtype.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.qclass.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        buf
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The code uses functions to serialize and deserialize Type (field qtype) and Class (field qclass) into bytes and back into their respective types, requiring proper implementation for from_bytes and to_bytes see below.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;Type {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;from_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;bytes&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) -&amp;gt; Result&amp;lt;Type, ErrorCondition&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([bytes[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], bytes[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]]) {
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::A),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NS&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MD&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MF&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CNAME&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;SOA&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MB&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;8 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MG&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;9 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MR&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NULL&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;11 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;WKS&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;PTR&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;13 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HINFO&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;14 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MINFO&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;15 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MX&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;TXT&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;252 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;AXFR&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;253 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILB&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;254 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILA&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;255 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;_ALL_&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            n =&amp;gt; Err(ErrorCondition::DeserializationErr(
&lt;&#x2F;span&gt;&lt;span&gt;                format!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Unknown Question Type &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, n).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),
&lt;&#x2F;span&gt;&lt;span&gt;            )),
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; num = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            Type::A =&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NS &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MD &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MF &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CNAME &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;SOA &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MB &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;7&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MG &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MR &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;9&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;NULL &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;WKS &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;11&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;PTR &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HINFO &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;13&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MINFO &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;14&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MX &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;TXT &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;AXFR &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;252&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILB &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;253&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAILA &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;254&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Type::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;_ALL_ &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;255&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;        };
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::to_be_bytes(num)
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;Class {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;from_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;buf&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) -&amp;gt; Result&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;Self&lt;&#x2F;span&gt;&lt;span&gt;, ErrorCondition&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; num = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::from_be_bytes([buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;], buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]]);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; num {
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;IN&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CS&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CH&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4 &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; Ok(Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HS&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;            _ =&amp;gt; Err(ErrorCondition::DeserializationErr(
&lt;&#x2F;span&gt;&lt;span&gt;                format!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Unknown Question Class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, num).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),
&lt;&#x2F;span&gt;&lt;span&gt;            )),
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;] {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; num = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;IN &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CS &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;CH &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;HS &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;_ALL_ &lt;&#x2F;span&gt;&lt;span&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;255&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;        };
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;::to_be_bytes(num)
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We have all the plumbing in place to deserialize the question, we need to modify &lt;code&gt;main.rs&lt;&#x2F;code&gt; to handle the incoming DNS queries and print them.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;main.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::net::UdpSocket;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mod &lt;&#x2F;span&gt;&lt;span&gt;dns;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;dns::{Header, Question};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Debug print hex bytes of a buffer 16 bytes width followed by the ASCII representation of the bytes
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;buf&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;]) {
&lt;&#x2F;span&gt;&lt;span&gt;    ...
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; socket = UdpSocket::bind(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.0.0.0:1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not bind to port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;512&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;DNS server is running at port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;loop &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span&gt;(len, addr) = socket.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;recv_from&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; buf).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not receive data&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received query from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; with length &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; bytes&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, addr, len);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;### DNS Query: ###&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buf[..len]);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; header = Header::from_bytes(&amp;amp;buf[..&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS header&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, header);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;### Question: ###&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;..len]);
&lt;&#x2F;span&gt;&lt;span&gt;        println!();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; question = Question::from_bytes(&amp;amp;buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;..len]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS question&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, question);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now that we can deserialize both the Header and Question, let’s restart the server and send a DNS request to observe the deserialization in action.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;dig&lt;&#x2F;span&gt;&lt;span&gt; @localhost&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span&gt; 1053 www.rust-trends.com
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; run
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;DNS&lt;&#x2F;span&gt;&lt;span&gt; server is running at port 1053
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Received&lt;&#x2F;span&gt;&lt;span&gt; query from 127.0.0.1:64228 with length 48 bytes
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#### DNS Query: ###
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000000:&lt;&#x2F;span&gt;&lt;span&gt; ef 60 01 20 00 01 00 00 00 00 00 01 03 77 77 77   .`&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt; .........www
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000010:&lt;&#x2F;span&gt;&lt;span&gt; 0b 72 75 73 74 2d 74 72 65 6e 64 73 03 63 6f 6d   .rust-trends.com
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000020:&lt;&#x2F;span&gt;&lt;span&gt; 00 00 01 00 01 00 00 29 10 00 00 00 00 00 00 00   .......)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;........
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Header &lt;&#x2F;span&gt;&lt;span&gt;{ id: 61280, qr: false, opcode: 0, aa: false, tc: false, rd: true, ra: false, z: 2, rcode: 0, qdcount: 1, ancount: 0, nscount: 0, arcount: 1 }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#### Question: ###
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000000:&lt;&#x2F;span&gt;&lt;span&gt; 03 77 77 77 0b 72 75 73 74 2d 74 72 65 6e 64 73   .www.rust-trends
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000010:&lt;&#x2F;span&gt;&lt;span&gt; 03 63 6f 6d 00 00 01 00 01 00 00 29 10 00 00 00   .com.......)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;....
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000020:&lt;&#x2F;span&gt;&lt;span&gt; 00 00 00 00                                       ....
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Labels:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Question &lt;&#x2F;span&gt;&lt;span&gt;{ name: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;), Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;), Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;, qtype: A, qclass: IN }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Code for this part can be found in the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;dns-server-tutorial&quot; target=&quot;_blank&quot;&gt;Github&lt;&#x2F;a&gt; Repository under &lt;code&gt;step 2&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;We see the label sequence and Question struct. We still do not have an answer for this DNS request so next we are going to implement a reply.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;defining-dns-answer-structure&quot;&gt;Defining DNS Answer structure&lt;&#x2F;h2&gt;
&lt;p&gt;The answer section in a DNS query reply is also called a &lt;a href=&quot;https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc1035#section-4.1.3&quot; target=&quot;_blank&quot;&gt;Resource record&lt;&#x2F;a&gt;. It includes several fields, such as the domain name, time-to-live (TTL), the Type and Class we previously defined for the question part and the actual data, which can contain an IP address or other relevant information. Below you can find the structure in code:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(Debug, Clone)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub struct &lt;&#x2F;span&gt;&lt;span&gt;ResourceRecord {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: String,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rtype&lt;&#x2F;span&gt;&lt;span&gt;: Type,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rclass&lt;&#x2F;span&gt;&lt;span&gt;: Class,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ttl&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u32&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rdlength&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u16&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rdata&lt;&#x2F;span&gt;&lt;span&gt;: Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;ResourceRecord {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;pub fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = Vec::with_capacity(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;MAX_DNS_MESSAGE_SIZE&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.name.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;split&lt;&#x2F;span&gt;&lt;span&gt;(&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;for_each&lt;&#x2F;span&gt;&lt;span&gt;(|&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;label&lt;&#x2F;span&gt;&lt;span&gt;| {
&lt;&#x2F;span&gt;&lt;span&gt;            buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(label.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;() as &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;            buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(label.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;as_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        });
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;push&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rtype.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rclass.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.ttl.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rdlength.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_be_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        buf.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.rdata);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        buf
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;With the above method, we can easily construct a ResourceRecord as part of the reply. Ready to answer the query?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;constructing-a-hardcoded-reply&quot;&gt;Constructing a (hardcoded) reply&lt;&#x2F;h2&gt;
&lt;p&gt;A valid DNS response consists of three main parts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Header: Includes metadata, response flags, and record counts.
&lt;ul&gt;
&lt;li&gt;Question: Echoes the original query back to the client.&lt;&#x2F;li&gt;
&lt;li&gt;Answer: Contains the resolved IP address for the requested domain.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For now, our server will always return the fixed IP address 172.67.221.148 when queried for &lt;code&gt;www.rust-trends.com&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;We will use Rust’s Default trait to define a default ResourceRecord. This provides a simple and reusable way to hardcode a response for now.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;dns.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;Default &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;ResourceRecord {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;default&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;Self &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        ResourceRecord {
&lt;&#x2F;span&gt;&lt;span&gt;            name: String::from(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www.rust-trends.com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;),
&lt;&#x2F;span&gt;&lt;span&gt;            rtype: Type::A,
&lt;&#x2F;span&gt;&lt;span&gt;            rclass: Class::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;IN&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            ttl: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;60&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            rdlength: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            rdata: Vec::from([&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;172&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;67&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;221&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;148&lt;&#x2F;span&gt;&lt;span&gt;]),
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we adapt &lt;code&gt;main.rs&lt;&#x2F;code&gt; to send a response. We need to add the ResourceRecord in the use statement.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;main.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::net::UdpSocket;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mod &lt;&#x2F;span&gt;&lt;span&gt;dns;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;dns::{Header, Question, ResourceRecord};
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After printing the query, we construct the response.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; src&#x2F;main.rs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; socket = UdpSocket::bind(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.0.0.0:1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not bind to port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buf = [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;512&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;DNS server is running at port 1053&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;loop &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span&gt;(len, addr) = socket.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;recv_from&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; buf).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not receive data&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received query from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; with length &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; bytes&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, addr, len);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;### DNS Query: ###&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buf[..len]);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; header = Header::from_bytes(&amp;amp;buf[..&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS header&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, header);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;### Question: ###&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;debug_print_bytes&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;..len]);
&lt;&#x2F;span&gt;&lt;span&gt;        println!();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; question = Question::from_bytes(&amp;amp;buf[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;12&lt;&#x2F;span&gt;&lt;span&gt;..len]).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not parse DNS question&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, question);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; We parsed the DNS query and question, now we can respond to it
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; answer = ResourceRecord::default();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{:?}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, answer);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; response_header = Header {
&lt;&#x2F;span&gt;&lt;span&gt;            id: header.id,
&lt;&#x2F;span&gt;&lt;span&gt;            qr: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;,              &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; It is a query response
&lt;&#x2F;span&gt;&lt;span&gt;            opcode: header.opcode, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Standard query
&lt;&#x2F;span&gt;&lt;span&gt;            aa: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;false&lt;&#x2F;span&gt;&lt;span&gt;,             &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Not authoritative
&lt;&#x2F;span&gt;&lt;span&gt;            tc: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;false&lt;&#x2F;span&gt;&lt;span&gt;,             &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Not truncated
&lt;&#x2F;span&gt;&lt;span&gt;            rd: header.rd,         &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Recursion desired
&lt;&#x2F;span&gt;&lt;span&gt;            ra: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;false&lt;&#x2F;span&gt;&lt;span&gt;,             &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Recursion not available
&lt;&#x2F;span&gt;&lt;span&gt;            z: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,                  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Reserved
&lt;&#x2F;span&gt;&lt;span&gt;            rcode: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; header.opcode == &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span&gt;{ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span&gt;} &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else &lt;&#x2F;span&gt;&lt;span&gt;{ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4 &lt;&#x2F;span&gt;&lt;span&gt;},
&lt;&#x2F;span&gt;&lt;span&gt;            qdcount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Question count we assume is 1
&lt;&#x2F;span&gt;&lt;span&gt;            ancount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Answer count is 1
&lt;&#x2F;span&gt;&lt;span&gt;            nscount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Name server count is 0
&lt;&#x2F;span&gt;&lt;span&gt;            arcount: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Additional record count is 0
&lt;&#x2F;span&gt;&lt;span&gt;        };
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Create a response message with the header and question
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; response: Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u8&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; = Vec::new();
&lt;&#x2F;span&gt;&lt;span&gt;        response.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;response_header.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        response.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;question.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;        response.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;extend_from_slice&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;answer.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_bytes&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Send the response back to the client
&lt;&#x2F;span&gt;&lt;span&gt;        socket
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;send_to&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;response, addr)
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not send response&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Code for this part can be found in the Github Repository under &lt;code&gt;step 3&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Our response reuses some fields from the incoming query but updates specific values:
- qr = true → Indicates this is a response.
- rcode = 0 (or 4 for unsupported opcode) → Specifies success or failure.
- ancount = 1 → Indicates that one answer is included.&lt;&#x2F;p&gt;
&lt;p&gt;The deserialized question is re-serialized and included in the response. This ensures that the client can match the response to its original query.&lt;&#x2F;p&gt;
&lt;p&gt;A complete DNS response consists of:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Header – Metadata and response flags&lt;&#x2F;li&gt;
&lt;li&gt;Question – Echoed back from the request&lt;&#x2F;li&gt;
&lt;li&gt;Answer – The resolved IP address or relevant data&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Note: including the question section in the response is a standard part of the DNS protocol, allowing clients to verify the response corresponds to their request.&lt;&#x2F;p&gt;
&lt;p&gt;Last step is putting it in one byte array and sending it to the client.&lt;&#x2F;p&gt;
&lt;p&gt;Now let&#x27;s test our DNS server! Fire up dig and start the server&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;dig&lt;&#x2F;span&gt;&lt;span&gt; @localhost&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span&gt; 1053 www.rust-trends.com
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; run
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;DNS&lt;&#x2F;span&gt;&lt;span&gt; server is running at port 1053
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Received&lt;&#x2F;span&gt;&lt;span&gt; query from 127.0.0.1:54734 with length 48 bytes
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#### DNS Query: ###
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000000:&lt;&#x2F;span&gt;&lt;span&gt; 2e 1f 01 20 00 01 00 00 00 00 00 01 03 77 77 77   ... .........www
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000010:&lt;&#x2F;span&gt;&lt;span&gt; 0b 72 75 73 74 2d 74 72 65 6e 64 73 03 63 6f 6d   .rust-trends.com
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000020:&lt;&#x2F;span&gt;&lt;span&gt; 00 00 01 00 01 00 00 29 10 00 00 00 00 00 00 00   .......)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;........
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Header &lt;&#x2F;span&gt;&lt;span&gt;{ id: 11807, qr: false, opcode: 0, aa: false, tc: false, rd: true, ra: false, z: 2, rcode: 0, qdcount: 1, ancount: 0, nscount: 0, arcount: 1 }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#### Question: ###
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000000:&lt;&#x2F;span&gt;&lt;span&gt; 03 77 77 77 0b 72 75 73 74 2d 74 72 65 6e 64 73   .www.rust-trends
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000010:&lt;&#x2F;span&gt;&lt;span&gt; 03 63 6f 6d 00 00 01 00 01 00 00 29 10 00 00 00   .com.......)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;....
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;00000020:&lt;&#x2F;span&gt;&lt;span&gt; 00 00 00 00                                       ....
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Labels:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;[Label&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span&gt; Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Question &lt;&#x2F;span&gt;&lt;span&gt;{ name: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;), Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;rust-trends&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;), Label(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;, qtype: A, qclass: IN }
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ResourceRecord &lt;&#x2F;span&gt;&lt;span&gt;{ name: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www.rust-trends.com&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, rtype: A, rclass: IN, ttl: 60, rdlength: 4, rdata: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;172, 67, 221, 148&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;] &lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;And looking at the dig output:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;dig&lt;&#x2F;span&gt;&lt;span&gt; @localhost&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span&gt; 1053 www.rust-trends.com
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;9.10.6 &lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt; @localhost&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span&gt; 1053 www.rust-trends.com
&lt;&#x2F;span&gt;&lt;span&gt;; (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt; servers found)
&lt;&#x2F;span&gt;&lt;span&gt;;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;global&lt;&#x2F;span&gt;&lt;span&gt; options: +cmd
&lt;&#x2F;span&gt;&lt;span&gt;;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Got&lt;&#x2F;span&gt;&lt;span&gt; answer:
&lt;&#x2F;span&gt;&lt;span&gt;;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;opcode&lt;&#x2F;span&gt;&lt;span&gt;: QUERY, status: NOERROR, id: 11807
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; WARNING: recursion requested but not available
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; QUESTION SECTION:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;www.rust-trends.com.		IN	A
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; ANSWER SECTION:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;www.rust-trends.com.	60	IN	A	172.67.221.148
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; Query time: 0 msec
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; SERVER: 127.0.0.1#1053(127.0.0.1)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; WHEN: Fri Feb 28 12:44:09 CET 2025
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;;; MSG SIZE  rcvd: 72
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wow it works! we can see it received the header, query and answer. Also note is show a warning about recursion requested but not available. By default, dig requests recursion, but our server does not perform recursive queries. The warning &lt;code&gt;WARNING: recursion requested but not available&lt;&#x2F;code&gt;simply indicates that recursion was requested but not supported. To remove this warning, use: &lt;code&gt;dig @localhost -p 1053 www.rust-trends.com +norecurse&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;You got your reply and can visit &lt;a href=&quot;https:&#x2F;&#x2F;www.rust-trends.com&quot; target=&quot;_blank&quot;&gt;www.rust-trends.com&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;We are coming to the end of Part 1 of this series. You&#x27;ve built a basic DNS server that can parse queries and return a hardcoded IP address. In the next part we will add support for DNS decompression and send the request to a resolver, collect the response, and construct a reply to the client.&lt;&#x2F;p&gt;
&lt;p&gt;This tutorial is inspired by the Codecrafters challenge of building your own DNS server. If you enjoy hands-on learning, use &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join-track&#x2F;rust?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;my referral link&lt;&#x2F;a&gt; to get a 40% discount and support my content. You can even try it for free no strings attached!&lt;&#x2F;p&gt;
&lt;p&gt;Have questions or feedback? Drop a comment or reach out, I’d love to hear how your DNS server is coming along! Stay tuned for Part 2!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;disclaimer&quot;&gt;Disclaimer&lt;&#x2F;h2&gt;
&lt;p&gt;This project is intended for &lt;strong&gt;educational purposes&lt;&#x2F;strong&gt; and is not fully optimized for production use.&lt;&#x2F;p&gt;
&lt;p&gt;When running &lt;code&gt;cargo check&lt;&#x2F;code&gt; or &lt;code&gt;cargo run&lt;&#x2F;code&gt;, you may notice warnings about &lt;strong&gt;unused code&lt;&#x2F;strong&gt;, such as &lt;code&gt;from_bytes&lt;&#x2F;code&gt; and &lt;code&gt;to_bytes&lt;&#x2F;code&gt; functions or unused enum variants. These have been &lt;strong&gt;intentionally left in place&lt;&#x2F;strong&gt; for &lt;strong&gt;illustrative purposes&lt;&#x2F;strong&gt; and to maintain &lt;strong&gt;code symmetry&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Contributions and improvements are always welcome! 🚀&lt;&#x2F;p&gt;
&lt;h2 id=&quot;acknowledgments&quot;&gt;Acknowledgments&lt;&#x2F;h2&gt;
&lt;p&gt;A huge thanks to the &lt;strong&gt;Codecrafters team&lt;&#x2F;strong&gt; for their support and guidance throughout this project.&lt;&#x2F;p&gt;
&lt;center&gt;
&lt;h2 id=&quot;share&quot;&gt;Share&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;news.ycombinator.com&#x2F;submitlink?u=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;building-a-dns-server-in-rust&#x2F;&quot;&gt;Hacker News&lt;&#x2F;a&gt;    &lt;a href=&quot;https:&#x2F;&#x2F;reddit.com&#x2F;r&#x2F;rust&#x2F;submit?url=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;building-a-dns-server-in-rust&#x2F;&quot;&gt;Reddit&lt;&#x2F;a&gt;   &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;shareArticle?mini=true&amp;amp;url=https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;building-a-dns-server-in-rust&#x2F;&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;center&gt;
</description>
      </item>
      <item>
          <title>59 - Rust for Scientists? Plus, Async Closures &amp; If&#x2F;Let Chains Explained</title>
          <pubDate>Sat, 15 Feb 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-for-scientists-async-closures-if-let-chains/</link>
          <guid>https://rust-trends.com/newsletter/rust-for-scientists-async-closures-if-let-chains/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-for-scientists-async-closures-if-let-chains/">&lt;br&gt;
After an unexpected battle with the flu (spoiler: it won, but only temporarily), I’m finally back with a fresh edition of Rust Trends! Thanks for your patience—I promise this one’s worth the wait.
&lt;p&gt;This week, we’re diving into some exciting Rust updates: the 2024 State of Rust Survey results are in, async closures are on the horizon, and if&#x2F;let while chains are set to clean up your control flow. There’s plenty to catch up on, so let’s get right to it!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-2024-state-of-rust-survey-key-takeaways-for-rustaceans&quot;&gt;The 2024 State of Rust Survey: Key Takeaways for Rustaceans&lt;&#x2F;h2&gt;
&lt;p&gt;The Rust Survey Team has released the 2024 State of Rust Survey Results, offering a comprehensive look into the language’s growth and the community’s evolving dynamics.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Insights&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Global Reach:&lt;&#x2F;strong&gt; Rust’s community remains diverse, with the United States (22%), Germany (14%), and the United Kingdom (6%) leading in participation. Notably, countries like China (5%) and the Netherlands (3%) also have significant representation.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Increased Workplace Adoption:&lt;&#x2F;strong&gt; There’s a notable rise in Rust usage at work, with 38% of respondents using Rust for the majority of their coding—a 4 percentage point increase from the previous year.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Learning Resources:&lt;&#x2F;strong&gt; The Rust documentation and “The Rust Programming Language” book continue to be primary learning tools. Additionally, many developers benefit from reading the source code of Rust crates, highlighting the community’s collaborative spirit.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Challenges Faced:&lt;&#x2F;strong&gt; While Rust’s runtime performance and documentation are praised, areas like slow compilation times and debugging support have been identified as productivity hurdles.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Desired Features:&lt;&#x2F;strong&gt; The community eagerly anticipates features like &lt;strong&gt;async closures&lt;&#x2F;strong&gt; and &lt;strong&gt;if&#x2F;let while chains&lt;&#x2F;strong&gt;. Fortunately, &lt;strong&gt;async closures&lt;&#x2F;strong&gt; are set to be stabilized in Rust 1.85, with &lt;strong&gt;if&#x2F;let while chains&lt;&#x2F;strong&gt; expected to follow soon.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;For a deeper dive into the survey results, you can read the &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2025&#x2F;02&#x2F;13&#x2F;2024-State-Of-Rust-Survey-results.html&quot; target=&quot;_blank&quot;&gt;full report on the Rust Blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-s-next-ergonomic-boost-async-closures-if-let-while-chains&quot;&gt;Rust’s Next Ergonomic Boost: Async Closures &amp;amp; If&#x2F;Let While Chains&lt;&#x2F;h2&gt;
&lt;p&gt;Rust is about to get even smoother with two powerful new features: &lt;strong&gt;async closures&lt;&#x2F;strong&gt; (planned for Rust 1.85) and &lt;strong&gt;if&#x2F;let while chains&lt;&#x2F;strong&gt;. These changes promise to make Rust code cleaner, more expressive, and easier to write, whether you’re dealing with async logic or complex conditionals.&lt;&#x2F;p&gt;
&lt;p&gt;Async closures will finally let you write concise async functions without awkward workarounds, while if&#x2F;let while chains will eliminate unnecessary nesting in conditional expressions and loops.&lt;&#x2F;p&gt;
&lt;p&gt;Curious about how these features will improve your Rust experience? Check out these two articles:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.rust-trends.com&#x2F;posts&#x2F;rust-s-async-closures&#x2F;&quot; target=&quot;_blank&quot;&gt;Async Closures: A New Way to Handle Asynchronous Logic&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.rust-trends.com&#x2F;posts&#x2F;rust-s-if-let-while-chains&#x2F;&quot; target=&quot;_blank&quot;&gt;If&#x2F;Let While Chains: Cleaner Control Flow is Coming!&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Rust keeps evolving—are you ready to take advantage of what’s next?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-useful-for-scientists-key-insights-from-the-community&quot;&gt;Rust Useful for Scientists? Key Insights from the Community&lt;&#x2F;h2&gt;
&lt;p&gt;A recent Reddit discussion—“Is RUST useful for a scientist?”—delves into the applicability of Rust in scientific fields. Here are some key takeaways:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Performance Enhancement via Python Integration:&lt;&#x2F;strong&gt; Rust can be used to develop high-performance Python libraries using tools like &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;PyO3&#x2F;pyo3&quot; target=&quot;_blank&quot;&gt;PyO3&lt;&#x2F;a&gt;, enabling faster computations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Learning for Enjoyment:&lt;&#x2F;strong&gt; For those learning programming for pleasure, Rust is often recommended over C++ due to its modern features and safety guarantees.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;SIMD Utilization:&lt;&#x2F;strong&gt; Rust’s standard library includes a portable SIMD module, which can be leveraged for performance improvements in scientific computations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Community Resources:&lt;&#x2F;strong&gt; Websites like &lt;a href=&quot;https:&#x2F;&#x2F;www.arewelearningyet.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Are We Learning Yet?&lt;&#x2F;a&gt; provide insights into Rust’s capabilities in machine learning and scientific computing, aiding in decision-making.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Personal Development:&lt;&#x2F;strong&gt; Engaging with Rust can be intellectually stimulating, offering a deeper understanding of systems programming and staying mentally active.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;In summary, while Rust may not be essential for every scientific project, it offers valuable tools and learning opportunities for those interested in exploring its potential in scientific computing.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.phoronix.com&#x2F;news&#x2F;Linux-6.14-Driver-Core-Rust&quot; target=&quot;_blank&quot;&gt;“We Are Almost At The &#x27;Write A Real Driver In Rust&#x27; Stage Now” (Linux 6.14)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;scorpiosoftware.net&#x2F;2025&#x2F;02&#x2F;08&#x2F;writing-a-simple-driver-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Writing a Simple Windows Driver in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;dzone.com&#x2F;articles&#x2F;build-serverless-applications-rust-aws-lambda&quot; target=&quot;_blank&quot;&gt;Build Serverless Applications Using Rust on AWS Lambda&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Rust’s Async Closures: A New Way to Handle Asynchronous Logic</title>
          <pubDate>Fri, 14 Feb 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/rust-s-async-closures/</link>
          <guid>https://rust-trends.com/posts/rust-s-async-closures/</guid>
          <description xml:base="https://rust-trends.com/posts/rust-s-async-closures/">&lt;p&gt;Rust’s upcoming async closures are an exciting feature set to land in &lt;strong&gt;Rust 1.85&lt;&#x2F;strong&gt;. If you’ve ever tried to write a closure inside an async function, you’ve likely hit a wall. Until now, closures couldn’t be async themselves, forcing developers to work around the limitation with named async functions. But with async closures, Rustaceans will finally get the closure they’ve been seeking!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-are-closures-in-rust&quot;&gt;What Are Closures in Rust?&lt;&#x2F;h2&gt;
&lt;p&gt;Closures in Rust are anonymous functions that can capture variables from their surrounding scope. They’re often used for short, throwaway functions, making code more concise and expressive. Closures in Rust can be assigned to variables, passed as arguments, and even return values.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-of-a-basic-closure&quot;&gt;Example of a Basic Closure:&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;add_one &lt;&#x2F;span&gt;&lt;span&gt;= |&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;x&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;| x + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;add_one&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;)); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Output: 6
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, add_one is a closure that takes an i32 increments it with 1 and returns the resulting i32.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;closures-capturing-variables&quot;&gt;Closures Capturing Variables:&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; multiplier = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;multiply &lt;&#x2F;span&gt;&lt;span&gt;= |&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;x&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;| x * multiplier; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Capturing `multiplier`
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;multiply&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;)); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Output: 12
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This closure captures multiplier from its environment.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-do-we-need-async-closures&quot;&gt;Why Do We Need Async Closures?&lt;&#x2F;h2&gt;
&lt;p&gt;Previously, if you wanted to write an async function inside another function, you had to define it separately:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;fetch_data&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; String {
&lt;&#x2F;span&gt;&lt;span&gt;    reqwest::get(url).await.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;text&lt;&#x2F;span&gt;&lt;span&gt;().await.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;fetcher &lt;&#x2F;span&gt;&lt;span&gt;= |&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;fetch_data&lt;&#x2F;span&gt;&lt;span&gt;(url); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Not truly async
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is clunky! Async closures will allow a more natural syntax.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-using-an-async-closure&quot;&gt;Example: Using an Async Closure&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; fetcher = async |url: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;| reqwest::get(url).await.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;text&lt;&#x2F;span&gt;&lt;span&gt;().await.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;unwrap&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now fetcher is a true async closure that can be used inside async contexts seamlessly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-using-an-async-closure-in-tokio&quot;&gt;Example: Using an Async Closure in Tokio&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;tokio::time::{sleep, Duration};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;tokio&lt;&#x2F;span&gt;&lt;span&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; delayed_print = async |msg: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;str&lt;&#x2F;span&gt;&lt;span&gt;| {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;sleep&lt;&#x2F;span&gt;&lt;span&gt;(Duration::from_secs(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)).await;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, msg);
&lt;&#x2F;span&gt;&lt;span&gt;    };
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;delayed_print&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Hello, async closures!&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).await;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, we define an async closure that waits for two seconds before printing a message. Want to try it out? Here is a &lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=beta&amp;mode=debug&amp;edition=2021&amp;gist=7770a1e098415137296f767cbd3273fe&quot; target=&quot;_blank&quot;&gt;Rust playground link&lt;&#x2F;a&gt; to the code snippet. Note that for now Beta Rust is required to run async closures.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What’s Next?&lt;&#x2F;h2&gt;
&lt;p&gt;With Rust 1.85, async closures will make writing asynchronous code more ergonomic. They’ll be useful in scenarios like async iterators, event handling, and networking.&lt;&#x2F;p&gt;
&lt;p&gt;So, Rustaceans, are you ready to embrace async closures? They’re coming soon—probably faster than your coffee cools down!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Rust’s if&#x2F;let While Chains: Cleaner Control Flow is Coming!</title>
          <pubDate>Fri, 14 Feb 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/rust-s-if-let-while-chains/</link>
          <guid>https://rust-trends.com/posts/rust-s-if-let-while-chains/</guid>
          <description xml:base="https://rust-trends.com/posts/rust-s-if-let-while-chains/">&lt;p&gt;One of the long-awaited features in Rust is if&#x2F;let while chains, and it’s finally on the way! This small but powerful change will make conditional expressions and loops more ergonomic, eliminating some of the verbosity that Rustaceans have had to deal with.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-the-problem&quot;&gt;What’s the Problem?&lt;&#x2F;h2&gt;
&lt;p&gt;Currently, if you want to combine multiple conditions involving if let and while let, you have to nest them or write separate conditions, making the code harder to read.&lt;&#x2F;p&gt;
&lt;p&gt;For example, if you wanted to check whether an Option contains a value and another condition holds, you’d have to write:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; some_option = Some(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Some(x) = some_option {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; x &amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;x is greater than 10!&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or in a while loop with a game of blackjack:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; deck = vec![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;]; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Example card values.
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; total = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; max = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;21&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; iter = deck.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;into_iter&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;while let &lt;&#x2F;span&gt;&lt;span&gt;Some(card) = iter.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;next&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Check if drawing the next card would bust (exceed max).
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; total + card &amp;gt; max {
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;break&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;        total += card;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Drew card: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; (total: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, card, total);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Final total: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, total);
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This indentation gets annoying fast!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-changing&quot;&gt;What’s Changing?&lt;&#x2F;h2&gt;
&lt;p&gt;With if&#x2F;let while chains, Rust will let you write conditions in a more natural way. Instead of nesting if let inside an if, you can chain them together like this:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;#![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;feature&lt;&#x2F;span&gt;&lt;span&gt;(let_chains)] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Enable the feature
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; some_option = Some(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;15&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Some(x) = some_option &amp;amp;&amp;amp; x &amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;x is greater than 10!&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Similarly, for while let:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;#![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;feature&lt;&#x2F;span&gt;&lt;span&gt;(let_chains)] &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Enable the feature
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; deck = vec![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;6&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;]; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Example card values.
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; total = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; max = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;21&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; iter = deck.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;into_iter&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; The loop continues only if:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; 1. A card is drawn (Some(card)), AND
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; 2. Adding the card does not exceed 21.
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;while let &lt;&#x2F;span&gt;&lt;span&gt;Some(card) = iter.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;next&lt;&#x2F;span&gt;&lt;span&gt;() &amp;amp;&amp;amp; total + card &amp;lt;= max {
&lt;&#x2F;span&gt;&lt;span&gt;        total += card;
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Drew card: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; (total: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, card, total);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Final total: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, total);
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;⚠ Note: These examples will only work once if&#x2F;let while chains are stabilized! You can run it on the &lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=nightly&amp;mode=debug&amp;edition=2021&amp;gist=3d7d383082e42aa01f65b1444db56e3a&quot; target=&quot;_blank&quot;&gt;Rust Playground&lt;&#x2F;a&gt; if you select Rust version: Nightly.&lt;&#x2F;p&gt;
&lt;p&gt;This makes the intent much clearer and eliminates unnecessary nesting. Just what we need!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-is-this-useful&quot;&gt;Why Is This Useful?&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Cleaner Code&lt;&#x2F;strong&gt; – No more deep nesting just to check additional conditions.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Better Readability&lt;&#x2F;strong&gt; – The logic is clearer at a glance.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Improved Consistency&lt;&#x2F;strong&gt; – Other languages allow similar patterns, and Rust is catching up.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;Final Thoughts&lt;&#x2F;h2&gt;
&lt;p&gt;Rust has always emphasized safety and clarity, but small ergonomic tweaks like if&#x2F;let while chains help make code easier to write and read.&lt;&#x2F;p&gt;
&lt;p&gt;With this feature expected to land soon, you’ll be able to streamline your control flow—no hacks, no unnecessary nesting, just clean Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Now, if only debugging borrow checker errors could be this easy… 😆&lt;&#x2F;p&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;p&gt;P.S. Previously, I had a while let chain example that was incorrect and didn’t function the same way as the code without this feature. Thanks to Günter’s keen eye, he pointed out the mistake—much appreciated!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>57 - Start 2025 with Rust: Honeypots, Free Cloud Deployments, and Software Reliability</title>
          <pubDate>Sun, 05 Jan 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/start-2025-with-rust-honeypots-free-cloud-deployments-and-software-reliability/</link>
          <guid>https://rust-trends.com/newsletter/start-2025-with-rust-honeypots-free-cloud-deployments-and-software-reliability/</guid>
          <description xml:base="https://rust-trends.com/newsletter/start-2025-with-rust-honeypots-free-cloud-deployments-and-software-reliability/">&lt;br&gt;
Happy New Year! 🥳 Here’s to another year of growth, innovation, and, of course, writing safer, faster, and more reliable code. Whether you’re setting bold coding goals or just resolving to finally finish that side project (we see you!), we’re thrilled to have you with us for the journey ahead.
&lt;p&gt;To kick off 2025, we’ve got a packed issue! Dive into our latest tutorial on building a honeypot in Rust and deploying it to Oracle Cloud for free (cybersecurity just got fun), check out a thought-provoking podcast on software reliability, and explore tips to supercharge your Rust projects this year.&lt;&#x2F;p&gt;
&lt;p&gt;P.S. Have a cool Rust project or tip? Hit reply and let us know—your work might just make it into a future issue. Let’s make 2025 a standout year for Rustaceans everywhere! 🚀&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deep-dive-into-reliability-jon-gjengset-s-take-on-rust-s-role-in-modern-software&quot;&gt;Deep Dive into Reliability: Jon Gjengset’s Take on Rust’s Role in Modern Software&lt;&#x2F;h2&gt;
&lt;p&gt;In a recent episode of the “Compose” podcast, host Tim McNamara interviews Jon Gjengset, author of Rust for Rustaceans, about enhancing software reliability.&lt;&#x2F;p&gt;
&lt;p&gt;Gjengset describes software quality as a problem “infinitely deep in all directions,” emphasizing the complexity of achieving reliability.&lt;&#x2F;p&gt;
&lt;p&gt;The discussion covers various testing methodologies, including fuzz testing, property testing, and concolic execution, each offering unique benefits in identifying software vulnerabilities.&lt;&#x2F;p&gt;
&lt;p&gt;They also explore tools like the Kani model checker and testing frameworks such as Loom and Turmoil, which assist in verifying concurrent Rust code.&lt;&#x2F;p&gt;
&lt;p&gt;The conversation extends to the human aspects of software development, highlighting the importance of effective collaboration with stakeholders and the sustainability of open-source projects.&lt;&#x2F;p&gt;
&lt;p&gt;Gjengset shares insights on managing dependencies, using the example of serde-yaml, to illustrate the careful consideration required when integrating external libraries.&lt;&#x2F;p&gt;
&lt;p&gt;This interview offers valuable perspectives for developers aiming to enhance the reliability of their Rust applications.&lt;&#x2F;p&gt;
&lt;p&gt;For a more in-depth understanding, you can listen for the full interview &lt;a href=&quot;https:&#x2F;&#x2F;timclicks.dev&#x2F;podcast&#x2F;reliable-software-an-interview-with-jon-gjengset&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-a-honeypot-in-rust-and-deploying-it-to-oracle-cloud-for-free&quot;&gt;Building a Honeypot in Rust and Deploying It to Oracle Cloud for Free&lt;&#x2F;h2&gt;
&lt;p&gt;Honeypots aren’t just for catching bees—they’re a powerful tool in cybersecurity to detect and analyze malicious activity. If you’ve ever wanted to create your own honeypot while diving into some Rust programming, this tutorial is a must-read! In this guide, we’ll show you how to build a honeypot in Rust and deploy it to Oracle Cloud—all without spending a dime.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-rust-for-a-honeypot&quot;&gt;Why Rust for a Honeypot?&lt;&#x2F;h3&gt;
&lt;p&gt;Rust’s reputation for performance and safety makes it an excellent choice for cybersecurity projects. A honeypot needs to handle malicious traffic gracefully (and securely). Rust’s ownership model helps ensure that even in high-stakes situations, your application won’t crash or leak sensitive data.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-s-inside-the-tutorial&quot;&gt;What’s Inside the Tutorial?&lt;&#x2F;h3&gt;
&lt;p&gt;This tutorial breaks the project into digestible steps:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Crafting the Honeypot: Learn how to create a minimal yet effective honeypot in Rust. The code is beginner-friendly yet robust, making it a great project to sharpen your skills.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Oracle Cloud Deployment: Why pay for hosting when Oracle Cloud offers free compute instances? The tutorial walks you through setting up your cloud environment, configuring your honeypot, and deploying it without headaches.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Practical Tips: From securing your deployment to monitoring traffic, the guide offers actionable advice to ensure your honeypot operates smoothly.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;what-i-loved-about-this-project&quot;&gt;What I Loved About This Project&lt;&#x2F;h3&gt;
&lt;p&gt;Building this honeypot is like solving a fun puzzle—it combines Rust’s technical edge with real-world utility. The choice to use Oracle Cloud’s free tier is brilliant, especially for those of us who love experimenting but are allergic to extra costs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-you-should-try-it&quot;&gt;Why You Should Try It&lt;&#x2F;h3&gt;
&lt;p&gt;This isn’t just a cool project—it’s an opportunity to level up your Rust skills, learn about cybersecurity, and deploy something tangible to the cloud. Even if you’re a Rust beginner, this guide is detailed enough to get you through. Plus, who doesn’t love a good freebie?&lt;&#x2F;p&gt;
&lt;p&gt;Ready to get your hands dirty with some Rust code and cybersecurity magic? &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;building-a-honeypot-in-rust-and-deploy-it-to-oracle-for-free&#x2F;&quot; target=&quot;_blank&quot;&gt;Check out the full tutorial&lt;&#x2F;a&gt; and let me know what you build! The &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;honeypot&quot; target=&quot;_blank&quot;&gt;github repo&lt;&#x2F;a&gt; can be found here&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-safety-with-rust-lessons-from-sonair-s-ultrasonic-sensor-development&quot;&gt;Building Safety with Rust: Lessons from Sonair’s Ultrasonic Sensor Development&lt;&#x2F;h2&gt;
&lt;p&gt;In a recent &lt;a href=&quot;https:&#x2F;&#x2F;www.sonair.com&#x2F;journal&#x2F;building-for-safety-with-rust&quot; target=&quot;_blank&quot;&gt;article&lt;&#x2F;a&gt;, Sonair’s Head of Software, Espen Albrektsen, delves into the company’s adoption of Rust for developing their 3D ultrasonic sensor. He highlights Rust’s blend of low-level control and high-level features, which enhances both development speed and functional safety.&lt;&#x2F;p&gt;
&lt;p&gt;Albrektsen notes that while C and C++ offer speed and flexibility, they come with legacy issues like manual memory management. Rust addresses these challenges by enforcing memory safety and providing a robust type system, leading to more reliable and secure code. He mentions that the team, initially unfamiliar with Rust, quickly became comfortable with its features, stating, &lt;strong&gt;“Almost immediately, we were blown away.”&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A standout advantage of Rust is its ecosystem of crates—open-source libraries that streamline development. Albrektsen shares an office joke: &lt;strong&gt;“Of course there is a crate for that,”&lt;&#x2F;strong&gt; emphasizing the ease of finding ready-to-use solutions for various needs.&lt;&#x2F;p&gt;
&lt;p&gt;Sonair is also pursuing safety certifications like IEC 61508 and SIL2 for their Rust-based applications, aiming to be among the first to deploy a safety-certified Rust implementation.&lt;&#x2F;p&gt;
&lt;p&gt;This journey underscores Rust’s growing significance in developing safe, efficient, and reliable embedded systems.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;indiv0&#x2F;aoc-fastest&quot; target=&quot;_blank&quot;&gt;Solving AoC 2024 in Under 1ms in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;news&#x2F;rust-foundation-in-review-2024-annual-report-preview&#x2F;&quot; target=&quot;_blank&quot;&gt;2024 in Review: Rust Foundation Annual Report Preview&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Building a Honeypot in Rust and Deploy it to Oracle for Free</title>
          <pubDate>Sun, 05 Jan 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/building-a-honeypot-in-rust-and-deploy-it-to-oracle-for-free/</link>
          <guid>https://rust-trends.com/posts/building-a-honeypot-in-rust-and-deploy-it-to-oracle-for-free/</guid>
          <description xml:base="https://rust-trends.com/posts/building-a-honeypot-in-rust-and-deploy-it-to-oracle-for-free/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;Looking for a fun and educational hands-on project that combines Rust coding with cloud deployment? In this guide, we will build a simple honeypot—a minimal TCP server in Rust that listens on a specific port and logs every incoming request—then deploy it to an Ubuntu instance on Oracle Cloud Infrastructure (OCI) for FREE. A honeypot offers a fascinating window into the malicious scans and attacks traveling the internet while also providing a playful way to practice coding, cross-compiling, and network configuration. By following these steps, you will gain valuable Rust experience, learn how to set up OCI for external traffic, and come away with deeper insight into real-world attack patterns.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Note 1: I am using a Apple M1 Pro MacBook for development and cross-compiling for x86_64 architecture.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Welcome to the warm-up lap before our Rust honeypot grand adventure! Here’s what you need to get started:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-1-oracle-cloud-account&quot;&gt;1.1 Oracle Cloud Account&lt;&#x2F;h3&gt;
&lt;p&gt;First things first: snag an &lt;a href=&quot;https:&#x2F;&#x2F;www.oracle.com&#x2F;cloud&#x2F;free&#x2F;&quot; target=&quot;_blank&quot;&gt;Oracle Cloud account&lt;&#x2F;a&gt; (free is our favorite price). The Always Free tier is pretty sweet since it gives you a no-cost VM to play around with. Perfect for deploying a honeypot without emptying your wallet.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Note 1: you can of course use any cloud provider or your own server for this project. But Oracle Cloud offers an &quot;Always Free&quot; tier that allows you to run a small VM at no cost and I was looking for an excuse to try it out. Initially I was interested in the ARM architecture but those are limited in my region of choice so I am using a AMD64 instance for this project.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;1-2-ubuntu-vm-in-oci&quot;&gt;1.2 Ubuntu VM in OCI&lt;&#x2F;h3&gt;
&lt;p&gt;Go to the Oracle Cloud console and &lt;a href=&quot;https:&#x2F;&#x2F;cloud.oracle.com&#x2F;compute&#x2F;instances&quot; target=&quot;_blank&quot;&gt;spin up an Ubuntu instance&lt;&#x2F;a&gt;. Make sure you’ve got your SSH key set up and can &lt;strong&gt;actually get in&lt;&#x2F;strong&gt;. Some additional information on how to use SSH can be found in the &lt;a href=&quot;https:&#x2F;&#x2F;docs.oracle.com&#x2F;en-us&#x2F;iaas&#x2F;Content&#x2F;Compute&#x2F;Tasks&#x2F;accessinginstance.htm&quot; target=&quot;_blank&quot;&gt;Oracle Cloud documentation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-3-rust-installed-locally&quot;&gt;1.3 Rust Installed Locally&lt;&#x2F;h3&gt;
&lt;p&gt;If you do not have Rust installed look here for the &lt;a href=&quot;https:&#x2F;&#x2F;www.rust-lang.org&#x2F;learn&#x2F;get-started&quot; target=&quot;_blank&quot;&gt;basic setup steps&lt;&#x2F;a&gt;. To add another architecture Rust up your local environment with the following:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span&gt; update
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Add the target for x86_64 architecture
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span&gt; target add x86_64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Personally I am using &lt;strong&gt;stable-aarch64-apple-darwin&lt;&#x2F;strong&gt; on an Apple Silicon Mac for development and cross-compilation.
Because I wanted to cross-compile to &lt;code&gt;x86_64&lt;&#x2F;code&gt; the architecture of AMD64 (a usual suspect for cloud VMs), I installed this handy toolchain:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;brew&lt;&#x2F;span&gt;&lt;span&gt; install messense&#x2F;macos-cross-toolchains&#x2F;x86_64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If your setup is different, fear not—just make sure you have some way to compile your Rust code into a binary that your Ubuntu server recognizes.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-4-basic-terminal-ssh-skills&quot;&gt;1.4 Basic Terminal &#x2F; SSH Skills&lt;&#x2F;h3&gt;
&lt;p&gt;Brush up on your command line wizardry and SSH know-how. If you can SSH into your server, open files in your favorite terminal editor you’re set! If you are not there yet, no worries—there are plenty of tutorials out there to help you get up to speed, e.g. &lt;a href=&quot;https:&#x2F;&#x2F;www.pluralsight.com&#x2F;resources&#x2F;blog&#x2F;cloud&#x2F;ssh-and-scp-howto-tips-tricks&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-coding-the-honeypot-in-rust&quot;&gt;2. Coding the Honeypot in Rust&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;2-1-project-setup&quot;&gt;2.1 Project Setup&lt;&#x2F;h3&gt;
&lt;p&gt;To get started, we’ll create a fresh Rust project for our honeypot:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; new honeypot
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This initializes a new folder named honeypot containing your basic Cargo scaffolding. For a minimal approach, we won’t require any external crates at this stage—plain Rust’s standard library has all we need for simple socket listening and logging. Below is an example Cargo.toml you might use:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;toml&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-toml &quot;&gt;&lt;code class=&quot;language-toml&quot; data-lang=&quot;toml&quot;&gt;&lt;span&gt;[package]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;name &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;authors &lt;&#x2F;span&gt;&lt;span&gt;= [&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Bob Peters &amp;lt;contact@rust-trends.com&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;version &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.1.0&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;edition &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;2021&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[dependencies]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s it, no dependencies listed because Rust’s standard library already includes the core networking (std::net) and concurrency (std::thread) features we need for this basic honeypot. Of course, if you decide to add extra functionality (like logging libraries, async runtimes, or protocol parsers), this is where you’d specify them under [dependencies].&lt;&#x2F;p&gt;
&lt;p&gt;Next, open &lt;code&gt;src&#x2F;main.rs&lt;&#x2F;code&gt;, and you will find a bare-bones “Hello, world!” file. We will soon replace that with our honeypot logic.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-2-minimal-tcp-server-code&quot;&gt;2.2 Minimal TCP Server Code&lt;&#x2F;h3&gt;
&lt;p&gt;Here’s a simple TCP server that listens on port 2222, for every connection a thread is spawned. Each thread logs incoming data to a file and stdout.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::io::{Read, Write};
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::net::{TcpListener, TcpStream};
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::thread;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; listener = TcpListener::bind(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;0.0.0.0:2222&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not bind to address&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Honeypot is Listening on port 2222&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; stream in listener.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;incoming&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; stream {
&lt;&#x2F;span&gt;&lt;span&gt;            Ok(stream) =&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;                thread::spawn(|| {
&lt;&#x2F;span&gt;&lt;span&gt;                    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;handle_client&lt;&#x2F;span&gt;&lt;span&gt;(stream);
&lt;&#x2F;span&gt;&lt;span&gt;                });
&lt;&#x2F;span&gt;&lt;span&gt;            }
&lt;&#x2F;span&gt;&lt;span&gt;            Err(e) =&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;                eprintln!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Error: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, e);
&lt;&#x2F;span&gt;&lt;span&gt;            }
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;handle_client&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;stream&lt;&#x2F;span&gt;&lt;span&gt;: TcpStream) {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; peer_addr = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; stream.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;peer_addr&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;        Ok(addr) =&amp;gt; addr.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),
&lt;&#x2F;span&gt;&lt;span&gt;        Err(_) =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Unknown&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to_string&lt;&#x2F;span&gt;&lt;span&gt;(),
&lt;&#x2F;span&gt;&lt;span&gt;    };
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; buffer = [&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1024&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; now = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;get_epoch_time&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received connection from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, peer_addr);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Open a (new) file to log the request
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; filename = format!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;opt&#x2F;honeypot&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.log&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, now, peer_addr);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; file = std::fs::OpenOptions::new()
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;create&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;open&lt;&#x2F;span&gt;&lt;span&gt;(filename)
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not open file&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;loop &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; stream.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;read&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut&lt;&#x2F;span&gt;&lt;span&gt; buffer) {
&lt;&#x2F;span&gt;&lt;span&gt;            Ok(n) =&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; n == &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;0 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;                    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Connection closed by &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, peer_addr);
&lt;&#x2F;span&gt;&lt;span&gt;                    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;break&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;                }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Try if the request is a valid string
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; If it is a valid string, it will be printed
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; If it is binary data, it will be printed as a string
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; request = String::from_utf8_lossy(&amp;amp;buffer[..n]);
&lt;&#x2F;span&gt;&lt;span&gt;                println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Received request from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, peer_addr, request);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Write the request to the file
&lt;&#x2F;span&gt;&lt;span&gt;                file.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;write_all&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;buffer[..n])
&lt;&#x2F;span&gt;&lt;span&gt;                    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not write to file&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Close the file
&lt;&#x2F;span&gt;&lt;span&gt;                file.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;sync_all&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Could not sync file&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;);
&lt;&#x2F;span&gt;&lt;span&gt;            }
&lt;&#x2F;span&gt;&lt;span&gt;            Err(e) =&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;                eprintln!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Error reading from &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, peer_addr, e);
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;break&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;            }
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;get_epoch_time&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;u64 &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    std::time::SystemTime::now()
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;duration_since&lt;&#x2F;span&gt;&lt;span&gt;(std::time::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;UNIX_EPOCH&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Time went backwards&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)
&lt;&#x2F;span&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;as_secs&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h4 id=&quot;2-2-1-handling-connections&quot;&gt;2.2.1 Handling Connections&lt;&#x2F;h4&gt;
&lt;p&gt;Each incoming connection is handled in a separate thread to avoid blocking the main loop. This way, the honeypot can handle multiple connections simultaneously. The &lt;code&gt;handle_client&lt;&#x2F;code&gt; function reads data from the incoming stream, logs it to a file, and prints it to the console. The &lt;code&gt;get_epoch_time&lt;&#x2F;code&gt; function generates a timestamp for the log file name.&lt;&#x2F;p&gt;
&lt;p&gt;The TcpListener is bound to &lt;code&gt;0.0.0.0:2222&lt;&#x2F;code&gt;, which means it listens on all available network interfaces on port 2222. This allows the honeypot to accept connections from any IP address. The &lt;code&gt;listener.incoming()&lt;&#x2F;code&gt; method returns an iterator over incoming connections (infinitely), which we loop over to handle each connection. Great job! You’ve set up your first TCP listener.&lt;&#x2F;p&gt;
&lt;p&gt;The TcpStream represents the connection to a client. We use &lt;code&gt;stream.peer_addr()&lt;&#x2F;code&gt; to get the IP address of the client. If the address is successfully retrieved, we convert it to a string; otherwise, we use &quot;Unknown&quot;. We then create a buffer to read data from the stream and a file to log the incoming data.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;2-2-2-logging-data&quot;&gt;2.2.2 Logging Data&lt;&#x2F;h4&gt;
&lt;p&gt;The &lt;code&gt;handle_client&lt;&#x2F;code&gt; function reads data from the stream into the buffer and writes it to the log file. If the read operation returns 0 bytes, the connection is closed, and the function breaks out of the loop. We use &lt;code&gt;String::from_utf8_lossy&lt;&#x2F;code&gt; to convert the buffer to a string, handling invalid UTF-8 sequences gracefully. This allows us to log binary data like �, as well as text.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-3-enhancing-the-honeypot&quot;&gt;2.3 Enhancing the Honeypot&lt;&#x2F;h3&gt;
&lt;p&gt;This can be extended in many ways, for example, you could add a banner to mimic a real service, or you could add a database to store the logs. Adding more ports, or even emulating a specific protocol. But for now, this is a good starting point.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-building-and-packaging&quot;&gt;3. Building and Packaging&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;3-1-native-vs-cross-compilation&quot;&gt;3.1 Native vs. Cross-Compilation&lt;&#x2F;h3&gt;
&lt;p&gt;Since we want to deploy our honeypot on an Ubuntu AMD64 server, we need to compile our Rust code for the x86_64 architecture. If your development machine has the same architecture, you can compile natively &lt;code&gt;cargo build --release&lt;&#x2F;code&gt;. Otherwise, you’ll need to cross-compile for the target architecture. It is one of the benefits of Rust that it is easy to cross-compile.&lt;&#x2F;p&gt;
&lt;p&gt;In my case, I am using an Apple M1 Pro MacBook, so I need to cross-compile for x86_64. Here’s how you can do it:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --release --target&lt;&#x2F;span&gt;&lt;span&gt; x86_64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This creates a binary optimized for the x86_64 architecture, which you can then transfer to your Ubuntu server. It is located in &lt;code&gt;target&#x2F;x86_64-unknown-linux-gnu&#x2F;release&#x2F;honeypot&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Why not use the debug build? The debug build includes additional symbols and debugging information, making the binary larger and slower. The release build is optimized for performance and size, making it more suitable for deployment.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-testing-locally&quot;&gt;3.2 Testing Locally&lt;&#x2F;h3&gt;
&lt;p&gt;Before deploying to Oracle Cloud, you can test your honeypot locally. Build it and run it with &lt;code&gt;cargo run --release&lt;&#x2F;code&gt; the binary on your development machine and connect to it using &lt;code&gt;telnet localhost 2222&lt;&#x2F;code&gt; or &lt;code&gt;nc localhost 2222&lt;&#x2F;code&gt;. You should see the connection logs in your terminal and a new log file created in the current directory.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-deploying-to-oracle-cloud&quot;&gt;4. Deploying to Oracle Cloud&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;4-1-orcale-cloud-infrastructure-network-configuration&quot;&gt;4.1 Orcale Cloud Infrastructure Network Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;By default, Oracle Cloud blocks inbound traffic on custom ports. You need to create an &lt;strong&gt;Ingress Rule&lt;&#x2F;strong&gt; in the &lt;strong&gt;Security List&lt;&#x2F;strong&gt; or &lt;strong&gt;Network Security Group&lt;&#x2F;strong&gt; for your instance’s subnet. Example: Open port &lt;code&gt;2222&lt;&#x2F;code&gt; to &lt;code&gt;0.0.0.0&#x2F;0&lt;&#x2F;code&gt; via TCP.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Go to the Oracle Cloud console and navigate to your instance&lt;&#x2F;li&gt;
&lt;li&gt;Open your instance’s &lt;strong&gt;VNIC&lt;&#x2F;strong&gt; details&lt;&#x2F;li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Security Lists&lt;&#x2F;strong&gt; or &lt;strong&gt;Network Security Groups&lt;&#x2F;strong&gt; link&lt;&#x2F;li&gt;
&lt;li&gt;Add a new &lt;strong&gt;Ingress Rule&lt;&#x2F;strong&gt; to allow traffic on port &lt;code&gt;2222&lt;&#x2F;code&gt; from &lt;code&gt;0.0.0.0&#x2F;0&lt;&#x2F;code&gt; this is not recommended for production, but for a honeypot it is fine. This notation is called CIDR and it means all IP addresses.&lt;&#x2F;li&gt;
&lt;li&gt;Save the changes and wait for them to take effect.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Additional tip is to close the actual SSH port on 22 after you have deployed and tested the honeypot service, so that attackers aren’t attempting to brute-force your &quot;real&quot; SSH port.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-2-uploading-the-honeypot-binary&quot;&gt;4.2 Uploading the Honeypot Binary&lt;&#x2F;h3&gt;
&lt;p&gt;To upload the binary to the server, you can use &lt;code&gt;scp&lt;&#x2F;code&gt; or a deployment script. I choose to use a deployment script to automate the process, because I will be doing this multiple times.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Configuration
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Path to your SSH private key
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SSH_KEY&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;.ssh&#x2F;id_ssh_key&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Change this to your private key
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## SSH username and server IP
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;ubuntu&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;xxx.xxx.xxx.xxx&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Change this to your server&amp;#39;s IP
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Local paths
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.&#x2F;target&#x2F;x86_64-unknown-linux-gnu&#x2F;release&#x2F;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;                  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Compiled honeypot binary
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.&#x2F;install_honeypot_service.sh&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Remote locations
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_DIR&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;home&#x2F;ubuntu&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;                  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Temporary location for uploads
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_BINARY_PATH&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&#x2F;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&#x2F;install_honeypot_service.sh&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 0. Build the binary
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Building the honeypot binary... ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --release --target&lt;&#x2F;span&gt;&lt;span&gt; x86_64-unknown-linux-gnu
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;? -ne&lt;&#x2F;span&gt;&lt;span&gt; 0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Error: Failed to build the honeypot binary.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span&gt; 1
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 1. Upload the new binary
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Uploading the honeypot binary to &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}@&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}... ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;scp -i &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SSH_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}@&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}:&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_BINARY_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;? -ne&lt;&#x2F;span&gt;&lt;span&gt; 0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Error: Failed to upload the honeypot binary.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span&gt; 1
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Successfully uploaded binary. ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 2. Upload the install script
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Uploading install script to &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}@&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}... ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;scp -i &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SSH_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}@&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}:&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;? -ne&lt;&#x2F;span&gt;&lt;span&gt; 0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Error: Failed to upload install script.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span&gt; 1
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Successfully uploaded install script. ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 3. Run install script remotely
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;##############################################################################
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Running install script on the remote server... ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ssh -i &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SSH_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}@&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVER_HOST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;lt;&amp;lt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;EOF
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  set -e  # Exit on any command error
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  # Make sure script is executable
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  chmod +x &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  # Run it with sudo privileges (prompts if needed)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  sudo &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_INSTALL_SCRIPT&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;  # Done
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;EOF
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;? -eq&lt;&#x2F;span&gt;&lt;span&gt; 0 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Deployment successful! ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;=== Deployment encountered an error. ===&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span&gt; 1
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This script automates the process of building the binary, uploading it to the server, and running an installation script. You can customize it to fit your needs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-3-installation-script&quot;&gt;4.3 Installation Script&lt;&#x2F;h3&gt;
&lt;p&gt;Create an installation script to set up the honeypot on the server. Here’s an example script that installs the honeypot as a systemd service. It’s idempotent, meaning you can run it multiple times without causing issues.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## install_honeypot_service.sh
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Idempotent script to install&#x2F;upgrade the &amp;#39;honeypot&amp;#39; systemd service.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Safe to run multiple times.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;#
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Steps:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 1. Create &amp;#39;honeypot&amp;#39; user if missing
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 2. Create &#x2F;opt&#x2F;honeypot dir if missing
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 3. Copy local binary to &#x2F;opt&#x2F;honeypot if it differs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 4. Create or update systemd unit file
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 5. Reload &amp;amp; restart service
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span&gt; -euo pipefail
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Configurable parameters
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;opt&#x2F;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;BINARY_NAME&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;              &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# The name of your compiled binary
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY_PATH&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.&#x2F;honeypot&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Where your compiled binary is locally
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;etc&#x2F;systemd&#x2F;system&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;PERMISSIONS&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;750&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;                   &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Permissions for $INSTALL_DIR
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 1. Create user and group if they do not exist
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Checking if user &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;#39; exists...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;id &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;amp;&amp;gt;&#x2F;dev&#x2F;null; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   User &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;#39; already exists.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Creating system user &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;#39;...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; useradd&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -r -s&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;usr&#x2F;sbin&#x2F;nologin &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 2. Create &#x2F;opt&#x2F;honeypot directory if missing
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Ensuring &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; directory exists...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;! &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;-d &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Creating directory &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chown &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;:&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chmod &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;PERMISSIONS&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Directory &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; already exists.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Ensuring correct ownership &amp;amp; permissions...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chown &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;:&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chmod &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;PERMISSIONS&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 3. Copy binary to &#x2F;opt&#x2F;honeypot if it differs
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Checking if &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;BINARY_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; needs to be updated...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_CHECKSUM&lt;&#x2F;span&gt;&lt;span&gt;=$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sha256sum &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;awk &lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{print $1}&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;INSTALL_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;BINARY_NAME&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;-f &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_CHECKSUM&lt;&#x2F;span&gt;&lt;span&gt;=$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; sha256sum &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;awk &lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{print $1}&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_CHECKSUM&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; = &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_CHECKSUM&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Binary already matches the existing one; no copy needed.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Verify if the service is already running
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# If it is, we need to stop it first
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl is-active&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --quiet &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Stopping &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; service...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl stop &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Copying updated binary to &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; cp &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chown &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;:&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chmod +x &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Verify if the service is already running
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# If it is, we need to stop it first
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl is-active&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --quiet &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Stopping &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; service...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl stop &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   No existing binary at &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;, copying now...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; cp &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;LOCAL_BINARY_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chown &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;:&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; chmod +x &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 4. Create or update systemd service file
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Installing or updating systemd unit file at &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_FILE_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;[Unit]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Description=Honeypot Service
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;After=network.target
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;[Service]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Type=simple
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;WorkingDirectory=&#x2F;opt&#x2F;honeypot
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;User=&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Group=&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HONEYPOT_GROUP&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;ExecStart=&lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;REMOTE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;StandardOutput=file:&#x2F;var&#x2F;log&#x2F;honeypot.log
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;StandardError=file:&#x2F;var&#x2F;log&#x2F;honeypot_err.log
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Restart=on-failure
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;[Install]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;WantedBy=multi-user.target
&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## If the file doesn&amp;#39;t exist OR the content differs, overwrite it
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;-f &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;CURRENT_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;=$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; cat &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;[ &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;CURRENT_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; != &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_FILE_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;then
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Updating systemd service file because content changed...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_FILE_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; tee &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;gt;&#x2F;dev&#x2F;null
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Systemd unit file already up-to-date.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;   Creating new systemd service file...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_FILE_CONTENT&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; | &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; tee &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SYSTEMD_UNIT_PATH&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &amp;gt;&#x2F;dev&#x2F;null
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fi
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## 5. Reload &amp;amp; restart systemd service
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;###############################################################################
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Reloading systemd daemon...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl daemon-reload
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Enabling &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; service to start on boot...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl enable &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Restarting &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; service...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl restart &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Checking &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; status...&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span&gt; systemctl status &amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;.service&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --no-pager &lt;&#x2F;span&gt;&lt;span&gt;|| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;true
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;echo &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&amp;gt;&amp;gt; Done! The &lt;&#x2F;span&gt;&lt;span&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;SERVICE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt; service is set up and running.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This script installs the honeypot binary, creates a systemd service, and starts the service. It also ensures that the service is stopped before updating the binary or service file. The service logs are written to &lt;code&gt;&#x2F;var&#x2F;log&#x2F;honeypot.log&lt;&#x2F;code&gt; and &lt;code&gt;&#x2F;var&#x2F;log&#x2F;honeypot_err.log&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The binary is run under the privileges of the &lt;code&gt;honeypot&lt;&#x2F;code&gt; user, which is created if it doesn’t exist. The honeypot binary is copied to &lt;code&gt;&#x2F;opt&#x2F;honeypot&lt;&#x2F;code&gt;, and the systemd service file is created or updated. The service is then reloaded, enabled, and restarted.&lt;&#x2F;p&gt;
&lt;p&gt;A pro-tip I got from Daniel Thompson-Yvetot was to assume the box will be powned and to make it more interesting for the attacker. For example, you change the name of the honeypot sevice to &lt;code&gt;fastxmrminer.service&lt;&#x2F;code&gt; and the binary to &lt;code&gt;fastxmrminer&lt;&#x2F;code&gt; and the attacker will think they hit the jackpot.&lt;&#x2F;p&gt;
&lt;p&gt;In the current version I kept it simple and straightforward for educational purposes, but you can expand on this idea.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-testing-and-monitoring&quot;&gt;5. Testing and Monitoring&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;5-1-live-logs&quot;&gt;5.1 Live Logs&lt;&#x2F;h3&gt;
&lt;p&gt;You can monitor the honeypot logs in real-time using &lt;code&gt;tail -f&lt;&#x2F;code&gt;. Here’s how to check the logs:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;SSH into your server.&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;tail -f &#x2F;var&#x2F;log&#x2F;honeypot.log&lt;&#x2F;code&gt; to monitor incoming requests.&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;tail -f &#x2F;var&#x2F;log&#x2F;honeypot_err.log&lt;&#x2F;code&gt; to monitor errors.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I separated the logs to make it easier to distinguish between regular logs and errors. You can customize the log paths and contents to suit your needs.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;stderr&lt;&#x2F;code&gt; could benefit from &lt;code&gt;structured logging&lt;&#x2F;code&gt; or &lt;code&gt;tracing&lt;&#x2F;code&gt;, but for this simple honeypot, we’ll keep it basic.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-2-simulating-an-attack&quot;&gt;5.2 Simulating an Attack&lt;&#x2F;h3&gt;
&lt;p&gt;You can test your honeypot by connecting to it using &lt;code&gt;telnet&lt;&#x2F;code&gt; or &lt;code&gt;nc&lt;&#x2F;code&gt; from your local machine. Here’s how:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;From your local machine, run &lt;code&gt;telnet &amp;lt;server_ip&amp;gt; 2222&lt;&#x2F;code&gt; or &lt;code&gt;nc &amp;lt;server_ip&amp;gt; 2222&lt;&#x2F;code&gt; to connect to the honeypot.&lt;&#x2F;li&gt;
&lt;li&gt;Enter some random text and press Enter.&lt;&#x2F;li&gt;
&lt;li&gt;Check the logs on the server to see the incoming request.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;5-3-gathering-intelligence&quot;&gt;5.3 Gathering Intelligence&lt;&#x2F;h3&gt;
&lt;p&gt;Over time, your honeypot will encounter a variety of malicious activities, including port scans, SSH brute-force attempts, and automated exploit scripts. By storing these logs for analysis, you can gain valuable insights into who’s probing your system and what they’re attempting to achieve.&lt;&#x2F;p&gt;
&lt;p&gt;Setting up alerts or notifications can help you identify specific patterns in real-time. Tools like the ELK Stack or Splunk are excellent for log analysis and can be configured to trigger alerts based on defined criteria.&lt;&#x2F;p&gt;
&lt;p&gt;For example, I observed numerous SSH brute-force attempts and port scans targeting my honeypot. It was fascinating to watch the diversity of attacks unfold in real time. One notable instance involved a “Makiko” client—a Rust-based SSH client—attempting to connect, showcasing that Rust is also being utilized for malicious purposes. Shortly after, I detected a Go-based client attempting to connect as well—although, admittedly, Go might not be the ideal language for this kind of job :)&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Deploying a custom Rust honeypot on an always-free Oracle Cloud instance gives you hands-on insight into real-world malicious activity. You’ve learned how to code a simple TCP server in Rust, configure Oracle’s networking, manage an OCI&#x27;s firewall, and centralize logging. With a bit of creativity, you can expand your honeypot to emulate common protocols, capture richer data, or integrate with threat intelligence pipelines. Happy hacking—safely, of course!&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;github-repository&quot;&gt;GitHub Repository&lt;&#x2F;h2&gt;
&lt;p&gt;You can find the code for this project on my GitHub repository &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;honeypot&quot; target=&quot;_blank&quot;&gt;Rust Honeypot&lt;&#x2F;a&gt;. Feel free to fork, modify, and experiment with it and if you star it - I will be very happy - I may be tempted to write more guides like this one it has been fun to write.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;author&quot;&gt;Author&lt;&#x2F;h2&gt;
&lt;p&gt;Bob Peters - &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&quot; target=&quot;_blank&quot;&gt;Rust Trends&lt;&#x2F;a&gt; - &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further Reading&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.oracle.com&#x2F;cloud&#x2F;free&#x2F;&quot; target=&quot;_blank&quot;&gt;Oracle Cloud Free Tier&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Standard Library&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Nice inspiration &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cowrie&#x2F;cowrie&quot; target=&quot;_blank&quot;&gt;Cowrie - Medium to High interaction Honeypot&lt;&#x2F;a&gt;*&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;*Thank you for the tip Dario Lencina Talarico&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>56 - Unlocking New Insights and Opportunities in Rust</title>
          <pubDate>Sun, 22 Dec 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/unlocking-new-insights-and-opportunities-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/unlocking-new-insights-and-opportunities-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/unlocking-new-insights-and-opportunities-in-rust/">&lt;br&gt;
Whether you’re here for the latest Rust updates, hot community discussions, or just some quality learning opportunities, you’re in for a treat.
&lt;p&gt;This week, we’re exploring how Rust is redefining error handling, celebrating breakthroughs in migrating C to safe Rust, and giving you a chance to win big with our CodeCrafters giveaway. Plus, we’ve packed in insights, tips, and a dash of Rusty cheer to keep things lively.&lt;&#x2F;p&gt;
&lt;p&gt;As we wind down the year, I want to wish you all a fantastic holiday season and a Happy New Year! 🎄 May your builds be fast, your lifetimes long, and your unwraps always safe.&lt;&#x2F;p&gt;
&lt;p&gt;So, grab your favorite beverage, settle in, and let’s talk Rust. 🚀&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rocket-let-s-build-systems-and-win-big&quot;&gt;🚀 Let’s Build Systems and Win Big!&lt;&#x2F;h2&gt;
&lt;p&gt;The CodeCrafters Giveaway is on! 🎉 Congrats to Ayush Pratap Singh, our first winner of a free 3-month subscription! Another winner will be chosen next week, and the final winner will be announced at year’s end—could it be you?&lt;&#x2F;p&gt;
&lt;p&gt;✨ Here’s the Deal:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;1 Week Free Trial: &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;Sign up&lt;&#x2F;a&gt; with my referral link to try CodeCrafters for free.&lt;&#x2F;li&gt;
&lt;li&gt;Win 3 Months Free: Each sign-up enters you into a draw—one winner down, two to go!&lt;&#x2F;li&gt;
&lt;li&gt;Save 40%: Use your employer’s remaining training budget to get a 40% discount via my link, the year is almost over!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;💻 Don’t miss this chance to sharpen your Rust skills while making the most of your training budget. &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;Sign up&lt;&#x2F;a&gt;, start coding, and end the year on a high note!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;effective-error-handling-in-rust-lessons-from-greptimedb&quot;&gt;Effective Error Handling in Rust: Lessons from GreptimeDB&lt;&#x2F;h2&gt;
&lt;p&gt;In large Rust projects like &lt;a href=&quot;https:&#x2F;&#x2F;greptime.com&#x2F;blogs&#x2F;2024-05-07-error-rust&quot; target=&quot;_blank&quot;&gt;GreptimeDB&lt;&#x2F;a&gt;, error handling can make or break code clarity and maintainability. GreptimeDB employs the snafu crate to manage its extensive error ecosystem, creating custom error types for each module while maintaining a unified strategy. This approach enables detailed error stacks that record precise locations and causes—something more contextual than a typical backtrace.&lt;&#x2F;p&gt;
&lt;p&gt;For example:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;0: Foo error, at src&#x2F;common&#x2F;catalog&#x2F;src&#x2F;error.rs:80:10
&lt;&#x2F;span&gt;&lt;span&gt;1: Bar error, at src&#x2F;common&#x2F;function&#x2F;src&#x2F;error.rs:90:10
&lt;&#x2F;span&gt;&lt;span&gt;2: Root cause, invalid table name, at src&#x2F;error.rs:100:10
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Notably, GreptimeDB’s approach coexists with other popular Rust error-handling crates. &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dtolnay&#x2F;thiserror&quot; target=&quot;_blank&quot;&gt;thiserror&lt;&#x2F;a&gt; simplifies custom error implementations, while &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dtolnay&#x2F;anyhow&quot; target=&quot;_blank&quot;&gt;anyhow&lt;&#x2F;a&gt; offers a convenient “catch-all” solution for apps prioritizing simplicity. Each serves different needs, but GreptimeDB’s &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shepmaster&#x2F;snafu&quot; target=&quot;_blank&quot;&gt;snafu&lt;&#x2F;a&gt; integration exemplifies fine-grained control over complex scenarios.&lt;&#x2F;p&gt;
&lt;p&gt;Key Takeaways:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Error Context Matters: Detailed error stacks save debugging time by showing where and why failures occur.&lt;&#x2F;li&gt;
&lt;li&gt;Know Your Tools: The choice of snafu, thiserror, or anyhow depends on project complexity and team needs—mix wisely for balance.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Error-handling strategy isn’t just about fixing bugs; it’s about empowering both developers and end-users with clarity and precision.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;from-c-to-safe-rust-how-a-new-paper-could-revolutionize-code-migration&quot;&gt;From C to Safe Rust: How a New Paper Could Revolutionize Code Migration&lt;&#x2F;h2&gt;
&lt;p&gt;A recent paper, “Compiling C to Safe Rust, Formalized” by Aymeric Fromherz and Jonathan Protzenko, delves into the complexities of translating C code into safe Rust.&lt;&#x2F;p&gt;
&lt;p&gt;The authors present a type-directed translation method that converts a subset of C into safe Rust, ensuring the resulting code complies with Rust’s stringent safety guarantees without relying on unsafe constructs. A notable innovation is their static analysis technique, “split trees,” which effectively maps C’s pointer arithmetic to Rust’s slices and splitting operations.&lt;&#x2F;p&gt;
&lt;p&gt;Applying this methodology to formally verified C codebases, such as the HACL cryptographic library and EverParse’s binary parsers, they successfully generated pure Rust codebases without the use of unsafe code. This effort resulted in an 80,000-line verified cryptographic library in Rust, implementing modern algorithms without a single use of unsafe.&lt;&#x2F;p&gt;
&lt;p&gt;This research highlights the feasibility of migrating critical C codebases to Rust, enhancing memory safety and security while preserving performance and formal verification assurances.&lt;&#x2F;p&gt;
&lt;p&gt;For those interested in the technical details, for the &lt;a href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2412.15042&quot; target=&quot;_blank&quot;&gt;full paper click here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;An ongoing &lt;a href=&quot;https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42476192&quot; target=&quot;_blank&quot;&gt;discussion about&lt;&#x2F;a&gt; this paper is taking place on Hacker News.&lt;&#x2F;p&gt;
&lt;p&gt;This work underscores the potential for automated tools to facilitate the transition from C to Rust, promoting safer and more secure software development practices.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;nexustrade.io&#x2F;blog&#x2F;i-spent-2-years-rebuilding-my-algorithmic-trading-platform-in-rust-i-have-noregrets-20241205&quot; target=&quot;_blank&quot;&gt;Rebuilding an algorithmic trading platform in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@rustlabconference3671&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Rustlab Conference Youtube videos&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gRAVZv7V91Q&amp;ab_channel=leddoo&quot; target=&quot;_blank&quot;&gt;Great Youtube explainer on Lifetimes&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>55 - Your Weekly Rust Fix: Templates, Dependencies, and a Big Giveaway!</title>
          <pubDate>Sat, 07 Dec 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/your-weekly-rust-fix-templates-dependencies-and-a-big-giveaway/</link>
          <guid>https://rust-trends.com/newsletter/your-weekly-rust-fix-templates-dependencies-and-a-big-giveaway/</guid>
          <description xml:base="https://rust-trends.com/newsletter/your-weekly-rust-fix-templates-dependencies-and-a-big-giveaway/">&lt;br&gt;
Welcome to this week’s edition of Rust Trends, where we dive into all things Rust — tools, updates, and community  happenings. This week, we’ve got some exciting topics lined up:
 - A deep dive into the power of cargo-generate for project templates.
 - Why Deps.rs should be your go-to for dependency health checks.
 - A special announcement for CodeCrafters enthusiasts (hint: giveaways!).
 - And, of course, a call to action to shape Rust’s future through the 2024 State of Rust Survey.
&lt;p&gt;Grab a coffee (or your beverage of choice), and let’s jump in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rocket-let-s-build-systems-and-win-big&quot;&gt;🚀 Let’s Build Systems and Win Big!&lt;&#x2F;h2&gt;
&lt;p&gt;Hey Rustaceans! 🚀 Let’s Build Systems and Win Big!&lt;&#x2F;p&gt;
&lt;p&gt;Our CodeCrafters Giveaway is here, round two! 🎉 If you’ve been itching to dive deep into Rust while building your own versions of systems like Git, Docker, and more, this is your chance. CodeCrafters makes it fun, challenging, and totally rewarding—and now you can snag some sweet perks while you’re at it.&lt;&#x2F;p&gt;
&lt;p&gt;1️⃣ One Week Free Trial - No strings attached
Sign up using &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;my exclusive referral link&lt;&#x2F;a&gt;, and you’ll score a whole week of CodeCrafters goodness for free. Test it out, level up your Rust game, and see what all the hype is about.&lt;&#x2F;p&gt;
&lt;p&gt;2️⃣ Win 3 Months Free
Every sign-up through my referral link is automatically entered into a draw to win one of three 3-month subscriptions to CodeCrafters! No hoops to jump through—just sign up, code, and you’re in.&lt;&#x2F;p&gt;
&lt;p&gt;It’s That Simple:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;Sign up with the link&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Start your Rust journey.&lt;&#x2F;li&gt;
&lt;li&gt;Win big (maybe)!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Let’s make some Rust magic together! 🌟 Winners will be announced soon, so don’t wait—get started now and take your Rust skills to the next level.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-project-templates-made-easy-exploring-cargo-generate&quot;&gt;Rust Project Templates Made Easy: Exploring cargo-generate&lt;&#x2F;h2&gt;
&lt;p&gt;Starting a new Rust project is as simple as running cargo new, but when your project requires specific configurations, like for embedded development, this simplicity can become a double-edged sword. That’s where cargo-generate steps in, acting as a versatile project templating tool that streamlines the setup of Rust projects with custom templates.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-is-cargo-generate&quot;&gt;What is cargo-generate?&lt;&#x2F;h3&gt;
&lt;p&gt;cargo-generate is a developer tool that enables you to create new Rust projects from existing templates stored in Git repositories. By leveraging these templates, you can quickly scaffold projects that include predefined configurations, dependencies, and file structures tailored to your needs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-use-cargo-generate&quot;&gt;Why Use cargo-generate?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Consistency Across Projects: By using templates, you ensure that all your projects start with a consistent structure and configuration, reducing setup errors and saving time.&lt;&#x2F;li&gt;
&lt;li&gt;Simplified Setup for Complex Configurations: For projects that require additional files like build.rs, rust-toolchain.toml, or .cargo&#x2F;config.toml, common in embedded development, cargo-generate includes these files out of the box, which cargo new or cargo init do not provide.&lt;&#x2F;li&gt;
&lt;li&gt;Customization Through Placeholders and Hooks: Templates can define placeholders and hooks, allowing you to customize aspects of the project during generation, such as naming conventions or enabling specific features.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;getting-started-with-cargo-generate&quot;&gt;Getting Started with cargo-generate&lt;&#x2F;h3&gt;
&lt;p&gt;Install cargo-generate using Cargo:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; install cargo-generate
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;generating-a-new-project&quot;&gt;Generating a New Project:&lt;&#x2F;h3&gt;
&lt;p&gt;Use cargo-generate with a template repository:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; generate&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --git&lt;&#x2F;span&gt;&lt;span&gt; https:&#x2F;&#x2F;github.com&#x2F;username&#x2F;template-repo.git
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You’ll be prompted to provide details like the project name and other template-specific options.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;takeaways&quot;&gt;Takeaways&lt;&#x2F;h3&gt;
&lt;p&gt;Incorporating cargo-generate into your workflow can significantly enhance productivity, especially for projects with specialized requirements. By automating the inclusion of necessary configuration files and ensuring a consistent project structure, it allows you to focus more on development and less on setup.&lt;&#x2F;p&gt;
&lt;p&gt;For embedded Rust projects, where additional configuration files are often essential, cargo-generate proves to be an invaluable tool, simplifying the setup process and ensuring that all necessary components are in place from the start.&lt;&#x2F;p&gt;
&lt;p&gt;So, the next time you’re about to start a new Rust project, consider whether cargo-generate can help you hit the ground running with a tailored template.&lt;&#x2F;p&gt;
&lt;p&gt;For more information see the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cargo-generate&#x2F;cargo-generate&quot; target=&quot;_blank&quot;&gt;Github repository of cargo generate&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-every-rust-developer-should-know-about-deps-rs&quot;&gt;Why Every Rust Developer Should Know About Deps.rs&lt;&#x2F;h2&gt;
&lt;p&gt;Managing dependencies in Rust projects can be a daunting task, especially when ensuring that all are up-to-date and free from security vulnerabilities. Enter Deps.rs, a dedicated service for the Rust community that simplifies this process by analyzing your project’s Cargo.toml file to detect outdated or insecure dependencies.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-is-deps-rs&quot;&gt;What is Deps.rs?&lt;&#x2F;h3&gt;
&lt;p&gt;Deps.rs is an open-source tool that examines the dependencies specified in your Rust project’s Cargo.toml file. It compares them against the latest versions available on &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&quot; target=&quot;_blank&quot;&gt;crates.io&lt;&#x2F;a&gt; and checks for any known security vulnerabilities using the RustSec Security Advisory Database. This analysis provides a clear overview of which dependencies are outdated or potentially insecure.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Dependency Status Reports: Deps.rs offers detailed reports indicating the current status of each dependency, highlighting those that are outdated or have known security issues.&lt;&#x2F;li&gt;
&lt;li&gt;Repository and Crate Support: You can analyze dependencies for both individual crates and entire repositories hosted on platforms like GitHub, GitLab, Bitbucket, SourceHut, Codeberg, and Gitea.&lt;&#x2F;li&gt;
&lt;li&gt;Embeddable Badges: Deps.rs provides SVG badges that display the status of your dependencies. These can be embedded in your project’s README.md, offering a quick visual indicator of dependency health.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;why-use-deps-rs&quot;&gt;Why Use Deps.rs?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Maintain Up-to-Date Dependencies: By regularly checking your project with Deps.rs, you can ensure that all dependencies are current, benefiting from the latest features and bug fixes.&lt;&#x2F;li&gt;
&lt;li&gt;Enhance Security: Deps.rs identifies dependencies with known vulnerabilities, allowing you to address security risks promptly.&lt;&#x2F;li&gt;
&lt;li&gt;Simplify Dependency Management: Deps.rs automates the monitoring of dependencies, reducing the manual effort required to keep track of updates and security advisories.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Incorporating Deps.rs into your development workflow is a proactive step toward maintaining a healthy and secure Rust project. By providing clear insights into the state of your dependencies, it empowers you to make informed decisions and keep your project robust.&lt;&#x2F;p&gt;
&lt;p&gt;For more information or to contribute to the project, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;deps-rs&#x2F;deps.rs&quot; target=&quot;_blank&quot;&gt;visit the Deps.rs GitHub repository&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;2024-state-of-rust-survey&quot;&gt;2024 State of Rust Survey&lt;&#x2F;h2&gt;
&lt;p&gt;The 2024 State of Rust Survey is live, and we need your input to shape the future of Rust!&lt;&#x2F;p&gt;
&lt;p&gt;Why Take the Survey?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Help the Rust Project understand what’s working and what’s not.&lt;&#x2F;li&gt;
&lt;li&gt;Share your experiences, whether you’re a pro or just starting out.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Details:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;⏱ Takes 10-25 minutes.&lt;&#x2F;li&gt;
&lt;li&gt;🌐 Available in multiple languages.&lt;&#x2F;li&gt;
&lt;li&gt;📅 Deadline: December 23, 2024.&lt;&#x2F;li&gt;
&lt;li&gt;👉 Take the Survey Here&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Your feedback is crucial—thank you for helping Rust grow!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;blog&#x2F;rust-conferences-2025&#x2F;&quot; target=&quot;_blank&quot;&gt;Overview of Rust Conferences in 2025&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.rustfinity.com&#x2F;advent-of-rust&quot; target=&quot;_blank&quot;&gt;Advent of Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;adventofcode.com&#x2F;&quot; target=&quot;_blank&quot;&gt;The real Advent of Code&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1h3bqv0&#x2F;why_is_ringbuf_crate_so_fast&#x2F;&quot; target=&quot;_blank&quot;&gt;Why is &lt;code&gt;ringbuf&lt;&#x2F;code&gt; crate so fast? (Reddit)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>54 - Rust in Action: Embedded Systems, Rewrites, and a Surprise Giveaway! 🎉</title>
          <pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-in-action-embedded-systems-rewrites-and-a-surprise-giveaway/</link>
          <guid>https://rust-trends.com/newsletter/rust-in-action-embedded-systems-rewrites-and-a-surprise-giveaway/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-in-action-embedded-systems-rewrites-and-a-surprise-giveaway/">&lt;br&gt;
This edition of Rust Trends has it all: insights into Rust’s role in embedded systems, Microsoft’s large-scale rewrites, and a DIY WiFi-controlled car project powered by Rust and ESP32 and more.
&lt;p&gt;But that’s not all—we’re also hosting a special Rust giveaway for the upcoming end of the year holiday season! Curious? Read on to find out how you can snag some Rusty goodies.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s dive in! 🎉&lt;&#x2F;p&gt;
&lt;h2 id=&quot;dive-into-sqlite-internals-with-rust&quot;&gt;Dive into SQLite Internals with Rust&lt;&#x2F;h2&gt;
&lt;p&gt;Ever wondered how SQLite works under the hood? Geoffrey Copin’s tutorials take you step-by-step through building your own SQLite clone using Rust—perfect for systems programming enthusiasts and the database-curious alike.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;part-1-listing-tables&quot;&gt;Part 1: Listing Tables&lt;&#x2F;h3&gt;
&lt;p&gt;Learn to parse SQLite database files and implement the .tables command in &lt;a href=&quot;https:&#x2F;&#x2F;blog.sylver.dev&#x2F;build-your-own-sqlite-part-1-listing-tables&quot; target=&quot;_blank&quot;&gt;“Build your own SQLite, Part 1: Listing Tables”&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;part-2-scanning-large-tables&quot;&gt;Part 2: Scanning Large Tables&lt;&#x2F;h3&gt;
&lt;p&gt;Handle tables spanning multiple pages, explore B-tree interior pages, and refine scanning logic in &lt;a href=&quot;https:&#x2F;&#x2F;blog.sylver.dev&#x2F;build-your-own-sqlite-part-2-scanning-large-tables&quot; target=&quot;_blank&quot;&gt;“Build your own SQLite, Part 2: Scanning Large Tables”&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;part-3-sql-parsing-101&quot;&gt;Part 3: SQL Parsing 101&lt;&#x2F;h3&gt;
&lt;p&gt;Dive into interpreting SQL queries and translating them into database actions with &lt;a href=&quot;“Build your own SQLite, Part 3: SQL Parsing 101”&quot; target=&quot;_blank&quot;&gt;“Build your own SQLite, Part 3: SQL Parsing 101”&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;part-4-coming-soon&quot;&gt;Part 4: Coming Soon!&lt;&#x2F;h3&gt;
&lt;p&gt;The series isn’t stopping here—Part 4 is in the works! Expect even more depth as Geoffrey continues to break down SQLite’s magic in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Follow along and take your Rust skills to the next level!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;at-eurorust-2024-embedded-systems-and-big-tech-journeys&quot;&gt;At EuroRust 2024: Embedded Systems and Big Tech Journeys&lt;&#x2F;h2&gt;
&lt;p&gt;EuroRust 2024 brought some phenomenal talks, and here are two must-watch highlights that capture the breadth of Rust’s potential—from embedded systems to major rewrites in Big Tech:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Jonathan Pallant: &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=-ewuFNKIAVI&amp;t=133s&quot; target=&quot;_blank&quot;&gt;“SD Cards, Filesystems, and Embedded Rust”&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt; JP takes us on a journey into embedded development, showing how embedded-hal makes it possible to write portable SD Card drivers across microcontrollers. With Rust’s types ensuring safer command handling and responses, this talk is a treasure trove for anyone navigating low-level development. Bonus: the dive into Microsoft’s FAT filesystem will give you fresh insights into how files and directories are represented on disk.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Victor Ciura: &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=kiG5-LzIQ54&quot; target=&quot;_blank&quot;&gt;“Let’s Rewrite It in Rust”&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt; Once just a meme, rewriting in Rust is now a serious business—especially at Microsoft. Victor shares stories from Microsoft365’s Oxidizer effort, where Rust foundational libraries are transforming the organization. His perspective on coming to Rust from both C++ and C# backgrounds highlights the gems, gaps, and tools you should know about if you’re considering a similar leap.&lt;&#x2F;p&gt;
&lt;p&gt;These talks underscore how versatile Rust has become, tackling challenges from embedded systems to enterprise-scale libraries. Whether you’re looking to optimize hardware interactions or rewrite legacy systems, there’s inspiration here for everyone.&lt;&#x2F;p&gt;
&lt;p&gt;Have a favorite insight or challenge you’d like to share? Let’s keep the conversation going!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;build-a-wifi-controlled-car-with-rust-and-esp32&quot;&gt;Build a WiFi-Controlled Car with Rust and ESP32&lt;&#x2F;h2&gt;
&lt;p&gt;Ever wanted to mix Rust with robotics? James McMurray’s WiFi-controlled car project shows how you can create a rover with an ESP32 board and Rust. Here’s the scoop:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-setup&quot;&gt;The Setup:&lt;&#x2F;h3&gt;
&lt;p&gt;The car uses an ESP32 board for control, an ESP32-CAM for live video, and motor drivers to handle movement. WiFi lets you send commands from a Rust-based client on your PC while viewing real-time video.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-makes-it-cool&quot;&gt;What Makes It Cool:&lt;&#x2F;h3&gt;
&lt;p&gt;Rust’s safety and performance powers both the car and the control app.&lt;&#x2F;p&gt;
&lt;p&gt;esp-wifi and embedded-hal crates simplify hardware and networking.&lt;&#x2F;p&gt;
&lt;p&gt;Challenges like WiFi issues and camera setup are well-documented, making it beginner-friendly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;future-potential&quot;&gt;Future Potential:&lt;&#x2F;h3&gt;
&lt;p&gt;Add features like obstacle detection, better motor control, or BLE for WiFi setup.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;jamesmcm.github.io&#x2F;blog&#x2F;esp32-wifi-tank&#x2F;&quot; target=&quot;_blank&quot;&gt;Check out the full guide and code here&lt;&#x2F;a&gt;. Whether you’re new to Rust or love embedded systems, this project is a fun way to dive in.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tada-codecrafters-giveaway-master-rust-and-win-big-tada&quot;&gt;🎉 CodeCrafters Giveaway – Master Rust and Win Big! 🎉&lt;&#x2F;h2&gt;
&lt;p&gt;Hey Rustaceans! I’m thrilled to announce a giveaway for CodeCrafters—the platform where you can tackle coding challenges and build your own versions of popular systems in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Here’s the deal:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;One Week Free Trial: Sign up with &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;my special referral link&lt;&#x2F;a&gt;, and you’ll automatically get one free week of CodeCrafters to explore and level up your Rust skills. No strings attached!&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Win 3 Months Free: When you sign up using the referral link, you’re automatically entered to win one of three 3-month subscriptions to CodeCrafters! No extra steps required—just sign up, start coding, and you’re in.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;It’s simple: sign up, learn Rust, and you might even win 3 months free!&lt;&#x2F;p&gt;
&lt;p&gt;Don’t forget: Stay in the loop for more Rust updates and announcements by &lt;a href=&quot;http:&#x2F;&#x2F;rust-trends.com&#x2F;signup&quot; target=&quot;_blank&quot;&gt;signing up for my newsletter&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Start your CodeCrafters journey today and make Rust magic happen! Winners will be announced soon—stay tuned!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;bitfieldconsulting.com&#x2F;posts&#x2F;rust-and-go&quot; target=&quot;_blank&quot;&gt;Rust from a Go perspective&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;gendignoux.com&#x2F;blog&#x2F;2024&#x2F;11&#x2F;18&#x2F;rust-rayon-optimized.html&quot; target=&quot;_blank&quot;&gt;Optimization adventures: making a parallel Rust workload 10x faster&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>46 - Rust Masterclass: Essential Knowledge for Developers</title>
          <pubDate>Sat, 27 Jul 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-masterclass-essential-knowledge-for-developers/</link>
          <guid>https://rust-trends.com/newsletter/rust-masterclass-essential-knowledge-for-developers/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-masterclass-essential-knowledge-for-developers/">&lt;br&gt;
Welcome to the latest edition of Rust Trends! This week, we’re diving into essential tools and techniques to elevate your Rust programming skills. Our spotlight article explores how to master Clippy, Rust’s robust linter, ensuring your code is clean, efficient, and idiomatic. Plus, we share expert tips on optimizing your Cargo.toml file for better project management and performance.
&lt;p&gt;Stay tuned for more insights, and don’t forget to share this newsletter with fellow Rustaceans!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;mastering-clippy-elevating-your-rust-code-quality&quot;&gt;Mastering Clippy: Elevating Your Rust Code Quality&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;46&#x2F;clippy.webp&quot; alt=&quot;Clippy Linter&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 80%; border:0&quot;&gt;
&lt;p&gt;Have you ever wondered how to ensure your Rust code is as clean, efficient, and idiomatic as possible? Our latest blog post dives deep into Clippy, Rust’s powerful linter, and how you can leverage its various lints to elevate your coding game. Whether you’re a seasoned developer or just starting out, these tips and configurations will help you catch common mistakes and improve your code quality.&lt;&#x2F;p&gt;
&lt;p&gt;Check out the full article on our blog and start mastering Clippy today!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;mastering-clippy-elevating-your-rust-code-quality&#x2F;&quot;&gt;Read the full article here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;optimizing-your-cargo-toml-file-tips-and-tricks&quot;&gt;Optimizing Your Cargo.toml File: Tips and Tricks&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;46&#x2F;cargo.webp&quot; alt=&quot;&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;If you’re working with Rust, understanding the Cargo.toml file is crucial. For instance, did you know that setting the correct edition key in Cargo.toml can help you avoid compatibility issues? Also, using features wisely can modularize your code and improve compile times. These are just a couple of the many valuable tips you’ll find. For a comprehensive guide on optimizing your Cargo.toml file check out the full article &lt;a href=&quot;https:&#x2F;&#x2F;towardsdatascience.com&#x2F;nine-rust-cargo-toml-wats-and-wat-nots-1e5e02e41648&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;07&#x2F;25&#x2F;Rust-1.80.0.html&quot;&gt;Announcing Rust 1.80.0&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;survey.stackoverflow.co&#x2F;2024&#x2F;technology#admired-and-desired-language-desire-admire&quot;&gt;Rust most-admired programming language - StackOverFlow&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s02e07-system76&#x2F;&quot;&gt;Podcast on writing your own OS&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Mastering Clippy: Elevating Your Rust Code Quality</title>
          <pubDate>Sat, 27 Jul 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/mastering-clippy-elevating-your-rust-code-quality/</link>
          <guid>https://rust-trends.com/posts/mastering-clippy-elevating-your-rust-code-quality/</guid>
          <description xml:base="https://rust-trends.com/posts/mastering-clippy-elevating-your-rust-code-quality/">&lt;p&gt;Clippy is an essential linter for Rust, helping to catch common mistakes and improve code quality by providing insightful warnings and suggestions. By configuring Clippy with specific lints, you can enhance your skills as a Rust programmer, ensuring your code is cleaner, more efficient, and aligned with best practices. In this guide, we’ll explore several Clippy lints, including some frequently recommended by the Rust community, and demonstrate how to configure them.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;recommended-clippy-lints-for-improved-rust-code&quot;&gt;Recommended Clippy Lints for Improved Rust Code&lt;&#x2F;h2&gt;
&lt;p&gt;Here are some of the most recommended Clippy lints that can help you write better Rust code. Click on each lint to learn more about its purpose and how it can benefit your codebase.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;single_match&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;single_match&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns when a single match statement can be replaced with an &lt;code&gt;if let&lt;&#x2F;code&gt; statement.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;single_match_else&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;single_match_else&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns when a single match with an else clause can be replaced with an &lt;code&gt;if let... else&lt;&#x2F;code&gt; statement.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;needless_match&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;needless_match&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns when a match statement is used when an if statement would suffice.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;needless_late_init&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;needless_late_init&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Detects late initializations that can be avoided.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;redundant_pattern_matching&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;redundant_pattern_matching&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns when pattern matching on &lt;code&gt;Option&lt;&#x2F;code&gt; or &lt;code&gt;Result&lt;&#x2F;code&gt; is unnecessary.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;redundant_pattern&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;redundant_pattern&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Detects redundant patterns in matches.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;redundant_guards&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;redundant_guards&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about redundant match guards.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;collapsible_match&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;collapsible_match&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about match statements that can be collapsed.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;match_single_binding&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;match_single_binding&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns when a match statement with a single binding can be simplified.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;match_same_arms&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;match_same_arms&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Detects match arms that contain the same code.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;match_ref_pats&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;match_ref_pats&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about ref patterns in match statements.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;match_bool&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;match_bool&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about match statements over booleans.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;needless_bool&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;needless_bool&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Denotes when a boolean expression can be simplified.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;unwrap_used&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;unwrap_used&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about the use of &lt;code&gt;unwrap&lt;&#x2F;code&gt;, suggesting safer alternatives.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;expect_used&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;expect_used&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about the use of &lt;code&gt;expect&lt;&#x2F;code&gt;, suggesting safer alternatives.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;how-to-add-clippy-lints-to-your-rust-project&quot;&gt;How to Add Clippy Lints to Your Rust Project?&lt;&#x2F;h2&gt;
&lt;p&gt;To use these lints, you need to configure Clippy to include them in your Rust project. Here’s how you can add these lints to your Clippy configuration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;method-1-adding-lints-via-command-line&quot;&gt;Method 1: Adding Lints via Command Line&lt;&#x2F;h3&gt;
&lt;p&gt;You can run Clippy with specific warnings enabled directly from the command line. For instance:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; clippy -- \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::single_match \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::single_match_else \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::needless_match \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::needless_late_init \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::redundant_pattern_matching \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::redundant_pattern \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::redundant_guards \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::collapsible_match \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::match_single_binding \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::match_same_arms \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::match_ref_pats \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::match_bool \
&lt;&#x2F;span&gt;&lt;span&gt;    -D clippy::needless_bool \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::unwrap_used \
&lt;&#x2F;span&gt;&lt;span&gt;    -W clippy::expect_used
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;method-2-adding-lints-in-cargo-toml&quot;&gt;Method 2: Adding Lints in &lt;code&gt;cargo.toml&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;For a more permanent setup, you can add these lints to your &lt;code&gt;cargo.toml&lt;&#x2F;code&gt; file. This ensures that Clippy will always run with these configurations whenever you use it.&lt;&#x2F;p&gt;
&lt;p&gt;In your &lt;code&gt;cargo.toml&lt;&#x2F;code&gt;, add the following under &lt;code&gt;[lints.clippy]&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;toml&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-toml &quot;&gt;&lt;code class=&quot;language-toml&quot; data-lang=&quot;toml&quot;&gt;&lt;span&gt;[lints.clippy]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;single_match &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;single_match_else &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;needless_match &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;needless_late_init &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;redundant_pattern_matching &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;redundant_pattern &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;redundant_guards &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;collapsible_match &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;match_single_binding &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;match_same_arms &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;match_ref_pats &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;match_bool &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;needless_bool &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;deny&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;unwrap_used &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;expect_used &lt;&#x2F;span&gt;&lt;span&gt;= &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;warn&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;method-3-using-a-cargo-config-toml-file-in-your-project-or-home-directory&quot;&gt;Method 3: Using a &lt;code&gt;.cargo&#x2F;config.toml&lt;&#x2F;code&gt; File in Your Project or Home Directory&lt;&#x2F;h3&gt;
&lt;p&gt;You can also create a &lt;code&gt;.cargo&#x2F;config.toml&lt;&#x2F;code&gt; file in your project or home directory &lt;code&gt;~&#x2F;.cargo&#x2F;config&lt;&#x2F;code&gt; to set up Clippy lints. This file in these locations allow you to respectively configure per project or globally, providing flexibility in managing lints. For more information check the &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;reference&#x2F;config.html&quot; target=&quot;_blank&quot;&gt;Cargo Book&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;toml&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-toml &quot;&gt;&lt;code class=&quot;language-toml&quot; data-lang=&quot;toml&quot;&gt;&lt;span&gt;[target.&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;cfg(all())&lt;&#x2F;span&gt;&lt;span&gt;&amp;#39;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rustflags &lt;&#x2F;span&gt;&lt;span&gt;= [
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::single_match&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::single_match_else&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::needless_match&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::needless_late_init&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::redundant_pattern_matching&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::redundant_pattern&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::redundant_guards&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::collapsible_match&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::match_single_binding&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::match_same_arms&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::match_ref_pats&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::match_bool&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-D clippy::needless_bool&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::unwrap_used&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;-W clippy::expect_us&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;understanding-key-lints-by-example&quot;&gt;Understanding Key Lints by Example&lt;&#x2F;h2&gt;
&lt;p&gt;Let&#x27;s take a closer look at some of these lints to understand how they can help improve your Rust code.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;clippy::single_match&lt;&#x2F;strong&gt; and &lt;strong&gt;clippy::single_match_else&lt;&#x2F;strong&gt;: These lints encourage the use of &lt;code&gt;if let&lt;&#x2F;code&gt; statements where appropriate, making the code more concise and readable.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; option = Some(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Before
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; option {
&lt;&#x2F;span&gt;&lt;span&gt;    Some(x) =&amp;gt; println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, x),
&lt;&#x2F;span&gt;&lt;span&gt;    _ =&amp;gt; (),
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; After
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Some(x) = option {
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, x);
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;clippy::needless_match&lt;&#x2F;strong&gt;: This lint helps replace unnecessary match statements with simpler if statements.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Before
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;foo&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Result&amp;lt;(), &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; result {
&lt;&#x2F;span&gt;&lt;span&gt;        Ok(val) =&amp;gt; Ok(val),
&lt;&#x2F;span&gt;&lt;span&gt;        Err(err) =&amp;gt; Err(err),
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;bar&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Option&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Some(val) = option {
&lt;&#x2F;span&gt;&lt;span&gt;        Some(val)
&lt;&#x2F;span&gt;&lt;span&gt;    } &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;else &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        None
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; After
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;foo&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Result&amp;lt;(), &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    result
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;bar&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Option&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    option
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;clippy::redundant_pattern_matching&lt;&#x2F;strong&gt; and &lt;strong&gt;clippy::redundant_pattern&lt;&#x2F;strong&gt;: These lints catch unnecessary pattern matching and redundant patterns, suggesting more streamlined code.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Before
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Ok(_) = Ok::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Err(_) = Err::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;None = None::&amp;lt;()&amp;gt; {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Some(_) = Some(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Poll::Pending = Poll::Pending::&amp;lt;()&amp;gt; {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;Poll::Ready(_) = Poll::Ready(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V4&lt;&#x2F;span&gt;&lt;span&gt;(_) = IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V4&lt;&#x2F;span&gt;&lt;span&gt;(Ipv4Addr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;LOCALHOST&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span&gt;IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V6&lt;&#x2F;span&gt;&lt;span&gt;(_) = IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V6&lt;&#x2F;span&gt;&lt;span&gt;(Ipv6Addr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;LOCALHOST&lt;&#x2F;span&gt;&lt;span&gt;) {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span&gt;Ok::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;) {
&lt;&#x2F;span&gt;&lt;span&gt;    Ok(_) =&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    Err(_) =&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;false&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; cond = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if let &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true &lt;&#x2F;span&gt;&lt;span&gt;= cond {}
&lt;&#x2F;span&gt;&lt;span&gt;matches!(cond, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; After
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;Ok::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_ok&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;Err::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_err&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;None::&amp;lt;()&amp;gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_none&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;Some(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_some&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;Poll::Pending::&amp;lt;()&amp;gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_pending&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;Poll::Ready(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_ready&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V4&lt;&#x2F;span&gt;&lt;span&gt;(Ipv4Addr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;LOCALHOST&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_ipv4&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;IpAddr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;V6&lt;&#x2F;span&gt;&lt;span&gt;(Ipv6Addr::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;LOCALHOST&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_ipv6&lt;&#x2F;span&gt;&lt;span&gt;() {}
&lt;&#x2F;span&gt;&lt;span&gt;Ok::&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;i32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;42&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;is_ok&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; cond = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;true&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; cond {}
&lt;&#x2F;span&gt;&lt;span&gt;cond;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Looking for examples see the &lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;&quot; target=&quot;_blank&quot;&gt;Clippy Lints Overview&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;clippy-s-lint-groups&quot;&gt;Clippy&#x27;s Lint Groups&lt;&#x2F;h2&gt;
&lt;p&gt;To further enhance your Rust code quality and maintainability, have a look at Clippy&#x27;s lint categories and consider enabling additional lints that suit your project&#x27;s needs:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=pedantic&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;pedantic&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Enforces additional lints that are more pedantic, helping to catch more nuanced issues.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=nursery&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;nursery&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Enables lints that are still being trialed and have not yet been stabilized but can catch emerging patterns of code issues.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=cargo&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;cargo&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Checks for issues specifically related to Cargo, such as unused dependencies.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=complexity&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;complexity&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Warns about overly complex code that may be simplified.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=style&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;style&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Focuses on stylistic issues that can improve code readability and consistency. Beaware that these lints are opinionated.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=perf&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;perf&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Identifies performance issues in the code. Sincerely, this is a must-have for performance-critical applications.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=correctness&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;correctness&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Ensures that the code is correct and free from common mistakes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=restrictions&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;restriction&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Applies stricter rules that can help enforce certain coding standards within a project.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;#&#x2F;?groups=suspicious&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;suspicious&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Detects suspicious code patterns that may indicate potential bugs or issues.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;If you enable more lints, you may need to set priorities because certain lints may conflict with each other. See &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;stable&#x2F;cargo&#x2F;reference&#x2F;manifest.html#the-lints-section&quot; target=&quot;_blank&quot;&gt;Cargo Book - Lint section&lt;&#x2F;a&gt; for more information.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;By incorporating these Clippy lints into your workflow, you can ensure your Rust code is not only functional but also idiomatic, efficient, and maintainable. Experiment with different lints and configurations to find the right balance for your project, and watch your code quality soar to new heights.&lt;&#x2F;p&gt;
&lt;p&gt;References:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;stable&#x2F;cargo&#x2F;reference&#x2F;manifest.html#the-lints-section&quot; target=&quot;_blank&quot;&gt;Cargo Book - Lint section&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;rust-clippy&#x2F;master&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;Clippy Lints Overview&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;q9qz28&#x2F;sometimes_clippy_lints_amaze_me&#x2F;&quot; target=&quot;_blank&quot;&gt;Amazed by Clippy Lints - Reddit Discussion&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;EmbarkStudios&#x2F;rust-ecosystem&#x2F;blob&#x2F;main&#x2F;lints.toml&quot; target=&quot;_blank&quot;&gt;Setting up your Lints in .cargo&#x2F;config.toml - Example from EmbarkStudios&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>45 - Advancing Drone Technology and Testing in Rust: Insights and Tools</title>
          <pubDate>Sun, 14 Jul 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/advancing-drone-technology-and-testing-in-rust-insights-and-tools/</link>
          <guid>https://rust-trends.com/newsletter/advancing-drone-technology-and-testing-in-rust-insights-and-tools/</guid>
          <description xml:base="https://rust-trends.com/newsletter/advancing-drone-technology-and-testing-in-rust-insights-and-tools/">&lt;br&gt;
Welcome to the latest edition of Rust Trends! This week, we explore exciting advancements in Rust, including the integration of Nextest for enhanced testing, and a deep dive into Fusion Engineering’s use of Rust in drone technology. We also introduce a selection of innovative Rust-centric editors to boost your productivity. Stay informed and inspired with the latest updates from the Rust community!
&lt;p&gt;Happy Coding&lt;&#x2F;p&gt;
&lt;h2 id=&quot;boost-your-productivity-with-nextest&quot;&gt;Boost Your Productivity with Nextest&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;45&#x2F;Nextest.webp&quot; alt=&quot;Nextest&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;In the fast-paced world of software development, we’re all looking for ways to be more productive and efficient. Enter &lt;a href=&quot;https:&#x2F;&#x2F;nexte.st&#x2F;&quot; target=&quot;_blank&quot;&gt;Nextest&lt;&#x2F;a&gt;, a cutting-edge test runner for Rust. Built to supercharge your testing experience, Nextest offers blazing-fast performance and a rich set of features that streamline the testing process.&lt;&#x2F;p&gt;
&lt;p&gt;Why choose Nextest over the traditional cargo test? While cargo test is reliable and effective, Nextest takes your testing to the next level with:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Parallel Test Execution: Run multiple tests simultaneously, significantly reducing your overall test run time.&lt;&#x2F;li&gt;
&lt;li&gt;Advanced Reporting: Gain detailed insights with comprehensive and easy-to-read test reports.&lt;&#x2F;li&gt;
&lt;li&gt;Minimal Overhead: Experience faster start-up times and lower resource consumption, optimizing your development workflow.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Nextest integrates seamlessly into your workflow, helping you catch bugs faster and deliver robust code with confidence.&lt;&#x2F;p&gt;
&lt;p&gt;Don’t just take my word for it — head over to &lt;a href=&quot;https:&#x2F;&#x2F;nexte.st&#x2F;&quot; target=&quot;_blank&quot;&gt;Nextest’s website&lt;&#x2F;a&gt; and give it a try. Experience firsthand how it can transform your productivity and make your Rust development smoother and more enjoyable. Happy coding!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;podcast-highlight-rust-used-in-drone-technology&quot;&gt;Podcast Highlight: Rust used in Drone technology&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;45&#x2F;Drone-Wind-turbines.webp&quot; alt=&quot;Drones and Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;In the latest episode of the “Rust in Production” podcast, &lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s02e06-fusion-engineering&#x2F;&quot; target=&quot;_blank&quot;&gt;Jakub Valtar from Fusion Engineering&lt;&#x2F;a&gt; shares his insights on using Rust to develop next-generation flight controllers for drones. This episode is a must-listen for anyone interested in drone technology and Rust’s application in performance-critical environments. As I am building my own flight controller, Jakub’s discussion on their use of Rust, specific crates, hardware, and design patterns was particularly enlightening.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-fusion-engineering-chose-rust&quot;&gt;Why Fusion Engineering Chose Rust&lt;&#x2F;h3&gt;
&lt;p&gt;Fusion Engineering transitioned from C++ to Rust to take advantage of its memory safety, type system, and concurrency features. Jakub highlighted how Rust’s focus on performance, reliability, and productivity aligns perfectly with the needs of flight controllers. Rust helps prevent many common bugs and ensures that critical software operates smoothly without unexpected crashes.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-crates-used-by-fusion-engineering&quot;&gt;Key Crates Used by Fusion Engineering&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;inline-python&quot; target=&quot;_blank&quot;&gt;inline-python&lt;&#x2F;a&gt;: Embeds Python code directly in Rust, useful for simulations and plotting outputs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;intbits&quot; target=&quot;_blank&quot;&gt;intbits&lt;&#x2F;a&gt;: Works with individual bits, crucial for hardware drivers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;git-version&quot; target=&quot;_blank&quot;&gt;git-version&lt;&#x2F;a&gt;: Embeds Git version information in binaries, ensuring version consistency across software components.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;anyhow&quot; target=&quot;_blank&quot;&gt;anyhow&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;thiserror&quot; target=&quot;_blank&quot;&gt;thiserror&lt;&#x2F;a&gt;: Streamline error handling.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;nalgebra&quot; target=&quot;_blank&quot;&gt;nalgebra&lt;&#x2F;a&gt;: Handles complex mathematical computations needed for flight control algorithms.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;arrayvec&quot; target=&quot;_blank&quot;&gt;arrayvec&lt;&#x2F;a&gt;: Manages fixed-size arrays to avoid dynamic allocations, crucial for predictable performance.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;hardware-and-software-patterns&quot;&gt;Hardware and Software Patterns&lt;&#x2F;h3&gt;
&lt;p&gt;Fusion Engineering’s hardware setup includes a custom PCB with sensors and an STM32 microcontroller, along with a Raspberry Pi Compute Module 4 running a Linux-based system. They employ several design patterns to ensure robust and maintainable code:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-unofficial.github.io&#x2F;patterns&#x2F;patterns&#x2F;behavioural&#x2F;newtype.html&quot; target=&quot;_blank&quot;&gt;Newtype Pattern&lt;&#x2F;a&gt;: Encapsulates primitive types to add semantic meaning and avoid errors.&lt;&#x2F;li&gt;
&lt;li&gt;Enum States: Manages different modes and states of the drone, ensuring clear and maintainable state transitions.&lt;&#x2F;li&gt;
&lt;li&gt;Service-Oriented Architecture: Runs different processes as separate services, each responsible for specific tasks, communicating through shared memory e.g. files.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;benefits-of-using-rust&quot;&gt;Benefits of Using Rust&lt;&#x2F;h3&gt;
&lt;p&gt;Rust’s ecosystem, including its package manager, testing framework, and excellent documentation, has enabled Fusion Engineering to maintain high-quality code. The strong type system and memory safety guarantees have made Rust an ideal choice for their multidisciplinary team, allowing both software engineers and control engineers to contribute effectively, this would not have been possible with C&#x2F;C++.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;about-mara-bos&quot;&gt;About Mara Bos&lt;&#x2F;h3&gt;
&lt;p&gt;Fusion Engineering was co-founded by Mara Bos, a prominent figure in the Rust community and a member of the Rust team. Mara is well-known for her contributions to Rust’s development and for authoring the book &lt;a href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Rust-Atomics-Locks-Low-Level-Concurrency&#x2F;dp&#x2F;1098119444&quot; target=&quot;_blank&quot;&gt;Rust Atomics and Locks&lt;&#x2F;a&gt;, which delves into concurrency in Rust. Her leadership and expertise have been instrumental in driving Fusion Engineering’s innovative use of Rust for drone technology.&lt;&#x2F;p&gt;
&lt;p&gt;To dive deeper into how Fusion Engineering leverages Rust for their innovative drone technology, check out the full episode of &lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s02e06-fusion-engineering&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust in Production Ep 13 featuring Jakub Valtar&lt;&#x2F;a&gt;. Whether you’re an experienced Rustacean or just curious about Rust’s applications in drone technology, this episode is packed with valuable insights and practical advice. Don’t miss it!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;try-out-a-new-rust-editor-lapce-helix-zed-and-rustrover&quot;&gt;Try Out a New Rust Editor: Lapce, Helix, Zed, and RustRover&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;45&#x2F;Editors.webp&quot; alt=&quot;Editors for writing Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;Exploring new editors besides &lt;a href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;&quot; target=&quot;_blank&quot;&gt;VSCode&lt;&#x2F;a&gt;, can enhance your productivity and coding experience. Here are four exciting options to consider:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;rustrover&quot;&gt;RustRover&lt;&#x2F;h3&gt;
&lt;p&gt;RustRover is a Rust-centric IDE offering advanced features like intelligent code completion, refactoring, and real-time error detection. &lt;a href=&quot;https:&#x2F;&#x2F;www.jetbrains.com&#x2F;rustrover&#x2F;&quot; target=&quot;_blank&quot;&gt;Explore RustRover here&lt;&#x2F;a&gt;. Specifically recommended if you are starting out with Rust.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;lapce&quot;&gt;Lapce&lt;&#x2F;h3&gt;
&lt;p&gt;Lapce is a lightning-fast code editor with native GUI, written in Rust for performance and reliability. &lt;a href=&quot;https:&#x2F;&#x2F;lapce.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Check it out here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;helix&quot;&gt;Helix&lt;&#x2F;h3&gt;
&lt;p&gt;Helix is a post-modern modal text editor with a focus on simplicity and powerful editing features inspired by modal editors like Vim. &lt;a href=&quot;https:&#x2F;&#x2F;helix-editor.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Learn more here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;zed&quot;&gt;Zed&lt;&#x2F;h3&gt;
&lt;p&gt;Zed is a collaborative code editor designed to help teams work together in real-time, featuring a sleek and intuitive interface. &lt;a href=&quot;https:&#x2F;&#x2F;zed.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Discover Zed here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Each of these editors offers unique features tailored to different coding needs, so give them a try and see which one best fits your workflow!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@OxidizeConf&quot; target=&quot;_blank&quot;&gt;All talks from Oxidize Conference 2024 on Youtube&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1e0dfj6&#x2F;google_is_rewriting_harfbuzz_and_freetype_in_rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Google is rewriting HarfBuzz and FreeType in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>44 - Navigating the Rust Job Market and more</title>
          <pubDate>Sat, 29 Jun 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/navigating-the-rust-job-market-and-more/</link>
          <guid>https://rust-trends.com/newsletter/navigating-the-rust-job-market-and-more/</guid>
          <description xml:base="https://rust-trends.com/newsletter/navigating-the-rust-job-market-and-more/">&lt;br&gt;
We’re thrilled to bring you another exciting edition of Rust Trends Insider! This week, we’re diving into the world of Rust jobs with insider tips from professionals, exploring the latest developments in the Tauri framework, and sharing insightful resources to enhance your Rust journey.
&lt;p&gt;In this issue, you’ll find:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;How to Land a Job in Rust: Proven strategies and expert advice.&lt;&#x2F;li&gt;
&lt;li&gt;Tauri 2.0.0 Beta: Discover the new features and improvements.&lt;&#x2F;li&gt;
&lt;li&gt;Community Snippets: Engaging articles and podcasts to boost your Rust knowledge.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Happy Coding and stay Safe&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-to-land-a-job-in-rust-insider-tips-from-professionals&quot;&gt;How to Land a Job in Rust: Insider Tips from Professionals&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;44&#x2F;rust-programming.webp&quot; alt=&quot;Rust programming remotely - nomad style&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;I know that finding a job in Rust can be challenging, but it’s certainly not impossible. By leveraging four proven strategies and incorporating insights from industry professionals, you can enhance your chances of securing a position in this exciting field.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-build-a-strong-online-presence&quot;&gt;1 - Build a Strong Online Presence&lt;&#x2F;h3&gt;
&lt;p&gt;Creating and showcasing Rust projects on platforms like GitHub can significantly enhance your job prospects. Real-world examples of your work demonstrate your problem-solving skills and Rust proficiency. Additionally, sharing your expertise through a blog, LinkedIn posts or YouTube channel can help you gain recognition within the Rust community.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pro Tips:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Showcase Your Projects: Highlight your best Rust projects to demonstrate your capabilities.&lt;&#x2F;li&gt;
&lt;li&gt;Create Content: Write articles or create videos about Rust to share your knowledge and build your personal brand.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-network-and-make-connections&quot;&gt;2 - Network and Make Connections&lt;&#x2F;h3&gt;
&lt;p&gt;Networking plays a crucial role in finding job opportunities. Engage with the Rust community by joining forums, attending meetups, and participating in relevant Discord servers. Connections within the industry can lead to job recommendations and opportunities you might not find through traditional job listings.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pro Tips:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Join Rust Communities: Participate in forums and attend Rust meetups to connect with like-minded professionals.&lt;&#x2F;li&gt;
&lt;li&gt;Leverage Professional Networks: Use platforms like LinkedIn to connect with industry professionals and stay updated on job openings.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-advocate-for-rust-at-your-current-job&quot;&gt;3 - Advocate for Rust at Your Current Job&lt;&#x2F;h3&gt;
&lt;p&gt;If you’re already employed, you can introduce Rust to your current workplace. Start by using Rust in a hackathon project to demonstrate its benefits. Follow up with a technical presentation to persuade your team of its advantages. This approach can create internal opportunities to work with Rust without changing jobs.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pro Tips:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Promote Rust’s Benefits: Emphasize performance improvements and better memory safety.&lt;&#x2F;li&gt;
&lt;li&gt;Engage Your Team: Convince senior engineers and stakeholders by showcasing successful Rust projects.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-apply-for-rust-specific-jobs&quot;&gt;4 - Apply for Rust-Specific Jobs&lt;&#x2F;h3&gt;
&lt;p&gt;Directly applying for Rust-specific positions is another effective strategy. Websites like LinkedIn, Stack Overflow, and Hacker News Hiring are great places to find Rust job listings. Many of these positions offer remote work, but be prepared for high competition and senior-level requirements.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pro Tips:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Targeted Applications: Focus on job listings that specifically mention Rust.&lt;&#x2F;li&gt;
&lt;li&gt;Highlight Complementary Skills: Combine Rust expertise with other in-demand skills like Python or C++ to stand out.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;insights-from-the-rust-community&quot;&gt;Insights from the Rust Community&lt;&#x2F;h3&gt;
&lt;p&gt;Here are some additional insights from professionals who have successfully landed Rust jobs:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Initiate Rust Projects: Some professionals started Rust projects at their current jobs, which helped transition their teams to using Rust. The key is to start small, so consider simple developer tools or other software that isn’t that critical to business operations.&lt;&#x2F;li&gt;
&lt;li&gt;Educational Efforts: Successful teams often included structured learning phases, such as weekly meetings to discuss Rust topics and pair programming with experienced Rust developers.&lt;&#x2F;li&gt;
&lt;li&gt;Create Value with Rust: Demonstrating Rust’s efficiency through projects, like data-flow orchestration systems, can convince teams to adopt it widely.&lt;&#x2F;li&gt;
&lt;li&gt;Leverage Open Source: Contributing to or initiating open-source Rust projects can significantly boost your profile and provide valuable experience.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;By focusing on these strategies, you can increase your chances of landing a job in Rust programming. Keep learning, stay connected with the community, and showcase your expertise to make your mark in the Rust ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;Have you landed a job using Rust? Share your experiences with me! I’d love to hear your stories and tips.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-secure-and-efficient-desktop-mobile-applications&quot;&gt;Building Secure and Efficient Desktop&#x2F;Mobile Applications&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;44&#x2F;tauri2_0.webp&quot; alt=&quot;Tauri v2.0&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;Tauri is an innovative framework designed for building secure, customizable, and efficient desktop applications using web technologies. With its lightweight nature and focus on security, Tauri allows developers to create cross-platform applications that are both powerful and performant.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;announcing-tauri-2-0-0-beta-a-new-milestone&quot;&gt;Announcing Tauri 2.0.0 Beta: A New Milestone&lt;&#x2F;h3&gt;
&lt;p&gt;The Tauri team announced the release of &lt;a href=&quot;https:&#x2F;&#x2F;v2.tauri.app&#x2F;&quot; target=&quot;_blank&quot;&gt;Tauri 2.0.0 Beta&lt;&#x2F;a&gt; in February, introducing several enhancements and new features:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Enhanced API: Offers more flexibility and control over application development.&lt;&#x2F;li&gt;
&lt;li&gt;Improved Performance: Ensures faster and more efficient applications.&lt;&#x2F;li&gt;
&lt;li&gt;Security Enhancements: Integrates additional features to protect against potential threats.&lt;&#x2F;li&gt;
&lt;li&gt;Better Documentation: Updated resources to facilitate easier onboarding for developers.&lt;&#x2F;li&gt;
&lt;li&gt;Mobile Support: Now supports mobile development, a game-changer that expands Tauri’s versatility beyond desktop applications.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;As we approach the end of June, the anticipation builds for the upcoming release candidate, followed by the stable version. This progress makes it an exciting time to highlight Tauri in this newsletter. Developers are encouraged to explore the new features and provide feedback to shape the final release.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;v2.tauri.app&#x2F;start&#x2F;&quot; target=&quot;_blank&quot;&gt;Get started with Tauri 2.0.0&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.devgenius.io&#x2F;master-rust-by-playing-video-games-cf5f7d8b1e28&quot; target=&quot;_blank&quot;&gt;Master Rust by Playing Video Games!&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&#x2F;s02e05-oxidos&#x2F;&quot; target=&quot;_blank&quot;&gt;Podcast Rust in automotive: OxidOS&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1dpvm0j&#x2F;120ms_to_30ms_python_to_rust&#x2F;&quot; target=&quot;_blank&quot;&gt;120ms to 30ms: Python 🐍 to Rust 🦀🚀&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;letsencrypt.org&#x2F;2024&#x2F;06&#x2F;24&#x2F;ntpd-rs-deployment.html&quot; target=&quot;_blank&quot;&gt;More Memory Safety for Let’s Encrypt: Deploying ntpd-rs&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>43 - Enhance your Rust Workflow with Miri and others</title>
          <pubDate>Sat, 15 Jun 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/enhance-your-rust-workflow-with-miri-and-others/</link>
          <guid>https://rust-trends.com/newsletter/enhance-your-rust-workflow-with-miri-and-others/</guid>
          <description xml:base="https://rust-trends.com/newsletter/enhance-your-rust-workflow-with-miri-and-others/">&lt;br&gt;
We’re thrilled to present the latest edition of Rust Trends, bringing you the freshest updates and insights from the Rust community.
&lt;p&gt;Next, dive into our feature article on Miri, the Rust interpreter, and see how it can help you find undefined behavior in your code. Last but not least some tips and tricks on how to improve build times.&lt;&#x2F;p&gt;
&lt;p&gt;Thank you for being part of our growing community. Enjoy and Happy coding!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;understanding-miri-a-crucial-tool-for-rust-developers&quot;&gt;Understanding Miri: A Crucial Tool for Rust Developers&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;43&#x2F;miri.webp&quot; alt=&quot;Miri&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;Rust is celebrated for its memory safety guarantees, and one of the key tools that help enforce these guarantees is Miri. In this article, we’ll dive into what Miri is, why it’s an essential tool for Rust developers, and when you should consider using it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-is-miri&quot;&gt;What is Miri?&lt;&#x2F;h3&gt;
&lt;p&gt;Miri is an interpreter for Rust’s Mid-level Intermediate Representation (MIR). MIR is a simplified version of Rust code that the compiler uses for various analyses and optimizations before generating machine code. Miri interprets MIR, allowing it to execute Rust code and check for undefined behavior at runtime. This makes it an invaluable tool for debugging and ensuring code correctness.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-use-miri&quot;&gt;Why Use Miri?&lt;&#x2F;h3&gt;
&lt;p&gt;Detecting Undefined Behavior: Miri can detect many forms of undefined behavior, such as:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use of uninitialized memory.&lt;&#x2F;li&gt;
&lt;li&gt;Out-of-bounds array access.&lt;&#x2F;li&gt;
&lt;li&gt;Violations of pointer aliasing rules.&lt;&#x2F;li&gt;
&lt;li&gt;Misuse of unsafe code blocks.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Undefined behavior can lead to unpredictable and often dangerous consequences in software, including security vulnerabilities and crashes. Miri’s ability to catch these issues early can save countless hours of debugging and increase the reliability of your code.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Debugging Unsafe Code:&lt;&#x2F;strong&gt; Unsafe code in Rust allows developers to perform operations that are not checked by the compiler for safety. While this can be necessary for performance or interfacing with hardware, it also introduces risks. Miri provides a way to execute and test unsafe code paths with additional checks, making it easier to ensure they do not introduce undefined behavior.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Teaching and Learning:&lt;&#x2F;strong&gt; Miri is an excellent educational tool. For those learning Rust, understanding how and why certain operations can lead to undefined behavior helps deepen their comprehension of Rust’s safety guarantees and the importance of following best practices.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;when-to-use-miri&quot;&gt;When to Use Miri?&lt;&#x2F;h3&gt;
&lt;p&gt;During Development: Integrate Miri into your development workflow to catch undefined behavior as early as possible. This is particularly useful when working with complex algorithms or unsafe code blocks. Running Miri on your tests can help identify subtle bugs that might not be caught by regular testing.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Code Reviews and Audits:&lt;&#x2F;strong&gt; When reviewing code, especially those containing unsafe blocks or interfacing with low-level system components, using Miri can provide an additional layer of assurance. It helps reviewers identify potential issues that might not be obvious from code inspection alone.&lt;&#x2F;p&gt;
&lt;p&gt;**Educational Settings: **For educators and students, using Miri to explore how Rust enforces memory safety and handles low-level operations can provide valuable insights. It’s a practical tool for demonstrating the consequences of undefined behavior and the importance of safe coding practices.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Miri is a powerful tool for Rust developers, providing an extra layer of safety and debugging capabilities. By integrating Miri into your workflow, you can catch undefined behavior early, ensure the safety of your unsafe code, and deepen your understanding of Rust’s safety guarantees. Whether you are a seasoned developer or just starting with Rust, Miri is an essential tool that can help you write safer, more reliable code.&lt;&#x2F;p&gt;
&lt;p&gt;For more information and detailed documentation, visit the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;miri&quot; target=&quot;_blank&quot;&gt;official Miri repository&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;References:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;miri&quot; target=&quot;_blank&quot;&gt;Miri GitHub Repository&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-unofficial.github.io&#x2F;too-many-lists&#x2F;fifth-miri.html&quot; target=&quot;_blank&quot;&gt;Learning Rust With Entirely Too Many Linked Lists: Miri&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.ralfj.de&#x2F;blog&#x2F;2022&#x2F;07&#x2F;02&#x2F;miri.html&quot; target=&quot;_blank&quot;&gt;Ralf Jung’s Blog on Miri&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2021&quot; target=&quot;_blank&quot;&gt;Rust&#x27;s playground&lt;&#x2F;a&gt; also supports Miri (see tools menu)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;speeding-up-rust-compile-times&quot;&gt;Speeding Up Rust Compile Times&amp;gt;&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;43&#x2F;speeding-up-build-times.webp&quot; alt=&quot;Speeding up building times&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;Compiling Rust code can sometimes feel slow, but there are numerous strategies to optimize it. Here are key tips derived from recent articles:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use cargo check&lt;&#x2F;strong&gt;: This command checks your code without producing a binary, speeding up the process significantly.&lt;&#x2F;li&gt;
&lt;li&gt;Incremental Compilation: Enable incremental compilation to only recompile changed parts.&lt;&#x2F;li&gt;
&lt;li&gt;Parallel Compilation: Use Rust’s nightly compiler with the &lt;strong&gt;-Z&lt;&#x2F;strong&gt; threads flag to leverage multiple cores.&lt;&#x2F;li&gt;
&lt;li&gt;Optimize Dependencies: Remove unused dependencies and update existing ones regularly.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Use &lt;strong&gt;sccache&lt;&#x2F;strong&gt;: Cache compiled dependencies to avoid recompiling unchanged code.&lt;&#x2F;p&gt;
&lt;p&gt;For more detailed tips, check out the full articles on &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust.careers&#x2F;post&#x2F;compile_rust_faster&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Careers&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;blog&#x2F;tips-for-faster-rust-compile-times&#x2F;?lid=30234&quot; target=&quot;_blank&quot;&gt;Corrode Dev&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;06&#x2F;13&#x2F;Rust-1.79.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.79.0 release&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qfknfCsICUM&amp;ab_channel=RustNationUK&quot; target=&quot;_blank&quot;&gt;Towards Impeccable Rust&lt;&#x2F;a&gt; (Rust Nation UK)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;filtra.io&#x2F;rust-may-24&quot; target=&quot;_blank&quot;&gt;Rust Jobs Report of May&lt;&#x2F;a&gt; (by Filtra)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>42 - Stay Ahead in Rust: Best Channels, Podcasts, and Skill-Building Tools</title>
          <pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/stay-ahead-in-rust-best-channels-podcasts-and-skill-building-tools/</link>
          <guid>https://rust-trends.com/newsletter/stay-ahead-in-rust-best-channels-podcasts-and-skill-building-tools/</guid>
          <description xml:base="https://rust-trends.com/newsletter/stay-ahead-in-rust-best-channels-podcasts-and-skill-building-tools/">&lt;br&gt;
We’re excited to bring you the latest insights and resources from the Rust community! In this edition, we spotlight the top YouTube channels and podcasts for learning Rust, featuring experts like Rustacean Station and Jon Gjengset. Dive into our highlight of the week on image optimization using Rust and explore the invaluable Rust Exercises platform to sharpen your skills. Plus, get inspired by our exciting community news and discover ways to stay ahead in the Rust world. Let’s continue to grow and learn together!
&lt;h2 id=&quot;top-10-youtube-channels-and-podcasts-for-learning-rust&quot;&gt;Top 10 YouTube Channels and Podcasts for Learning Rust&lt;&#x2F;h2&gt;
&lt;p&gt;We all like lists of top resources to learn Rust, here is a top 10 inspired on a recent Reddit Post in &lt;strong&gt;&#x2F;rust&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rustacean-station.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Rustacean Station Podcast&lt;&#x2F;a&gt;: Enjoy interviews and discussions with seasoned Rust developers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;podcast&quot; target=&quot;_blank&quot;&gt;Rust in Production Podcast&lt;&#x2F;a&gt;: Get insights into using Rust in real-world production scenarios.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;letsgetrusty&quot; target=&quot;_blank&quot;&gt;Let’s Get Rusty&lt;&#x2F;a&gt;: Perfect for beginners, offering friendly and accessible Rust tutorials.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@chrisbiscardi&quot; target=&quot;_blank&quot;&gt;Chris Biscardi&lt;&#x2F;a&gt;: Discover Rust and WebAssembly (WASM) focused content.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@NoBoilerplate&quot; target=&quot;_blank&quot;&gt;No Boilerplate&lt;&#x2F;a&gt;: Dive into detailed Rust tutorials and practical coding examples.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@codetothemoon&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Code to the Moon&lt;&#x2F;a&gt;: Focuses on Rust in web development with practical insights.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@JeremyChone&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Jeremy Chone&lt;&#x2F;a&gt;: Learn about full-stack web development with Rust.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;JonGjengset&quot; target=&quot;_blank&quot;&gt;Jon Gjengset’s YouTube Channel&lt;&#x2F;a&gt;: Explore deep dives into Rust, including detailed project implementations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@_noisecode&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Logan Smith&lt;&#x2F;a&gt;: Offers visual and well-explained Rust tutorials.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@masmullin&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Michael Mullin&lt;&#x2F;a&gt;: Covers a variety of Rust topics, perfect for beginners.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Bonus Resources for Our Valuable Readers&lt;&#x2F;p&gt;
&lt;ol start=&quot;11&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@rustnationuk&#x2F;videos&quot; target=&quot;_blank&quot;&gt;Rust Nation UK&lt;&#x2F;a&gt;: Features talks from the Rust Nation UK conference, covering a wide range of Rust topics.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;ieni.dev&#x2F;rustship&quot; target=&quot;_blank&quot;&gt;Marco Ieni’s Rust Ship Podcast&lt;&#x2F;a&gt;: Interviews with Rust open source maintainers, providing unique insights into the community.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;highlight-of-the-week-image-optimization-with-rust&quot;&gt;Highlight of the Week: Image Optimization with Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;42&#x2F;webp-with-rust.webp&quot; alt=&quot;&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;This week, we’re excited to feature a fantastic blog post by &lt;a href=&quot;https:&#x2F;&#x2F;tduyng.dev&#x2F;blog&#x2F;rust-webp-transform&#x2F;&quot; target=&quot;_blank&quot;&gt;tduyng&lt;&#x2F;a&gt;. In his post, he describes how he transformed his website’s images to WebP format using Rust. He utilized the image crate to decode and encode images and improved the performance of his static website, generated with Zola, by significantly reducing image sizes. His Rust-based solution offers a quick and reusable way to convert various image formats to WebP, demonstrating Rust’s efficiency in real-world applications. Check out his detailed guide &lt;a href=&quot;https:&#x2F;&#x2F;tduyng.dev&#x2F;blog&#x2F;rust-webp-transform&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;P.S. Rust Trends is also a happy user of Zola, the static site generator.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-exercises-a-valuable-resource-for-learning-rust&quot;&gt;Rust Exercises: A Valuable Resource for Learning Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;42&#x2F;Exercises.webp&quot; alt=&quot;Rust Exercises&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;If you’re looking to sharpen your Rust programming skills, &lt;a href=&quot;https:&#x2F;&#x2F;rust-exercises.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Exercises&lt;&#x2F;a&gt; is an excellent resource. This website offers a range of exercises designed to help both beginners and experienced programmers improve their understanding of Rust. The exercises cover various topics, from basic syntax and control flow to more advanced concepts like ownership, borrowing, and concurrency.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key Features:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Wide Range of Exercises: From beginner to advanced levels, catering to all skill sets.&lt;&#x2F;li&gt;
&lt;li&gt;Interactive Platform: Allows you to write, test, and debug Rust code directly in your browser.&lt;&#x2F;li&gt;
&lt;li&gt;Comprehensive Topics: Exercises cover fundamental to complex Rust concepts, ensuring a well-rounded learning experience.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For more updates and insights into Rust, stay tuned to our Rust Trends newsletter, where we bring you the latest news, tutorials, and resources from the Rust programming community.&lt;&#x2F;p&gt;
&lt;p&gt;Happy coding!&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>41 - Rust Dispatch: Curl Developments, Conference Insights, and Tech Updates</title>
          <pubDate>Mon, 13 May 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-dispatch-curl-developments-conference-insights-and-tech-updates/</link>
          <guid>https://rust-trends.com/newsletter/rust-dispatch-curl-developments-conference-insights-and-tech-updates/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-dispatch-curl-developments-conference-insights-and-tech-updates/">&lt;br&gt;
Get ready for another exciting issue of Rust Trends! In this 41st edition, we spotlight the innovative integration of Rust into curl with its original developer, Daniel Stenberg. Dive into an exclusive interview and learn how Rust is revolutionizing this essential tool. Plus, catch up on highlights from the RustNL 2024 conference and discover the latest advancements in Rust&#x27;s ecosystem, including the powerful parking_lot crate.
&lt;p&gt;Join us as we explore these transformative developments in Rust programming. Your journey into the depths of modern software development starts here!&lt;&#x2F;p&gt;
&lt;p&gt;P.S. Due to holiday period, this edition of the newsletter was sent out later than planned. We appreciate your understanding and hope you enjoy the insights we&#x27;ve gathered for you!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;evolving-curl-how-rust-is-shaping-its-future-with-daniel-stenberg&quot;&gt;Evolving curl: How Rust Is Shaping Its Future with Daniel Stenberg&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;41&#x2F;network-connections.webp&quot; alt=&quot;Curl network connections&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;Join us on &quot;Rust in Production&quot;, as we sit down with the legendary Daniel Stenberg, the original author and lead developer of curl. Hosted by Matthias Endler from Corrode, this episode dives deep into Daniel&#x27;s pioneering journey of integrating Rust into curl, the internet transfer engine that powers devices and applications globally.&lt;&#x2F;p&gt;
&lt;p&gt;From his early days navigating the realms of open-source in the &#x27;90s to steering one of the most essential tools on the internet, Daniel shares his insights and challenges of melding Rust&#x27;s modern capabilities with curl&#x27;s robust legacy. Discover how this integration is shaping curl&#x27;s future and what it means for the vast ecosystem of developers relying on it.&lt;&#x2F;p&gt;
&lt;p&gt;🔗 Tune in to uncover:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The origins and evolution of curl under Daniel’s leadership.&lt;&#x2F;li&gt;
&lt;li&gt;Practical impacts of Rust on curl’s development and performance.&lt;&#x2F;li&gt;
&lt;li&gt;Daniel’s perspective on Rust’s role in future-proofing foundational software.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Whether you&#x27;re a developer, a tech enthusiast, or someone curious about the intersection of traditional and modern programming paradigms, this episode is packed with enriching content that will give you a new appreciation for the backend processes that run our digital world.&lt;&#x2F;p&gt;
&lt;p&gt;🎧 &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;EKTQgVuoBpU?si=JawU8t63f6P9DxJm&quot; target=&quot;_blank&quot;&gt;Listen now&lt;&#x2F;a&gt; to gain exclusive insights into the synergy between old and new school programming through Daniel’s expert lens!&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;daniel.haxx.se&#x2F;blog&#x2F;&quot; target=&quot;_blank&quot;&gt;Daniel&#x27;s blog&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;fosdem.org&#x2F;2024&#x2F;schedule&#x2F;event&#x2F;fosdem-2024-1931-you-too-could-have-made-curl-&#x2F;&quot; target=&quot;_blank&quot;&gt;Talk of Daniel at Fosdem&#x27;24&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;about&#x2F;&quot; target=&quot;_blank&quot;&gt;Podcast host Matthias Endler&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;rustnl-2024-conference&quot;&gt;RustNL 2024 conference&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;41&#x2F;conference.webp&quot; alt=&quot;RustNL 2024 Conference&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;The RustNL2024 conference took place on the 7th and 8th of May, successfully gathering Rust enthusiasts and experts from around the world, including notable figures like Mara Bos and Niko Matsakis and a sold out workshop from Luca Palmieri. The event featured a series of engaging and insightful talks, each shedding light on various aspects of Rust programming and its applications.&lt;&#x2F;p&gt;
&lt;p&gt;For those who couldn&#x27;t attend in person or wish to revisit the highlights, recordings of all the sessions are conveniently available on YouTube. Explore the innovative discussions and learnings of &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;XLefuzE-ABU?si=rjnHuJfWt5hsqVRw&quot; target=&quot;_blank&quot;&gt;Day 1&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;521NfGf7AR0?si=D88WSPSLZgAtJyvD&quot; target=&quot;_blank&quot;&gt;Day 2&lt;&#x2F;a&gt; by checking out the recorded livestream for each day. Look at the &lt;a href=&quot;https:&#x2F;&#x2F;2024.rustnl.org&#x2F;schedule&#x2F;&quot; target=&quot;_blank&quot;&gt;schedule&lt;&#x2F;a&gt; for the given talks.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;enhancing-concurrency-in-rust-with-the-parking-lot-crate&quot;&gt;Enhancing Concurrency in Rust with the parking_lot Crate&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;41&#x2F;Lock.webp&quot; alt=&quot;Lock&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Amanieu&#x2F;parking_lot&quot; target=&quot;_blank&quot;&gt;parking_lot&lt;&#x2F;a&gt; crate in Rust offers a refined and optimized alternative to the standard library&#x27;s synchronization primitives, such as mutexes and condition variables. It provides more compact and faster implementations of locks, which often result in better performance for applications.&lt;&#x2F;p&gt;
&lt;p&gt;One of the main reasons to consider using parking_lot is its efficient handling of thread locking and unlocking, which can lead to reduced contention and overhead in multithreaded scenarios. Unlike the standard Rust mutexes that rely on OS primitives, parking_lot mutexes are based on a spinning model followed by an OS-assisted sleep model when contention is detected. This approach typically uses less memory and offers faster lock acquisition and release in both contested and uncontested scenarios.&lt;&#x2F;p&gt;
&lt;p&gt;Integration can be as simple as find and replace in your code, because in most cases parking_lot uses the same interfaces as the standard library&#x27;s synchronization primitives.&lt;&#x2F;p&gt;
&lt;p&gt;In summary, if your Rust application requires efficient concurrency management and you encounter limitations with the standard library&#x27;s primitives, parking_lot might offer the performance improvements and additional features you need.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;news&#x2F;1m-microsoft-donation-to-fund-key-rust-foundation-project-priorities&#x2F;&quot; target=&quot;_blank&quot;&gt;$1M Microsoft Donation to Fund Rust Foundation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;gaultier.github.io&#x2F;blog&#x2F;how_to_rewrite_a_cpp_codebase_successfully.html&quot; target=&quot;_blank&quot;&gt;How to rewrite a C++ codebase successfully&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;05&#x2F;02&#x2F;Rust-1.78.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.78 Release&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>40 - Rust Roundup: Community Insights and Innovative Projects</title>
          <pubDate>Sat, 27 Apr 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-roundup-community-insights-and-innovative-projects/</link>
          <guid>https://rust-trends.com/newsletter/rust-roundup-community-insights-and-innovative-projects/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-roundup-community-insights-and-innovative-projects/">&lt;br&gt;
Welcome to the latest edition of Rust Trends, Edition #40! In this issue, we dive into diverse topics from exploring the nuances of Rust&#x27;s match operator to adventurous projects like building a drone and significant developments like Thunderbird&#x27;s new Exchange support.
&lt;p&gt;Join us as we traverse these technical terrains, offering insights, challenges, and community-driven enhancements that showcase the versatility and power of Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Engage with our articles to elevate your programming skills and connect with the Rust community&#x27;s innovative spirit.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;explore-the-power-of-rust-s-match-operator-with-community-insights&quot;&gt;Explore the Power of Rust&#x27;s Match Operator with Community Insights&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;40&#x2F;match-operator.webp&quot; alt=&quot;Unpacking Rust&#x27;s Match Operator with Community Insights&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
In our latest blog post, &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;unpacking-rust-s-match-operator-with-community-insights&quot;&gt;Unpacking Rust&#x27;s Match Operator with Community Insights&lt;&#x2F;a&gt; we delve into the practical applications and community-driven enhancements of Rust&#x27;s versatile match operator. Inspired by real-world code discussions on platforms like LinkedIn, this article breaks down a simple Rust code snippet and incorporates valuable feedback from the Rust community. Whether you&#x27;re looking to refine your understanding of control flow in Rust or searching for tips to write cleaner code, this post is packed with expert advice and coding improvements.
&lt;p&gt;Dive into the article here and join the conversation to elevate your Rust programming skills!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-a-drone-with-rust-a-public-embedded-project-journey&quot;&gt;Building a Drone with Rust: A Public Embedded Project Journey&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;40&#x2F;drone.webp&quot; alt=&quot;Embedded project: Drone&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
In a recent call to our community for embedded programming ideas using Rust, your enthusiasm and innovative suggestions stood out. After much deliberation, I&#x27;m excited to announce the project we&#x27;ll be tackling together: **building a drone**. More precisely a Flight Controller. This journey won&#x27;t just be a personal challenge—I plan to build this project in public, sharing each step of the process to enhance our community&#x27;s learning and engagement.
&lt;h3 id=&quot;choosing-the-right-framework&quot;&gt;Choosing the Right Framework&lt;&#x2F;h3&gt;
&lt;p&gt;The first step in this adventure was to decide on the programming environment: RTOS, bare metal, or async programming. While &lt;a href=&quot;https:&#x2F;&#x2F;tockos.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Tock OS&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;rtic.rs&#x2F;2&#x2F;book&#x2F;en&#x2F;preface.html&quot; target=&quot;_blank&quot;&gt;RTic&lt;&#x2F;a&gt;, and &lt;a href=&quot;(https:&#x2F;&#x2F;hubris.oxide.computer&#x2F;&quot; target=&quot;_blank&quot;&gt;Hubris with its accompanying debugger Humility&lt;&#x2F;a&gt;) from &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;newsletter&#x2F;rust-beyond-software-a-hardware-company-s-journey-with-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Oxide Computer&lt;&#x2F;a&gt; were strong contenders, each offering unique strengths, I decided to embark on a path less traveled within our context.&lt;&#x2F;p&gt;
&lt;p&gt;Given my background with the RTOS &lt;a href=&quot;https:&#x2F;&#x2F;zephyrproject.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Zephyr&lt;&#x2F;a&gt;, which is primarily written in C, the allure of exploring new territories was irresistible. &lt;strong&gt;I&#x27;ve chosen to work with&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;embassy.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;Embassy&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;, a framework that supports &lt;a href=&quot;https:&#x2F;&#x2F;rust-lang.github.io&#x2F;async-book&#x2F;&quot; target=&quot;_blank&quot;&gt;async programming&lt;&#x2F;a&gt;. This choice is particularly exciting as it &lt;strong&gt;bridges the gap&lt;&#x2F;strong&gt; for those transitioning from high level Web development or Systems Programming to Embedded Development in Rust. The async model in &lt;strong&gt;Embassy&lt;&#x2F;strong&gt; will help us manage multiple tasks efficiently, which is crucial for controlling a drone&#x27;s various functions concurrently.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-not-bare-metal&quot;&gt;Why Not Bare Metal?&lt;&#x2F;h3&gt;
&lt;p&gt;While bare metal programming offers direct hardware control and efficiency, it lacks the built-in concept of task prioritization and asynchronous operations—features that are critical for a drone&#x27;s operational requirements. The complexity of managing a drone&#x27;s multiple sensors, motors, and safety checks makes bare metal a less suitable option for this project.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-s-next&quot;&gt;What’s Next?&lt;&#x2F;h3&gt;
&lt;p&gt;I am thrilled to start coding, compiling, and flashing the drone. Stay tuned for regular updates, insights, and tutorials in the coming editions of Rust Trends. Together, we&#x27;ll navigate the challenges and celebrate the milestones of this exciting project.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s soar to new heights with Rust!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;adventures-in-rust-bringing-exchange-support-to-thunderbird&quot;&gt;Adventures In Rust: Bringing Exchange Support To Thunderbird&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;40&#x2F;Tb-rust1.webp&quot; alt=&quot;Thunderbird Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 80%; border:0&quot;&gt;
In the latest post on the Thunderbird blog, the team discusses their adventures in implementing Exchange support using Rust, a journey that marks a significant milestone for Thunderbird. For over two decades, Thunderbird had not introduced support for a new mail protocol, making this development particularly notable. The choice of Rust was driven by several advantages such as memory safety, performance, modularity, and its vibrant ecosystem. Notably, Thunderbird benefits from its integration with Firefox&#x27;s codebase and infrastructure, which already supports Rust, easing some aspects of development despite the challenges posed by legacy code and architectural hurdles.
&lt;p&gt;This endeavor is part of Thunderbird&#x27;s broader effort to modernize its architecture, addressing technical debts and enhancing maintainability for future expansions. The implementation focuses on interfacing with Microsoft&#x27;s Exchange Web Services (EWS), utilizing Rust&#x27;s capabilities to manage complex features and ensure robust security practices. Despite initial challenges with the build system and integrating Rust code, the team has successfully navigated these issues, setting a foundation for further development and integration of Rust within Thunderbird&#x27;s architecture.&lt;&#x2F;p&gt;
&lt;p&gt;For more details on this transformative journey and the technical insights behind it, you can read the full blog post &lt;a href=&quot;https:&#x2F;&#x2F;blog.thunderbird.net&#x2F;2024&#x2F;04&#x2F;adventures-in-rust-bringing-exchange-support-to-thunderbird&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Unpacking Rust&#x27;s match Operator with Community Insights</title>
          <pubDate>Fri, 26 Apr 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/unpacking-rust-s-match-operator-with-community-insights/</link>
          <guid>https://rust-trends.com/posts/unpacking-rust-s-match-operator-with-community-insights/</guid>
          <description xml:base="https://rust-trends.com/posts/unpacking-rust-s-match-operator-with-community-insights/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;In the dynamic world of software development, sharing and &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;feed&#x2F;update&#x2F;urn:li:activity:7188597915068608512?utm_source=share&amp;utm_medium=member_desktop&quot; target=&quot;_blank&quot;&gt;discussing code snippets on platforms like LinkedIn&lt;&#x2F;a&gt; can provide immense value, both through receiving insightful feedback and fostering community engagement. This post is inspired by an (overly) simplified Rust example using the match operator — a powerful tool in Rust&#x27;s arsenal. Below, I&#x27;ll break down the code snippet I posted, explore the constructive feedback received, and discuss general tips for writing better Rust code shared by our community.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-original-code-snippet&quot;&gt;The Original Code Snippet&lt;&#x2F;h2&gt;
&lt;p&gt;Here&#x27;s a brief code snippet to illustrate the usage of the match operator in Rust:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;enum &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    Red,
&lt;&#x2F;span&gt;&lt;span&gt;    Yellow,
&lt;&#x2F;span&gt;&lt;span&gt;    Green,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;light&lt;&#x2F;span&gt;&lt;span&gt;: TrafficLight) -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;&amp;#39;static str &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt; light {
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Red =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Stop&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Yellow =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Caution&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Green =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Go&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let mut&lt;&#x2F;span&gt;&lt;span&gt; light = TrafficLight::Green;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(light));
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    light = TrafficLight::Yellow;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(light));
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    light = TrafficLight::Red;
&lt;&#x2F;span&gt;&lt;span&gt;    println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(light));
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Playground &lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2021&amp;gist=44e42a468bc89c711643299885e88533&quot; target=&quot;_blank&quot;&gt;link&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Use of match for Control Flow:&lt;&#x2F;strong&gt; The match operator is akin to a switch statement but more powerful. It allows a value to be compared against a series of patterns and execute code based on which pattern matches. This is particularly useful for enums in Rust, as demonstrated in our TrafficLight example.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;elevate-your-rust-skills-with-codecrafters-rocket-advertisement&quot;&gt;Elevate Your Rust Skills with CodeCrafters! 🚀 [advertisement]&lt;&#x2F;h2&gt;
&lt;p&gt;Join us in partnership with CodeCrafters to build your own HTTP server for FREE! Sign up easily with GitHub—no payment info required.&lt;&#x2F;p&gt;
&lt;p&gt;📅 Hurry, as April&#x27;s special offer is ending soon! WIN one of two yearly subscriptions worth $990 each. Plus, subscribers receive a 40% discount on all paid plans.&lt;&#x2F;p&gt;
&lt;p&gt;Don&#x27;t miss out—enhance your skills and win big. &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;Sign up now&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;P.S. it helps us to keep the lights on and continue to provide valuable content and for you it is FREE. Thank you for your support! 🙏&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s continue with the article!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;community-insights&quot;&gt;Community Insights&lt;&#x2F;h2&gt;
&lt;p&gt;The LinkedIn post generated a lot of engagement, with several community members sharing their thoughts and suggestions. Here are some key insights:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;eliminate-mutable-declaration&quot;&gt;Eliminate &lt;code&gt;Mutable&lt;&#x2F;code&gt; Declaration&lt;&#x2F;h3&gt;
&lt;p&gt;One community member suggested eliminating the need for a mutable declaration for &lt;code&gt;light&lt;&#x2F;code&gt; by only assigning it once. This can be achieved by using a loop to iterate over the values of the enumeration and printing directly within the iteration without reassigning &lt;code&gt;light&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;My interpretation of this suggestion is as follows:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;enum &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    Red,
&lt;&#x2F;span&gt;&lt;span&gt;    Yellow,
&lt;&#x2F;span&gt;&lt;span&gt;    Green,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Update the function signature to take a reference
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;light&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;TrafficLight) -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;&amp;#39;static str &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span&gt;*light {  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Dereference here to match against the enum variants
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Red =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Stop&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Yellow =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Caution&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        TrafficLight::Green =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Go&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; light in &amp;amp;[TrafficLight::Green, TrafficLight::Yellow, TrafficLight::Red] {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Pass a reference to `action`, no need to dereference here
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(light));
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Playground &lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2021&amp;gist=ec71038ae74ab6610cbb48d1cb92810e&quot; target=&quot;_blank&quot;&gt;link&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Explanation of Key Parts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Function Signature:&lt;&#x2F;strong&gt; The &lt;code&gt;action&lt;&#x2F;code&gt; function now accepts a reference to a &lt;code&gt;TrafficLight&lt;&#x2F;code&gt; (&amp;amp;TrafficLight) instead of owning it. This is a more flexible approach, especially when you don&#x27;t need to take ownership of the value.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Matching Inside action:&lt;&#x2F;strong&gt; Inside the &lt;code&gt;action&lt;&#x2F;code&gt; function, the match statement now needs to dereference the light argument to access the enum values (*light).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;implement-display-trait&quot;&gt;Implement &lt;code&gt;Display&lt;&#x2F;code&gt; Trait&lt;&#x2F;h3&gt;
&lt;p&gt;Another community member suggested implementing the Display trait for the &lt;code&gt;TrafficLight&lt;&#x2F;code&gt; enum to allow for more readable output.&lt;&#x2F;p&gt;
&lt;p&gt;This can be achieved by adding the following code:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Trait to allow custom formatting of the enum variants.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::fmt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;enum &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    Red,
&lt;&#x2F;span&gt;&lt;span&gt;    Yellow,
&lt;&#x2F;span&gt;&lt;span&gt;    Green,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Implement the Display trait for TrafficLight.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;fmt::Display &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;fmt&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span&gt;: &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;mut &lt;&#x2F;span&gt;&lt;span&gt;fmt::Formatter&amp;lt;&amp;#39;_&amp;gt;) -&amp;gt; fmt::Result {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; text = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Red =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Stop&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Yellow =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Caution&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Green =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Go&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        };
&lt;&#x2F;span&gt;&lt;span&gt;        write!(f, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, text)
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; light in &amp;amp;[TrafficLight::Green, TrafficLight::Yellow, TrafficLight::Red] {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Automatically uses the Display trait for printing.
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, light);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Playground &lt;a href=&quot;https:&#x2F;&#x2F;play.rust-lang.org&#x2F;?version=stable&amp;mode=debug&amp;edition=2021&amp;gist=9df958812ad767f59466c88ba0462014&quot; target=&quot;_blank&quot;&gt;link&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Documentation &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;fmt&#x2F;trait.Display.html&quot; target=&quot;_blank&quot;&gt;std::fmt&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Explanation of Key Parts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use Statement:&lt;&#x2F;strong&gt; The use std::fmt; is necessary to bring the fmt module into scope, which contains the &lt;code&gt;Display&lt;&#x2F;code&gt; trait and &lt;code&gt;Formatter&lt;&#x2F;code&gt; struct needed for implementing custom display behavior.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Implementing Display:&lt;&#x2F;strong&gt; The &lt;code&gt;impl fmt::Display&lt;&#x2F;code&gt; for &lt;code&gt;TrafficLight&lt;&#x2F;code&gt; block defines how to convert each variant of the &lt;code&gt;TrafficLight&lt;&#x2F;code&gt; enum to a String. The method fmt takes a mutable reference to a &lt;code&gt;Formatter&lt;&#x2F;code&gt; object and returns a &lt;code&gt;Result&lt;&#x2F;code&gt; that indicates whether the operation was successful or not.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Match Statement:&lt;&#x2F;strong&gt; Inside the fmt method, a match expression determines what string corresponds to each enum variant.
&lt;code&gt;write!&lt;&#x2F;code&gt; Macro: This macro is used to write the formatted string into the provided buffer (f), which is part of the functionality provided by the &lt;code&gt;Formatter&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;use-the-crates-strum-and-strum-macros&quot;&gt;Use the crates &lt;code&gt;strum&lt;&#x2F;code&gt; and &lt;code&gt;strum_macros&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Yes, you probably thought it already — if you are doing something like this in Rust, there&#x27;s a crate for that! Turns out strum is here, and a helpful community member pointed out that it can be used to simplify the code. &lt;code&gt;strum&lt;&#x2F;code&gt; and its companion &lt;code&gt;strum_macros&lt;&#x2F;code&gt; bring additional functionalities that make working with enums much more flexible and expressive.&lt;&#x2F;p&gt;
&lt;p&gt;Here is how you can use it, my interpretation of the suggestion:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Trait to allow iteration over the enum variants.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;strum::IntoEnumIterator;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Macros to derive display and iterator functionalities.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;strum_macros::{Display, EnumIter};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(EnumIter, Display)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;enum &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;strum&lt;&#x2F;span&gt;&lt;span&gt;(serialize = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Stop&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;    Red,
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;strum&lt;&#x2F;span&gt;&lt;span&gt;(serialize = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Caution&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;    Yellow,
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;strum&lt;&#x2F;span&gt;&lt;span&gt;(serialize = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Go&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;    Green,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Use the iter() function provided by EnumIter.
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; light in TrafficLight::iter() {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Automatically uses the Display trait for printing.
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, light);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Documentation &lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;strum&#x2F;latest&#x2F;strum&#x2F;&quot; target=&quot;_blank&quot;&gt;strum&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This code snippet leverages &lt;code&gt;strum&lt;&#x2F;code&gt; to automatically implement the &lt;code&gt;Display&lt;&#x2F;code&gt; trait for the &lt;code&gt;TrafficLight&lt;&#x2F;code&gt; enum, customizing the output string for each variant using the &lt;code&gt;serialize&lt;&#x2F;code&gt; attribute. Moreover, &lt;code&gt;EnumIter&lt;&#x2F;code&gt; is used to create an iterator over the enum, which simplifies looping through its values. This combination not only reduces boilerplate but also enhances the readability and maintainability of your code. Thanks to &lt;code&gt;strum&lt;&#x2F;code&gt;, managing enums in Rust becomes a breeze, focusing more on what you want your code to do rather than how to set up basic functionalities.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;encapsulate-behavior-within-the-enum&quot;&gt;Encapsulate Behavior within the Enum&lt;&#x2F;h3&gt;
&lt;p&gt;A suggestion from another community member highlighted a more integrated approach: they prefer to encapsulate the behavior directly within the enum. Additionally, they recommended making the &lt;code&gt;action&lt;&#x2F;code&gt; function constant (const).&lt;&#x2F;p&gt;
&lt;p&gt;Here’s an implementation based on that suggestion:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;strum::IntoEnumIterator;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;strum_macros::EnumIter;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;derive&lt;&#x2F;span&gt;&lt;span&gt;(EnumIter)]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;enum &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    Red,
&lt;&#x2F;span&gt;&lt;span&gt;    Yellow,
&lt;&#x2F;span&gt;&lt;span&gt;    Green,
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Implementing a constant function action for the TrafficLight enum.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;impl &lt;&#x2F;span&gt;&lt;span&gt;TrafficLight {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;const fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;) -&amp;gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;&amp;#39;static str &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;match &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;self &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Red =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Stop&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Yellow =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Caution&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;            TrafficLight::Green =&amp;gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Go&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;        }
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; light in TrafficLight::iter() {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Use the constant function action directly on the enum variant.
&lt;&#x2F;span&gt;&lt;span&gt;        println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The light says: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, light.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;action&lt;&#x2F;span&gt;&lt;span&gt;());
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note in this example I am still using &lt;code&gt;strum&lt;&#x2F;code&gt; to iterate over the enum variants, because it makes the code more concise and readable.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;how-to-generate-such-great-code-snippets&quot;&gt;How to generate such great code snippets?&lt;&#x2F;h3&gt;
&lt;img src=&quot;..&#x2F;..&#x2F;newsletter&#x2F;40&#x2F;match-operator.webp&quot; alt=&quot;Code snippet match-operator&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;One community member asked how to generate such great code snippets images I use ray.so for generating code snippets. It&#x27;s a fantastic tool for creating beautiful code images for sharing on social media platforms like LinkedIn, Twitter, etc. You can check it out &lt;a href=&quot;https:&#x2F;&#x2F;ray.so&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Sharing code snippets and engaging with the community can lead to valuable insights and improvements in your coding practices. By exploring the feedback and suggestions provided by the community, you can enhance your understanding of Rust and learn new ways to write more efficient and readable code. Remember, the Rust community is always ready to help and share knowledge, so don&#x27;t hesitate to participate and contribute to the vibrant ecosystem of Rust developers.&lt;&#x2F;p&gt;
&lt;p&gt;While the match operator was the main focus, the ensuing discussions and improvements turned out to be even more intriguing and significant.&lt;&#x2F;p&gt;
&lt;p&gt;Happy coding! 🦀&lt;&#x2F;p&gt;
&lt;p&gt;P.s. if you have any questions or suggestions, feel free to drop me a message. Let&#x27;s keep the conversation going! Do not forget to sign up for my newsletter 🚀&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>39 - From Silicon to Software: Rust&#x27;s Role in Embedded (Automotive) Systems</title>
          <pubDate>Sat, 13 Apr 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/from-silicon-to-software-rust-s-role-in-embedded-automotive-systems/</link>
          <guid>https://rust-trends.com/newsletter/from-silicon-to-software-rust-s-role-in-embedded-automotive-systems/</guid>
          <description xml:base="https://rust-trends.com/newsletter/from-silicon-to-software-rust-s-role-in-embedded-automotive-systems/">&lt;br&gt;
Explore the dynamic world of Rust programming with Rust Trends. Each issue offers a glimpse into how industries like automotive are leveraging Rust for better technology, with features on Tesla&#x27;s software projects, embedded systems insights, and exciting coding challenges. Perfect for developers eager to keep pace with Rust&#x27;s growing impact in tech.
&lt;h2 id=&quot;tesla-embraces-rust-for-enhanced-vehicle-firmware-development&quot;&gt;Tesla Embraces Rust for Enhanced Vehicle Firmware Development&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;39&#x2F;tesla-rust.webp&quot; alt=&quot;Tesla Hiring for Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;In a significant nod to the Rust programming language&#x27;s capabilities, Tesla has incorporated Rust into its development stack for chassis controls. The role of a Full Stack Rust Software Engineer at Tesla, posted on 9th of April 2024, involves architecting and developing service backends using asynchronous Rust with Tokio, along with frontend applications utilizing frameworks like React and VueJS.&lt;&#x2F;p&gt;
&lt;p&gt;This strategic move underlines Rust&#x27;s importance in creating robust, efficient software crucial for Tesla&#x27;s vehicle firmware functionality validation, supporting both current and future vehicle projects. This adoption marks a noteworthy trend as major tech-oriented automotive companies leverage Rust&#x27;s safety and performance benefits.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;weekend-code-warrior-take-the-http-server-challenge&quot;&gt;Weekend Code Warrior: Take the HTTP Server Challenge&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;39&#x2F;coding-challenge.webp&quot; alt=&quot;Coding Challenge&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Ready to take your Rust skills up a notch? In partnership with CodeCrafters, we’ve cooked up something special just for you. This isn&#x27;t just any course — it&#x27;s a hands-on challenge where you can build your very own HTTP server, and yes, it’s absolutely free to try!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;easy-sign-up&quot;&gt;Easy Sign-Up&lt;&#x2F;h3&gt;
&lt;p&gt;Getting started couldn’t be simpler. You can &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;sign up&lt;&#x2F;a&gt; using your GitHub account — no credit card or payment details needed. Just a few clicks and you’re in!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-s-the-deal&quot;&gt;What’s the Deal?&lt;&#x2F;h3&gt;
&lt;p&gt;All you need is to be a subscriber here (which you are — high five!) and &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;click on my referral link&lt;&#x2F;a&gt; to jump over to CodeCrafters. There’s no charge at all, and here’s the kicker: you might just snag one of two free yearly subscriptions worth a whopping $990 each!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;fun-and-learning-combined&quot;&gt;Fun and Learning Combined&lt;&#x2F;h3&gt;
&lt;p&gt;I’ve gone through the challenge myself over a weekend, and it was a blast. It starts with simple, clear steps that’ll have you feeling like a pro in no time — Yep, that’s the psychological boost in action! You’ll use everyday tools like Git and your favorite code editor, so everything feels familiar yet excitingly new.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-dig-deeper&quot;&gt;Why Dig Deeper?&lt;&#x2F;h3&gt;
&lt;p&gt;It’s smart to dive deeper into what you’re learning. In this case, you’re not just coding—you’re really getting to grips with Rust and how to build an HTTP web server. It&#x27;s the perfect side project with practical benefits.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cool-features-to-check-out&quot;&gt;Cool Features to Check Out&lt;&#x2F;h3&gt;
&lt;p&gt;CodeCrafters isn’t just about coding in isolation; you get to see code examples from others and check out comments from fellow coders who’ve tackled the same exercises. It’s like having a coding buddy group at your fingertips!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;thinking-of-subscribing&quot;&gt;Thinking of Subscribing?&lt;&#x2F;h3&gt;
&lt;p&gt;If you love it and want more, signing up for a paid subscription gets you a neat 40% discount. Not only does this save you some cash, but it also helps support Rust Trends. And hey, if you’re considering this, you might want to chat with your employer about covering the costs as part of your professional development.&lt;&#x2F;p&gt;
&lt;p&gt;So, why not give it a shot? Boost your skills, have fun, and maybe even win big — all with a few clicks.&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to share this offer with friends and colleagues.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Let’s get coding!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;embarking-on-an-embedded-journey-with-rust&quot;&gt;Embarking on an Embedded Journey with Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;39&#x2F;debugger.webp&quot; alt=&quot;Embedded Rusty Probe&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;As I venture deeper into the world of embedded programming, I sought your input on exciting project ideas. The response was fantastic, and I&#x27;ve settled on a thrilling project to tackle — more on that in our next edition. But first, let’s talk about an intriguing discovery I made while gathering your suggestions: the &lt;a href=&quot;https:&#x2F;&#x2F;probe.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Probe-rs project&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;introducing-probe-rs-a-rust-based-tool-for-embedded-development&quot;&gt;Introducing Probe-rs: A Rust-Based Tool for Embedded Development&lt;&#x2F;h3&gt;
&lt;p&gt;In the ever-evolving landscape of software development, Rust is gaining momentum, and the embedded sector is no exception. Among the gems I discovered is Probe-rs, a powerful tool designed for embedded development, entirely written in Rust. This versatile toolkit serves as a debugger and a programmer, providing robust features for connecting with microcontrollers.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-makes-probe-rs-stand-out&quot;&gt;What Makes Probe-rs Stand Out?&lt;&#x2F;h3&gt;
&lt;p&gt;Probe-rs isn’t just another tool; it exemplifies Rust’s capability to enhance system reliability and performance. It supports a range of hardware probes, including the innovative Rusty Probe, which is based on a Raspberry Pi Pico microcontroller. Additionally, it&#x27;s compatible with established tools like the Segger JLink, offering flexibility for various development needs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-rusty-probe-a-closer-look&quot;&gt;The Rusty Probe: A Closer Look&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;shop.probe.rs&#x2F;products&#x2F;rusty-probe&quot; target=&quot;_blank&quot;&gt;Rusty Probe&lt;&#x2F;a&gt; represents a significant advancement in the field, leveraging the safety and efficiency of Rust. Yes the firmware of this probe is also written in Rust. Therefore this hardware probe exemplifies how Rust can be utilized to create dependable and high-performing embedded tools that are both innovative and accessible. Note that all the hardware and firmware files of this probe are freely available.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-rust-and-probe-rs-are-game-changers-in-embedded-systems&quot;&gt;Why Rust and Probe-rs Are Game Changers in Embedded Systems&lt;&#x2F;h3&gt;
&lt;p&gt;Using Rust for embedded systems offers numerous advantages, including enhanced safety, fewer bugs, and better control over low-level system details. Rust stands out as the first higher-level language that bridges the gap between various programming disciplines — from web development, desktop applications to systems programming — allowing a broader range of developers to enter the world of embedded systems. Probe-rs harnesses these strengths, providing developers with a powerful, reliable, and easy-to-use toolset that stands out in a crowded market.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;disclaimer-and-personal-note&quot;&gt;Disclaimer and Personal Note&lt;&#x2F;h3&gt;
&lt;p&gt;I want to be transparent with you all — I recently purchased the Rusty Probe myself. They have a delivery time of 6 - weeks from now, so I haven&#x27;t had the chance to test it out yet. I also want to clarify that I am not receiving any compensation for mentioning Probe-rs or the Rusty Probe. I&#x27;m just genuinely excited about the possibilities it offers and wanted to share this tool with you. I&#x27;ll definitely keep you updated on my findings once I get my hands on it and start experimenting.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=o2ob8zkeq2s&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;Decrusting the tokio crate with Jon Gjengset&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Building a stock market engine in Rust &lt;a href=&quot;https:&#x2F;&#x2F;medium.com&#x2F;@harshiljani2002&#x2F;building-stock-market-engine-from-scratch-in-rust-i-9be7c110e137&quot; target=&quot;_blank&quot;&gt;part 1&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;medium.com&#x2F;@harshiljani2002&#x2F;building-stock-market-engine-from-scratch-in-rust-ii-0c7b5d8a60b6&quot; target=&quot;_blank&quot;&gt;part 2&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>38 - Rust Beyond Software: A Hardware Company&#x27;s Journey with Rust</title>
          <pubDate>Sat, 30 Mar 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-beyond-software-a-hardware-company-s-journey-with-rust/</link>
          <guid>https://rust-trends.com/newsletter/rust-beyond-software-a-hardware-company-s-journey-with-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-beyond-software-a-hardware-company-s-journey-with-rust/">&lt;br&gt;
Welcome to a special edition of Rust Trends! This time, we&#x27;re taking a unique turn by spotlighting a comprehensive case study of Oxide Computer Company. What sets this edition apart is our focus on a hardware company that has fully embraced Rust, offering valuable insights into its application in both software and hardware realms.
&lt;h2 id=&quot;case-study-oxide-computer-company-s-innovative-use-of-rust&quot;&gt;Case Study: Oxide Computer Company&#x27;s Innovative Use of Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;38&#x2F;PCB-Oxide.webp&quot; alt=&quot;Oxide PCB&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h3 id=&quot;introduction-to-oxide-computer-company&quot;&gt;Introduction to Oxide Computer Company&lt;&#x2F;h3&gt;
&lt;p&gt;Oxide Computer Company, renowned for its pioneering approach in cloud computing, aims to revolutionize the centralized model of cloud services. Their product, a commercial cloud computer, is designed to bring hyperscale cloud computing benefits to individual companies on-premises, marking a shift in the cloud computing landscape with their own hardware and software solutions powered by Rust.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;innovative-rack-scale-system-development&quot;&gt;Innovative Rack-Scale System Development&lt;&#x2F;h3&gt;
&lt;p&gt;A standout aspect of Oxide Computer Company&#x27;s approach is their comprehensive development of a rack-scale system from &lt;strong&gt;scratch&lt;&#x2F;strong&gt;. This endeavor demonstrates their deep commitment to redefining cloud computing infrastructure &lt;strong&gt;with the support of Rust&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Vertical Integration:&lt;&#x2F;strong&gt; Oxide&#x27;s development of a rack-scale system epitomizes vertical integration. Unlike many cloud computing providers who assemble pre-made components, Oxide designs and builds each aspect of their hardware and &lt;strong&gt;software&lt;&#x2F;strong&gt;. This approach allows for unparalleled optimization and customization to meet specific performance and security needs.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Rack-Scale System Design:&lt;&#x2F;strong&gt; The Oxide rack-scale system is a unification of hardware and software, tailor-made for delivering cloud computing in on-premises data centers. This design offers businesses the benefits of cloud performance with the control and security of on-premises infrastructure. By engineering both the hardware and the Rust software components, Oxide ensures seamless integration and maximized efficiency.&lt;&#x2F;p&gt;
&lt;p&gt;This development aligns with the emerging trend of companies rethinking their cloud strategies, increasingly bringing cloud infrastructure in-house (on-premise). This shift represents a move away from complete reliance on traditional cloud providers such as AWS, Azure, and Google Cloud, as businesses seek greater control, security, and (cost) efficiency in their cloud operations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;features-of-the-system&quot;&gt;Features of the System:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;High-Performance Computing:&lt;&#x2F;strong&gt; Oxide&#x27;s system is purpose-built for high-performance computing, networking, and storage. Where Rust fits in seamlessly, ensuring the system&#x27;s reliability and performance.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Energy Efficiency:&lt;&#x2F;strong&gt; A key feature is the system&#x27;s energy efficiency, significantly surpassing traditional servers in this regard. Rust&#x27;s performance optimizations contribute to the system&#x27;s energy-efficient design.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Building a rack-scale system from the ground up exemplifies Oxide&#x27;s innovative spirit and engineering aptitude. Their product not only meets the current demands of cloud computing but also &lt;strong&gt;sets a new standard for what integrated hardware and software solutions can achieve.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;rust-at-oxide&quot;&gt;Rust at Oxide&lt;&#x2F;h3&gt;
&lt;p&gt;Oxide leverages Rust extensively in its technological stack. They have developed several Rust-based projects, including Hubris, a lightweight, memory-protected, message-passing kernel designed for deeply embedded systems. &lt;a href=&quot;https:&#x2F;&#x2F;hubris.oxide.computer&#x2F;&quot; target=&quot;_blank&quot;&gt;Hubris&lt;&#x2F;a&gt; stands out for its all-Rust development approach, ensuring memory safety and concurrency, key features that Rust is celebrated for.&lt;&#x2F;p&gt;
&lt;p&gt;Additionally, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oxidecomputer&quot; target=&quot;_blank&quot;&gt;Oxide&#x27;s GitHub repositories&lt;&#x2F;a&gt; showcase a range of Rust projects, further illustrating their commitment to utilizing Rust in diverse aspects of their technology. These projects cover areas from &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oxidecomputer&#x2F;dropshot&quot; target=&quot;_blank&quot;&gt;REST API exposure&lt;&#x2F;a&gt; to &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oxidecomputer&#x2F;typify&quot; target=&quot;_blank&quot;&gt;JSON Schema converters&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oxidecomputer&#x2F;omicron&quot; target=&quot;_blank&quot;&gt;control panel&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;oxidecomputer&#x2F;console&quot; target=&quot;_blank&quot;&gt;console&lt;&#x2F;a&gt;, highlighting the versatility and capability of Rust in different computing contexts.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;benefits-of-using-rust&quot;&gt;Benefits of Using Rust&lt;&#x2F;h3&gt;
&lt;p&gt;The use of Rust by Oxide demonstrates the language&#x27;s capability in ensuring memory safety, a critical aspect in systems programming, especially for cloud-based and embedded systems where security and robustness are paramount. By utilizing Rust, Oxide benefits from its performance, safety features, and concurrency management, which are essential for their high-performance computing products.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;impact-on-business&quot;&gt;Impact on Business&lt;&#x2F;h3&gt;
&lt;p&gt;Oxide&#x27;s innovative approach has been well received in the industry, as evidenced by their impressive list of current customers, including the U.S. Department of Energy&#x27;s Idaho National Laboratory and a notable financial services firm (I could not find the name of this firm). Their ability to deliver cloud performance across every aspect of their business without the compromises associated with traditional cloud services positions Oxide as a significant player in the enterprise IT market.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;future-outlook&quot;&gt;Future Outlook&lt;&#x2F;h3&gt;
&lt;p&gt;Oxide&#x27;s commitment to Rust suggests a bright future for the language in enterprise-level, high-performance computing solutions. Their success serves as a testament to Rust&#x27;s potential in large-scale, commercial applications, further solidifying its position as a viable choice for companies seeking robust, efficient, and secure programming solutions.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Oxide Computer Company&#x27;s adoption of &lt;strong&gt;Rust&lt;&#x2F;strong&gt; underscores the language&#x27;s growing significance in the field of &lt;strong&gt;systems programming&lt;&#x2F;strong&gt; and cloud computing. Their success story is a beacon for other enterprises seeking innovative solutions, demonstrating the power of Rust in transforming the technological landscape of cloud computing. A company to keep an eye on!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Timeline:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;September 9, 2019 : Oxide Computer Company founded&lt;&#x2F;li&gt;
&lt;li&gt;December 4, 2019: Seed funding round of $20 million&lt;&#x2F;li&gt;
&lt;li&gt;September 12,2022: Series A $30 million funding round&lt;&#x2F;li&gt;
&lt;li&gt;October 26, 2023: Series A $44 million funding round&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;References:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.theregister.com&#x2F;2024&#x2F;02&#x2F;16&#x2F;oxide_3000lb_blade_server&#x2F;&quot; target=&quot;_blank&quot;&gt;Oxide reimagines private cloud&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;finance.yahoo.com&#x2F;news&#x2F;oxide-unveils-world-first-commercial-100000665.html&quot; target=&quot;_blank&quot;&gt;Oxide Unveils the World’s First Commercial Cloud Computer&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;oxide.computer&#x2F;product&#x2F;specifications&quot; target=&quot;_blank&quot;&gt;Specifications of the Oxide Rack&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=cuvp-e4ztC0&quot; target=&quot;_blank&quot;&gt;Exploring the synergy of Rust and Wright&#x27;s Law in enhancing low-latency systems&lt;&#x2F;a&gt;, this video offers a deep dive into the future of high-performance computing.&lt;&#x2F;li&gt;
&lt;li&gt;Energy Efficiency, &lt;a href=&quot;https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;opensource&#x2F;sustainability-with-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Sustainability with Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1bgoi34&#x2F;comprehensive_rust_and_rust_design_patterns_are&#x2F;?utm_source=share&amp;utm_medium=web3x&amp;utm_name=web3xcss&amp;utm_term=1&amp;utm_content=share_button&quot; target=&quot;_blank&quot;&gt;Comprehensive Rust and Rust Design Patterns now available in PDF&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Rust Nation UK 2024 has come to an end, missed the event? Watch the &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@rustnationuk&quot; target=&quot;_blank&quot;&gt;videos&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Oxide also hosts podcasts on Rust and cloud computing, stay updated with their latest episodes &lt;a href=&quot;https:&#x2F;&#x2F;oxide-and-friends.transistor.fm&#x2F;episodes&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>37 - Rust Mastery through Challenges and Tools</title>
          <pubDate>Sat, 16 Mar 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-mastery-through-challenges-and-tools/</link>
          <guid>https://rust-trends.com/newsletter/rust-mastery-through-challenges-and-tools/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-mastery-through-challenges-and-tools/">&lt;br&gt;
In this edition of Rust Trends, we&#x27;re excited to share the latest and most significant developments in the Rust programming world. Whether you&#x27;re just starting out or you&#x27;re an experienced Rustacean, this issue is packed with innovative applications and essential programming insights designed to deepen your knowledge and enhance your skills in Rust. Stay tuned for a comprehensive journey through the evolving landscape of Rust programming!
&lt;h2 id=&quot;exploring-git-with-rust-jon-gjengset-s-stream&quot;&gt;Exploring Git with Rust: Jon Gjengset&#x27;s Stream&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;37&#x2F;Git.webp&quot; alt=&quot;Git written in Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;Featuring Jon Gjengset&#x27;s detailed stream, &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=u0VotuGzD_w&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;Implementing (parts of) git from scratch in Rust&lt;&#x2F;a&gt; we delve into a practical application of Rust&#x27;s efficiency and safety in recreating aspects of the git version control system. This stream, drawing inspiration from the codecrafters challenges, serves as a fantastic learning tool for Rust enthusiasts.&lt;&#x2F;p&gt;
&lt;p&gt;Additionally, you have the opportunity this month to participate in the free Redis challenge. Engaging with this challenge through our &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;referral link&lt;&#x2F;a&gt; not only boosts your Rust expertise but also supports Rust Trends at no cost, allowing us to continue providing insightful content.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;we-want-your-rust-embedded-project-ideas&quot;&gt;We Want Your Rust Embedded Project Ideas!&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;37&#x2F;Embedded.webp&quot; alt=&quot;Rust Embedded Projects&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;&lt;strong&gt;Got a Brilliant Idea for a Rust-Powered Embedded Project?&lt;&#x2F;strong&gt;&lt;br&gt;
We&#x27;re excited to explore the potential of Rust in embedded systems and need your innovative ideas! Whether it&#x27;s a smart gadget, an IoT solution, or something entirely different, if it involves Rust and embedded development, we&#x27;re all ears.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Here’s How to Share:&lt;&#x2F;strong&gt;&lt;br&gt;
Simply reply to this email with your project idea. Describe what it&#x27;s about and why Rust is the perfect choice for it. Don&#x27;t worry about the scale of your idea – we&#x27;re looking for creativity and passion for Rust.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Next Steps:&lt;&#x2F;strong&gt;&lt;br&gt;
We&#x27;ll collect your ideas and choose one to develop publicly, sharing the journey with the Rust community.&lt;&#x2F;p&gt;
&lt;p&gt;Ready to inspire? Send us your idea now! 🚀🔧🤖&lt;&#x2F;p&gt;
&lt;h2 id=&quot;slumber-a-compact-rust-built-terminal-rest-client-and-an-inspiration-for-terminal-application-developers&quot;&gt;Slumber: A Compact Rust-Built Terminal REST Client and an Inspiration for Terminal Application Developers&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;37&#x2F;slumber.webp&quot; alt=&quot;Slumbler CLI API testing tool&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;Slumber stands out not just as a tool for API testing but also as a source of inspiration for those developing terminal applications. This Rust-based terminal REST client combines functionality and simplicity, offering a model for creating efficient and user-friendly terminal tools.&lt;&#x2F;p&gt;
&lt;p&gt;Highlights of Slumber:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;User-Friendly API Testing: Define, execute, and share HTTP requests with ease.&lt;&#x2F;li&gt;
&lt;li&gt;Secure Local Storage: Ensures your data and configurations are stored safely.&lt;&#x2F;li&gt;
&lt;li&gt;Rust &amp;amp; Ratatui Construction: Guarantees performance and reliability.&lt;&#x2F;li&gt;
&lt;li&gt;Sharing Capabilities: Ideal for collaborative work in API testing.&lt;&#x2F;li&gt;
&lt;li&gt;Inspirational Design: A great example for developers in the realm of terminal-based applications.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For developers focused on API testing or those seeking inspiration for building terminal applications, Slumber is a noteworthy tool. Discover its capabilities and get inspired on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;LucasPickering&#x2F;slumber&quot; target=&quot;_blank&quot;&gt;GitHub: LucasPickering&#x2F;slumber&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Rust-Flashcards, offers a unique and interactive way to learn and reinforce Rust programming concepts. This resource comprises a collection of digital flashcards, ideal for both newcomers and experienced developers seeking to polish their Rust knowledge. It&#x27;s a practical tool for those who prefer bite-sized, on-the-go learning. For a detailed view, visit the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ad-si&#x2F;Rust-Flashcards?tab=readme-ov-file&quot; target=&quot;_blank&quot;&gt;Rust-Flashcards GitHub page&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Crates.io has made significant changes to &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;03&#x2F;11&#x2F;crates-io-download-changes.html&quot; target=&quot;_blank&quot;&gt;how crate downloads are managed&lt;&#x2F;a&gt;, aiming to improve download reliability and speed. Starting from March 12, 2024, cargo will download crates directly from CDN servers, ensuring better performance.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The Rustup team has released version 1.27.0 of Rustup, introducing noteworthy enhancements. Key updates include basic support for the fish shell, allowing automatic PATH configuration during installation, and added support for loongarch64-unknown-linux-gnu as a host platform. The update can be applied by running &lt;code&gt;rustup self update&lt;&#x2F;code&gt; or &lt;code&gt;rustup update&lt;&#x2F;code&gt; for automatic updates at the end of a toolchain update. For more details, visit the &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;03&#x2F;11&#x2F;Rustup-1.27.0.html&quot; target=&quot;_blank&quot;&gt;Rust blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>36 - Rust Mastery: Coding the Future</title>
          <pubDate>Fri, 01 Mar 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-mastery-coding-the-future/</link>
          <guid>https://rust-trends.com/newsletter/rust-mastery-coding-the-future/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-mastery-coding-the-future/">&lt;br&gt;
In this edition of Rust Trends, we&#x27;re excited to share the latest and most significant developments in the Rust programming world. Whether you&#x27;re just starting out or you&#x27;re an experienced Rustacean, this issue is packed with innovative applications and essential programming insights designed to deepen your knowledge and enhance your skills in Rust. Stay tuned for a comprehensive journey through the evolving landscape of Rust programming!
&lt;h2 id=&quot;structuring-success-mastering-rust-structs&quot;&gt;Structuring Success: Mastering Rust Structs&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;36&#x2F;Rust-Game-of-Thrones.webp&quot; alt=&quot;Rust Fame of Thrones&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;The article titled &lt;a href=&quot;https:&#x2F;&#x2F;medium.com&#x2F;rustaceans&#x2F;rust-structs-a-fun-guide-with-examples-c2851dfb96c6&quot; target=&quot;_blank&quot;&gt;Rust Structs: A Fun Guide with Examples&lt;&#x2F;a&gt; by Jan Cibulka, presents a comprehensive and engaging guide to understanding structs in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;It cleverly uses metaphors from the &quot;Game of Thrones&quot; series to explain various aspects of Rust structs. The article covers basic struct definitions, methods in structs, associated functions, structs with enums, and structs with traits. Each concept is explained with creative examples that parallel the world of Westeros, making the technical content both accessible and entertaining. This approach not only aids in grasping the fundamentals of Rust structs but also in appreciating their practical applications in programming.&lt;&#x2F;p&gt;
&lt;p&gt;Do not forget to look at Jan&#x27;s other articles, &lt;a href=&quot;https:&#x2F;&#x2F;medium.com&#x2F;@jannden&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt; is an overview.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-blocks-of-cybersecurity-a-new-era-with-rust&quot;&gt;Building Blocks of Cybersecurity: A New Era with Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;36&#x2F;RustShield.webp&quot; alt=&quot;Rust Security Shield&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
&lt;p&gt;Welcome to the intersection of policy and programming, where Rust emerges as a key player in the cybersecurity arena, as highlighted in the recent White House report. Let&#x27;s unpack the essentials, minus the political jargon.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Memory Safety: Rust&#x27;s Superpower&lt;&#x2F;strong&gt;&lt;br&gt;
In the digital world&#x27;s ongoing battle against security threats, memory safety stands out as a crucial defense mechanism. The report applauds memory-safe languages like Rust for their role in significantly reducing vulnerabilities. Rust isn&#x27;t just a programming language; it&#x27;s a cybersecurity shield. 🛡️&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The Future with Rust: Secure and Bright&lt;&#x2F;strong&gt;&lt;br&gt;
The adoption of Rust is more than a trend; it&#x27;s a strategic move towards a more secure digital future. The report encourages developers and tech companies to embrace Rust, recognizing its potential to enhance cybersecurity across the board.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Measuring Security: The Role of Empirical Metrics&lt;&#x2F;strong&gt;&lt;br&gt;
Beyond advocating for Rust, the report emphasizes the importance of empirical metrics in assessing software security. This approach is akin to a regular health check for software, ensuring its resilience and reliability.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The Takeaway: Rust&#x27;s Role in a Safer Digital World&lt;&#x2F;strong&gt;&lt;br&gt;
For developers and tech enthusiasts, embracing Rust means contributing to a global effort for better cybersecurity. The White House report may be detailed, but its message is clear: Rust is at the forefront of creating a more secure digital environment.&lt;&#x2F;p&gt;
&lt;p&gt;In summary, Rust is not just making waves; it&#x27;s setting new standards in cybersecurity, as recognized in national policy. It&#x27;s an exciting time to be part of the Rust community, shaping the future of secure programming.&lt;&#x2F;p&gt;
&lt;p&gt;The actual report if you really want to read it :) &lt;a href=&quot;https:&#x2F;&#x2F;www.whitehouse.gov&#x2F;wp-content&#x2F;uploads&#x2F;2024&#x2F;02&#x2F;Final-ONCD-Technical-Report.pdf&quot; target=&quot;_blank&quot;&gt;Back to the Building Blocks: A Path Toward Secure and Measurable Software&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Exciting opportunity presented in a previous edition: the &quot;&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;newsletter&#x2F;rust-redis-design-patterns&#x2F;&quot; target=&quot;_blank&quot;&gt;Build Your Own Redis&lt;&#x2F;a&gt;&quot; challenge by Codecrafters. This challenge offers a unique blend of skill enhancement and practical application of Rust by diving into the construction of Redis. Combining learning with fun. Plus, there&#x27;s still a month left to &lt;strong&gt;try it for free&lt;&#x2F;strong&gt;! For those interested in deepening their understanding of Rust and enjoying a hands-on experience, this challenge is a must-try. Don&#x27;t miss out on this opportunity to elevate your skills in a real-world setting.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;02&#x2F;19&#x2F;2023-Rust-Annual-Survey-2023-results.html&quot; target=&quot;_blank&quot;&gt;2023 Rust Annual Survey&lt;&#x2F;a&gt;, is out! Highlighting the growing use and expertise in Rust among programmers, with trends in community diversity, professional use, and IDE preferences.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;roadmap.sh&#x2F;rust&quot; target=&quot;_blank&quot;&gt;Roadmap for learning Rust&lt;&#x2F;a&gt;. A step-by-step guide to becoming a Rust developer in 2024, with resources and learning paths.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Rust development environment fully built with Rust-based tools, highlighting Rust&#x27;s capability in creating efficient software. For more details, visit the &lt;a href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;rust&#x2F;comments&#x2F;1ayd8r0&#x2F;my_rust_development_environment_is_100_written_in&#x2F;&quot; target=&quot;_blank&quot;&gt;Reddit post&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>35 - Rust Redis &amp; Design Patterns</title>
          <pubDate>Thu, 15 Feb 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-redis-design-patterns/</link>
          <guid>https://rust-trends.com/newsletter/rust-redis-design-patterns/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-redis-design-patterns/">&lt;br&gt;
In this issue of Rust Trends, we&#x27;re bringing you the most exciting developments in Rust. From innovative applications to key programming insights, this edition is tailored to enhance your understanding and skills in Rust, whether you&#x27;re a beginner or an advanced user.
&lt;h2 id=&quot;boost-your-rust-skills-with-the-redis-challenge&quot;&gt;Boost Your Rust Skills with the Redis Challenge!&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;35&#x2F;Memory.webp&quot; alt=&quot;Redis In-Memory data structure store&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;Great news for those looking to upskill in Rust! Until the end of March, seize the chance to join Codecrafters&#x27; &quot;Build Your Own Redis&quot; challenge for free. It&#x27;s not just a coding task; it&#x27;s a deep dive into building Redis, a popular in-memory data structure store, using Rust.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Why It&#x27;s Worth Your Time:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Skill Enhancement:&lt;&#x2F;strong&gt; Perfect for honing your Rust skills.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Professional Development:&lt;&#x2F;strong&gt; Using Rust in a practical real-world application&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fun and Engaging:&lt;&#x2F;strong&gt; A rewarding experience that balances learning with enjoyment.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;What&#x27;s More - Try It for Free!&lt;&#x2F;strong&gt; You don&#x27;t have to take my word for it. &lt;strong&gt;Start the challenge for free&lt;&#x2F;strong&gt; and see the impact on your Rust expertise. The nice thing about Codecrafters is that it guides you with right amount of information to start coding and also provides more background if you want to learn more about a subject.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Get Started:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Explore the Challenge:&lt;&#x2F;strong&gt; Head over to &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;Codecrafters&lt;&#x2F;a&gt; and sign up with the use my referral link to support me with Rust-Trends at no extra cost.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Dive Into Rust:&lt;&#x2F;strong&gt; Begin your journey at your own pace and enjoy the process.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Want to learn more about Redis:&lt;&#x2F;strong&gt; Head over to the &lt;a href=&quot;https:&#x2F;&#x2F;redis.io&#x2F;&quot; target=&quot;_blank&quot;&gt;Redis website&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Happy coding! 🚀🦀💼&lt;&#x2F;p&gt;
&lt;h2 id=&quot;exploring-design-patterns-in-rust-a-curated-list&quot;&gt;Exploring Design Patterns in Rust: A Curated List&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;35&#x2F;Architect.webp&quot; alt=&quot;Architect Design Patterns&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;Design patterns in Rust streamline code development, ensuring robust, maintainable solutions. They standardize approaches to common problems, enhancing code clarity and facilitating easier communication among developers. Below you can find a comprehensive list:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-unofficial.github.io&#x2F;patterns&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Design Patterns - Unofficial&lt;&#x2F;a&gt;: An unofficial collection of design patterns for Rust, hosted on GitHub, offering a range of patterns and idioms.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;dpc.pw&#x2F;posts&#x2F;how-i-structure-my-apps-in-rust-and-other-languages&quot; target=&quot;_blank&quot;&gt;Structuring Apps in Rust&lt;&#x2F;a&gt;: D. P. Chowaniec&#x27;s post discusses their approach to structuring applications in Rust, offering valuable insights and techniques.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;lpxxn&#x2F;rust-design-pattern&quot; target=&quot;_blank&quot;&gt;Rust Design Pattern Examples&lt;&#x2F;a&gt;: A comprehensive collection of design pattern examples in Rust, maintained by L. X. on GitHub, essential for practical application.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;cliffle.com&#x2F;blog&#x2F;rust-typestate&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Typestate Pattern&lt;&#x2F;a&gt;: Cliff Biffle&#x27;s blog post delves into the Typestate pattern in Rust, highlighting its utility and implementation nuances.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=VFmPwvhubow&amp;pp=ygUUZGVzaWduIHBhdHRlcm5zIHJ1c3Q%3D&quot; target=&quot;_blank&quot;&gt;Rust State Design Pattern&lt;&#x2F;a&gt;: Explore the State Design Pattern in Rust with Let&#x27;s Get Rusty&#x27;s concise tutorial on YouTube. This video provides a practical demonstration of implementing the State pattern in Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=5DWU-56mjmg&amp;ab_channel=Let%27sGetRusty&quot; target=&quot;_blank&quot;&gt;Discover the Builder Pattern in Rust&lt;&#x2F;a&gt;: Let&#x27;s Get Rusty&#x27;s tutorial video is a quick guide on its implementation in idiomatic Rust.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2024&#x2F;02&#x2F;improving-interoperability-between-rust-and-c.html&quot; target=&quot;_blank&quot;&gt;Google&#x27;s latest initiative donates $1 million to the Rust Foundation&lt;&#x2F;a&gt;, aiming to enhance Rust&#x27;s interoperability with C++ and bolster software memory safety.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Explore the New Horizons: &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2024&#x2F;02&#x2F;08&#x2F;Rust-1.76.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.76.0&lt;&#x2F;a&gt; is Here! Discover the latest enhancements and features in the Rust programming language by checking out the release notes. Do not forget to run &lt;code&gt;rustup update&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Discover Why Rust is the Premier Choice for Robotics: Matic Robots shares insights on how Rust&#x27;s safety, performance, and error handling elevate their robot development. Learn more about their journey with Rust at &lt;a href=&quot;https:&#x2F;&#x2F;maticrobots.com&#x2F;blog&#x2F;why-rust-its-the-safe-choice&#x2F;&quot; target=&quot;_blank&quot;&gt;Matic Robots Blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Cheers,
Bob Peters&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>34 - Embedding AI with Rust: The Future of Intelligent Systems</title>
          <pubDate>Wed, 31 Jan 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/embedding-ai-with-rust-the-future-of-intelligent-systems/</link>
          <guid>https://rust-trends.com/newsletter/embedding-ai-with-rust-the-future-of-intelligent-systems/</guid>
          <description xml:base="https://rust-trends.com/newsletter/embedding-ai-with-rust-the-future-of-intelligent-systems/">&lt;br&gt;
Hello Rust Enthusiasts!
&lt;p&gt;Welcome to the latest edition of Rust Trends – your biweekly source for everything exciting in the world of Rust programming! In this issue, we delve into some groundbreaking developments and insightful guides that are shaping the Rust landscape. Whether you&#x27;re a seasoned developer or just starting out, our curated content promises to spark your curiosity and enhance your skills. Join us as we explore the innovative ways Rust is being used in machine learning, embedded systems, and much more.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s dive into the world of Rust, where innovation meets practicality!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;exploring-embedded-rust-unveiling-hanno-braun-s-insightful-guide&quot;&gt;Exploring Embedded Rust: Unveiling Hanno Braun&#x27;s Insightful Guide&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;34&#x2F;rust-embedded.webp&quot; alt=&quot;Rust for Embedded Systems&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;It&#x27;s time to delve into the world of embedded development with Hanno Braun&#x27;s comprehensive guide: &quot;Getting Started with Embedded Rust, Embassy, and the Raspberry Pi Pico.&quot; This resource is a treasure trove for both beginners and seasoned developers.&lt;&#x2F;p&gt;
&lt;p&gt;Hanno walks us through the nitty-gritty of setting up an embedded Rust environment, from choosing the right hardware (like the Raspberry Pi Pico) to detailed steps on software installation and configuration. This guide stands out for its clarity and detailed explanations, making embedded Rust accessible to all.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re curious about microcontroller programming or seeking to expand your Rust skills, this blog post is your go-to resource. Dive in to start your journey into the exciting realm of embedded Rust development!&lt;&#x2F;p&gt;
&lt;p&gt;🔗 Read the full article here: &lt;a href=&quot;https:&#x2F;&#x2F;www.hannobraun.com&#x2F;getting-started&#x2F;&quot; target=&quot;_blank&quot;&gt;Getting Started with Embedded Rust, Embassy, and the Raspberry Pi Pico&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;candle-ignites-ml-innovation-in-rust&quot;&gt;Candle Ignites ML Innovation in Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;34&#x2F;ML-candle.webp&quot; alt=&quot;Canlde ML framework made by Hugging Face&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;Hugging Face, a notable player in the artificial intelligence (AI) field, has recently introduced Candle, a minimalist machine learning (ML) framework tailored for the Rust programming language. Candle is designed to offer a straightforward yet efficient approach to machine learning, catering to the growing trend of using Rust in data-intensive applications due to its performance and safety features.&lt;&#x2F;p&gt;
&lt;p&gt;The GitHub statistics of the Candle project are impressive, reflecting its growing popularity and community support. As of the latest data, the repository has garnered around 11.8k stars and 594 forks at the time of writing. This level of engagement indicates a strong interest from the developer community, suggesting that Candle is gaining traction as a reliable and efficient tool for machine learning tasks in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Candle&#x27;s minimalist approach aligns with Hugging Face&#x27;s commitment to expanding its ecosystem and providing developers with versatile tools for AI and ML development. The framework&#x27;s design emphasizes performance, including GPU support, and ease of use, which makes it an attractive option for developers looking to leverage the Rust language in their ML projects.&lt;&#x2F;p&gt;
&lt;p&gt;For more detailed information and to explore the Candle framework further, you can visit the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;huggingface&#x2F;candle&quot; target=&quot;_blank&quot;&gt;GitHub page of Candle&lt;&#x2F;a&gt; and read about it on &lt;a href=&quot;https:&#x2F;&#x2F;towardsdatascience.com&#x2F;streamlining-serverless-ml-inference-unleashing-candle-frameworks-power-in-rust-c6775d558545&quot; target=&quot;_blank&quot;&gt;Towards Datascience&lt;&#x2F;a&gt; that implements a practical use case.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tada-congratulations-to-our-survey-giveaway-winner-tada&quot;&gt;🎉 Congratulations to Our Survey Giveaway Winner! 🎉&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;34&#x2F;survey.webp&quot; alt=&quot;Survey Winner&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
A heartfelt thank you to everyone who participated in our recent survey. Your valuable insights and feedback are crucial in shaping the future of Rust Trends and enhancing the Rust programming community.
&lt;h3 id=&quot;winner-announcement&quot;&gt;🌟 Winner Announcement 🌟&lt;&#x2F;h3&gt;
&lt;p&gt;We are excited to announce that the lucky recipient of the $100 AWS credits from our survey giveaway has been selected! Congratulations to the winner! We have contacted you via email with details on how to claim your prize. We&#x27;re eager to see the innovative ways you&#x27;ll use these credits in your Rust projects.&lt;&#x2F;p&gt;
&lt;p&gt;To all our participants, your involvement means the world to us. Though not everyone could win this time, your contributions are greatly appreciated and play a significant role in our community. Stay tuned for more opportunities and engaging content in the upcoming editions of Rust Trends.&lt;&#x2F;p&gt;
&lt;p&gt;Thank you for being a part of this journey, and let&#x27;s continue to grow and innovate together in the world of Rust.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;kobzol.github.io&#x2F;rust&#x2F;cargo&#x2F;2024&#x2F;01&#x2F;23&#x2F;making-rust-binaries-smaller-by-default.html&quot; target=&quot;_blank&quot;&gt;Making Rust binaries Smaller&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Visit the &lt;a href=&quot;https:&#x2F;&#x2F;users.rust-lang.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Progamming Language User Forum&lt;&#x2F;a&gt; for a change!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>33 - Unveiling Cargo Tool Secrets &amp; How Top Companies Are Innovating with Rust</title>
          <pubDate>Wed, 17 Jan 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/unveiling-cargo-tool-secrets-how-top-companies-are-innovating-with-rust/</link>
          <guid>https://rust-trends.com/newsletter/unveiling-cargo-tool-secrets-how-top-companies-are-innovating-with-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/unveiling-cargo-tool-secrets-how-top-companies-are-innovating-with-rust/">&lt;br&gt;
Hello Rust Enthusiasts!
&lt;p&gt;Welcome back to another edition of Rust Trends, your go-to biweekly newsletter for all things Rust. As the world of programming constantly evolves, Rust continues to make significant strides, shaping how we think about system safety and efficiency.&lt;&#x2F;p&gt;
&lt;p&gt;This issue is packed with insightful content, starting with a deep dive into the world of Cargo tools. We&#x27;ve curated essential tips and detailed guides on tools like cargo-minify, cargo-fmt, cargo-fix, and many more, helping you to streamline your development workflow and enhance your Rust projects.&lt;&#x2F;p&gt;
&lt;p&gt;Moreover, we&#x27;ve put together a special feature showcasing how major companies are leveraging Rust to drive innovation. From Microsoft&#x27;s memory safety initiatives to Discord&#x27;s performance enhancements, you&#x27;ll get an inside look at how Rust is being used at the forefront of technology.&lt;&#x2F;p&gt;
&lt;p&gt;We can&#x27;t wait to hear from you!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;maximizing-rust-development-with-cargo-essential-tips-and-tools&quot;&gt;Maximizing Rust Development with Cargo: Essential Tips and Tools&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;33&#x2F;toolbox-cargo.webp&quot; alt=&quot;Cargo Toolbox&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h3&gt;
&lt;p&gt;Cargo, the Rust package manager, is not just a tool for managing crates but a powerful ally in the Rust developer&#x27;s arsenal. By leveraging Cargo&#x27;s capabilities, developers can streamline their workflow, ensure code quality, and manage dependencies more effectively. This article explores essential Cargo commands and tools that every Rust programmer should know including cargo-minify, cargo-fmt, cargo-fix, cargo-audit, cargo-udeps, and several other popular tools.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-clippy&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;clippy&#x2F;&quot; target=&quot;_blank&quot;&gt;Cargo clippy&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;An advanced linter for Rust, providing a comprehensive set of lints to help improve your Rust code&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-fmt&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rustfmt&quot; target=&quot;_blank&quot;&gt;Cargo fmt&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Consistency is key in any large codebase. cargo fmt uses Rustfmt to format your Rust code according to style guidelines. It ensures that your project&#x27;s code style remains consistent, which is vital for collaborative projects and maintaining code clarity.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-minify&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tweedegolf&#x2F;cargo-minify&quot; target=&quot;_blank&quot;&gt;Cargo minify&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;cargo-minify is an invaluable tool for reducing the size of your Rust binaries. It optimizes the final build, stripping unnecessary data and compressing the code without affecting functionality. This is especially crucial for applications where binary size is a concern, such as embedded systems or distributed applications.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-fix&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;commands&#x2F;cargo-fix.html&quot; target=&quot;_blank&quot;&gt;Cargo fix&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;cargo fix automatically applies suggestions from the Rust compiler to fix warnings and improve your code. This command is particularly helpful during the upgrade of Rust editions, ensuring your codebase is up-to-date with the latest language features and idioms.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-audit&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;RustSec&#x2F;rustsec&#x2F;tree&#x2F;main&#x2F;cargo-audit&quot; target=&quot;_blank&quot;&gt;Cargo audit&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Security is paramount, and cargo audit helps identify known vulnerabilities in your project&#x27;s dependencies. This tool checks your Cargo.lock file against the RustSec Advisory Database and alerts you to any security issues in the dependencies. Can be easily installed with &quot;cargo install cargo-audit&quot;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-udeps&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;est31&#x2F;cargo-udeps&quot; target=&quot;_blank&quot;&gt;Cargo udeps&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Unused dependencies that bloat your project, cargo udeps helps in detecting unused dependencies in your Cargo.toml, enabling you to maintain a lean codebase. This means you only need the nightly Rust for running this specific tool, while the rest of your development and production process can remain on the stable release.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cargo-unused-features&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;TimonPost&#x2F;cargo-unused-features&quot; target=&quot;_blank&quot;&gt;Cargo unused-features&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Similar to cargo udeps, cargo unused-features focuses on identifying unused features of dependencies within your project. It&#x27;s a great way to keep your codebase clean and efficient. Can be easily installed  with &quot;cargo install cargo-unused-features&quot;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Cargo is more than a package manager; it&#x27;s a comprehensive tool that supports various aspects of Rust development. By integrating these tools into your workflow, you enhance code quality, security, and maintainability. Embrace these Cargo commands and tools to unlock the full potential of your Rust development experience. Do you have another tool you want to share? Reply to this email and I am happy to highlight it in the next newsletter to share it with the community.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-in-the-real-world-how-companies-are-embracing-rust&quot;&gt;Rust in the Real World: How Companies Are Embracing Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;33&#x2F;engineering-blogs.webp&quot; alt=&quot;Engineering Blogs that are embracing Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;h3 id=&quot;introduction-1&quot;&gt;Introduction&lt;&#x2F;h3&gt;
&lt;p&gt;Rust, known for its memory safety and performance, has been adopted by a range of companies to enhance their technology stacks. In this newsletter, we explore how various industry giants are leveraging Rust to solve complex engineering challenges. The links to their engineering blogs contain a wealth of in depth knowledge, so I highly recommend to explore those blogs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cloudflare-s-edge-logic-enhancement&quot;&gt;Cloudflare&#x27;s Edge Logic Enhancement&lt;&#x2F;h3&gt;
&lt;p&gt;Cloudflare has integrated Rust into its core edge logic, replacing memory-unsafe C. Their o&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cloudflare&quot; target=&quot;_blank&quot;&gt;pen-source repositories&lt;&#x2F;a&gt; and usage of Rust in critical tools like &lt;a href=&quot;https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;building-even-faster-interpreters-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Firewall Rules&lt;&#x2F;a&gt; demonstrate Rust’s potential in performance-critical applications.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;facebook-rust-for-source-control&quot;&gt;Facebook: Rust for Source Control&lt;&#x2F;h3&gt;
&lt;p&gt;Facebook has rewritten its source control backend in Rust, attracted by its safety benefits and the efficiency of dealing with bugs at compile time. This move reflects Rust&#x27;s ability to handle large, complex systems while ensuring code reliability.
Discover more about Facebook&#x27;s use of Rust &lt;a href=&quot;https:&#x2F;&#x2F;engineering.fb.com&#x2F;2021&#x2F;04&#x2F;29&#x2F;developer-tools&#x2F;rust&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;amazon-web-services-aws-and-rust&quot;&gt;Amazon Web Services (AWS) and Rust&lt;&#x2F;h3&gt;
&lt;p&gt;AWS has employed Rust for high-performance components of services like Lambda and EC2. AWS&#x27;s commitment to Rust includes the development of the Firecracker VMM, a virtual machine monitor built entirely in Rust.
Learn about AWS&#x27;s Rust initiatives &lt;a href=&quot;https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;opensource&#x2F;why-aws-loves-rust-and-how-wed-like-to-help&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;discord-s-diverse-rust-use-cases&quot;&gt;Discord’s Diverse Rust Use Cases&lt;&#x2F;h3&gt;
&lt;p&gt;Discord uses Rust across its codebase for both client and server sides. Rust has been instrumental in scaling their services and addressing performance issues, showcasing Rust&#x27;s versatility in real-time communication systems.
More on Discord&#x27;s Rust adoption can be found &lt;a href=&quot;https:&#x2F;&#x2F;discord.com&#x2F;blog&#x2F;why-discord-is-switching-from-go-to-rust&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;dropbox-optimizing-file-synchronization-with-rust&quot;&gt;Dropbox: Optimizing File Synchronization with Rust&lt;&#x2F;h3&gt;
&lt;p&gt;Dropbox leverages Rust for its file synchronization engine. The static types and compile-time checks offered by Rust provide a significant advantage in managing their complex and concurrent codebases.
Read about Dropbox&#x27;s Rust implementation &lt;a href=&quot;https:&#x2F;&#x2F;dropbox.tech&#x2F;infrastructure&#x2F;rewriting-the-heart-of-our-sync-engine&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;figma-rewriting-for-performance-with-rust&quot;&gt;Figma: Rewriting for Performance with Rust&lt;&#x2F;h3&gt;
&lt;p&gt;Figma turned to Rust to rewrite their multiplayer syncing engine. Rust&#x27;s combination of speed, low resource usage, and safety was key to overcoming performance limitations in their previous server.
Learn about Figma&#x27;s experience with Rust &lt;a href=&quot;https:&#x2F;&#x2F;www.figma.com&#x2F;blog&#x2F;rust-in-production-at-figma&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;microsoft-s-memory-safety-crusade&quot;&gt;Microsoft&#x27;s Memory Safety Crusade&lt;&#x2F;h3&gt;
&lt;p&gt;Microsoft&#x27;s journey with Rust is driven by a quest for memory safety. Historically, a significant portion of their security vulnerabilities was related to memory safety issues. Rust&#x27;s memory safety features provide a solid foundation for Microsoft to address these challenges. Learn more about Microsoft&#x27;s Rust adoption &lt;a href=&quot;https:&#x2F;&#x2F;cloudblogs.microsoft.com&#x2F;opensource&#x2F;2021&#x2F;02&#x2F;08&#x2F;microsoft-joins-rust-foundation&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion-1&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;The adoption of Rust by these leading companies underscores its growing importance in the industry. From enhancing security to boosting performance, Rust is proving to be a game-changer in tackling some of the most pressing software engineering challenges.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rustjobs.dev&#x2F;blog&#x2F;how-to-split-strings-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;How to split strings in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-script.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Run Rust files as scripts&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>32 - Embrace 2024 with Rust: Innovate &amp; Optimize!</title>
          <pubDate>Wed, 03 Jan 2024 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/embrace-2024-with-rust-innovate-and-optimize/</link>
          <guid>https://rust-trends.com/newsletter/embrace-2024-with-rust-innovate-and-optimize/</guid>
          <description xml:base="https://rust-trends.com/newsletter/embrace-2024-with-rust-innovate-and-optimize/">&lt;br&gt;
Hello Rust Enthusiasts!
&lt;p&gt;As we step into the fresh beginnings of 2024, we&#x27;re thrilled to bring you the latest edition of Rust Trends, your essential biweekly newsletter. With the new year unfolding, it&#x27;s the perfect time to dive into the evolving landscape of Rust and explore how it continues to shape the realm of programming.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue, we&#x27;re excited to feature an insightful article and youtube movie that will not only deepen your understanding of Rust but also inspire you to adopt it into your projects and teams.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;adopting-rust-the-missing-playbook-for-managers-and-ctos&quot;&gt;Adopting Rust: the missing playbook for managers and CTOs&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;32&#x2F;Datacenter-blue-print.webp&quot; alt=&quot;Adopting Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;As the festive season is ending and the new year started, it&#x27;s an opportune time for reflection and planning, particularly in the realm of technology adoption and team development. For those considering integrating Rust into their work environment, the article &quot;Adopting Rust: the missing playbook for managers and CTOs&quot; by &lt;a href=&quot;https:&#x2F;&#x2F;www.lpalmieri.com&#x2F;posts&#x2F;mainmatter&#x2F;&quot; target=&quot;_blank&quot;&gt;Luca Palmieri at Mainmatter&lt;&#x2F;a&gt; provides a comprehensive guide. This piece is especially pertinent for CTOs and engineering managers looking to kick off their first Rust project and scale their teams effectively.&lt;&#x2F;p&gt;
&lt;p&gt;The article delves into the strategic considerations and practical steps necessary for building a successful Rust team. It addresses the initial decision-making process, assessing your team&#x27;s readiness, and the nuances of hiring for Rust projects. Furthermore, it provides insights into upskilling your team, the importance of self-guided learning, and the benefits of external training and team augmentation. The piece also touches on the broader implications of scaling up your team and navigating the Rust job market.&lt;&#x2F;p&gt;
&lt;p&gt;As you embark on this Rust journey, let this article serve as your playbook, guiding you through the complexities and opportunities of adopting Rust in your organization. Whether you&#x27;re a seasoned tech leader or new to the language, this piece offers valuable insights to make your Rust adoption a resounding success.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;mainmatter.com&#x2F;blog&#x2F;2023&#x2F;12&#x2F;13&#x2F;rust-adoption-playbook-for-ctos-and-engineering-managers&#x2F;&quot; target=&quot;_blank&quot;&gt;Read the full article&lt;&#x2F;a&gt; for a detailed roadmap and practical advice on integrating Rust into your team and projects, ensuring a prosperous new year filled with robust, efficient, and safe code.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rustifying-serverless-boost-aws-lambda-performance-with-rust&quot;&gt;“Rustifying” serverless: Boost AWS Lambda performance with Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;32&#x2F;AWS-reinvent-banner.webp&quot; alt=&quot;AWS Reinvent&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;Are you looking to incrementally introduce Rust into your company&#x27;s tech stack? Look no further than your AWS Lambda functions! The video &quot;AWS re:Invent 2023 - &#x27;Rustifying&#x27; serverless: Boost AWS Lambda performance with Rust (COM306)&quot; is an excellent resource to understand how Rust can significantly enhance the performance and security of your AWS Lambda applications.&lt;&#x2F;p&gt;
&lt;p&gt;Rust, known for its performance and safety, is an ideal choice for serverless architectures. By integrating Rust into your Lambda functions, you can enjoy faster execution times, reduced costs, and improved security - all while gradually getting your team accustomed to Rust&#x27;s powerful features. This session will guide you through deploying Rust functions, optimizing performance, and sharing practical strategies to &quot;Rustify&quot; your serverless applications.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re a Rust enthusiast or new to the language, this video will provide valuable insights into making your serverless applications more efficient and cost-effective. Start introducing Rust bit by bit into your company today and watch your serverless functions transform!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Mdh_2PXe9i8&quot; target=&quot;_blank&quot;&gt;Watch the video here&lt;&#x2F;a&gt; and embark on your journey to a more performant and secure serverless environment with Rust.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;priver.dev&#x2F;blog&#x2F;rust&#x2F;multi-threading&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust multi-threading&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-unofficial&#x2F;awesome-rust&quot; target=&quot;_blank&quot;&gt;Curated list of Rust Code and Resources&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pola-rs&#x2F;polars&#x2F;releases&#x2F;tag&#x2F;rs-0.36.2&quot; target=&quot;_blank&quot;&gt;Rust Polars 0.36.2 release&lt;&#x2F;a&gt;, DataFrame Library&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd&quot; target=&quot;_blank&quot;&gt;Fd&lt;&#x2F;a&gt; a Rust alternative to find command&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>31 - Rust Revealed: A Closer Look at Official Releases and Format Argument Strategies</title>
          <pubDate>Wed, 06 Dec 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-revealed-a-closer-look-at-official-releases-and-format-argument-strategies/</link>
          <guid>https://rust-trends.com/newsletter/rust-revealed-a-closer-look-at-official-releases-and-format-argument-strategies/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-revealed-a-closer-look-at-official-releases-and-format-argument-strategies/">&lt;br&gt;
Hello, Rust Enthusiasts!
&lt;p&gt;Welcome aboard the latest edition of Rust Trends, your essential biweekly newsletter that keeps you at the forefront of all things Rust. In this issue, we&#x27;re not just sharing updates; we&#x27;re diving deep into the realms of Rust&#x27;s evolving landscape.&lt;&#x2F;p&gt;
&lt;p&gt;In today&#x27;s issue, we unravel the mysteries behind the Official Rust releases, offering you a behind-the-scenes look at the mechanisms that drive this robust language. Additionally, we feature an insightful deep dive into format arguments, led by none other than Mara Bos, a renowned expert in the Rust community.&lt;&#x2F;p&gt;
&lt;p&gt;Keep your finger on the pulse of Rust programming with our continuous stream of updates and in-depth insights. Stay with us as we explore the cutting edge of Rust&#x27;s capabilities and innovations.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;navigating-the-tracks-an-introduction-to-rust-s-release-train&quot;&gt;Navigating the Tracks: An Introduction to Rust&#x27;s Release Train&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;31&#x2F;Rust-release-train.webp&quot; alt=&quot;Rust Release Train&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;&lt;strong&gt;Rust Release Train&lt;&#x2F;strong&gt; – an innovative approach to software development that keeps the Rust programming language both progressive and reliable. If you&#x27;re new to the Rust community or just looking to understand how updates to this beloved language are rolled out, you&#x27;re in the right place. Our journey today will take us through the heart of Rust&#x27;s release process, providing insights and clarifications along the way.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;What is the Rust Release Train?&lt;&#x2F;strong&gt;
Rust&#x27;s release train is a model for delivering updates and new features to the language. This model prioritizes consistency, stability, and predictability, ensuring that Rust developers can enjoy new features without worrying about disruptive changes or instability.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;How It Works&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Regular Schedule: The release train operates on a fixed, six-week cycle. Every six weeks, a new stable version of Rust is released. This predictable schedule allows developers to plan for updates and minimizes surprises.&lt;&#x2F;li&gt;
&lt;li&gt;Channels: Rust employs three primary channels for releases:
&lt;ul&gt;
&lt;li&gt;Stable Channel: This is the official release of Rust that most developers use. It&#x27;s updated every six weeks and is considered stable and ready for production use.&lt;&#x2F;li&gt;
&lt;li&gt;Beta Channel: When a new feature is finalized, it enters the beta channel. It stays here for six weeks for further testing before it&#x27;s promoted to stable.&lt;&#x2F;li&gt;
&lt;li&gt;Nightly Channel: Cutting-edge features that are still in development are available in the nightly channel. While exciting, these features are not guaranteed to be stable or to make it into the stable channel.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Backward Compatibility: A key aspect of the release train is its commitment to backward compatibility. New updates aim not to break existing Rust code, ensuring a smooth transition for developers.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Benefits of the Release Train&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Stability: The regular release schedule and rigorous testing phases mean that new features are thoroughly vetted before reaching the stable channel.&lt;&#x2F;li&gt;
&lt;li&gt;Innovation: The nightly and beta channels allow for continuous innovation without compromising the stability of the stable channel.&lt;&#x2F;li&gt;
&lt;li&gt;Community Involvement: The Rust community plays a significant role in the development process, contributing to the evolution of the language.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Navigating Updates&lt;&#x2F;strong&gt;
As a Rust developer, it&#x27;s essential to keep track of these updates. &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;&quot; target=&quot;_blank&quot;&gt;The official Rust blog&lt;&#x2F;a&gt; is a great resource for staying informed about new releases and upcoming features.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;&#x2F;strong&gt;
The Rust Release Train is a testament to the language&#x27;s commitment to stability and innovation. By understanding this process, developers can make the most of Rust&#x27;s powerful features while ensuring their code remains robust and reliable.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-deep-dive-into-the-format-args-macro-and-fmt-arguments&quot;&gt;A Deep Dive into the format_args! Macro and fmt::Arguments&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;31&#x2F;Deep-dive.webp&quot; alt=&quot;Training and Certification Program&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;The technical article by Rust Expert Mara Bos, titled &quot;&lt;strong&gt;Behind the Scenes of Rust String Formatting: format_args!()&lt;&#x2F;strong&gt;&quot; offers an in-depth exploration of the &lt;code&gt;fmt::Arguments&lt;&#x2F;code&gt; type in the Rust standard library. This type, along with the &lt;code&gt;format_args!()&lt;&#x2F;code&gt; macro, is a fundamental component behind various text formatting macros such as &lt;code&gt;print!()&lt;&#x2F;code&gt;, &lt;code&gt;format!()&lt;&#x2F;code&gt;, and &lt;code&gt;log::info!()&lt;&#x2F;code&gt;, both from the standard library and community crates.&lt;&#x2F;p&gt;
&lt;p&gt;In this article, Bos delves into the workings of &lt;code&gt;fmt::Arguments&lt;&#x2F;code&gt;, its current implementation, and potential future improvements. The article begins by explaining how the format_args!() macro works, highlighting its compile-time parsing of format strings and its ability to produce compiler errors if placeholders and arguments do not match. Bos also discusses the macro&#x27;s ability to transform string templates into representations that are easy to process at runtime.&lt;&#x2F;p&gt;
&lt;p&gt;The article further explores the usage examples of Rust’s string formatting, implementation details, and the private nature of &lt;code&gt;fmt::Arguments&lt;&#x2F;code&gt; implementation, which allows for flexibility in making changes without affecting existing code. Bos raises questions about the most efficient implementation of &lt;code&gt;fmt::Arguments&lt;&#x2F;code&gt; and discusses various aspects such as structure size, code size, and runtime overhead.&lt;&#x2F;p&gt;
&lt;p&gt;The article concludes with ideas for improvement, including the use of closures, the introduction of a simple_fmt method in display traits, merging pieces and placeholders, creating a list of formatting instructions, and optimizing the &lt;code&gt;fmt::Arguments&lt;&#x2F;code&gt; structure.&lt;&#x2F;p&gt;
&lt;p&gt;For a comprehensive understanding of this topic, you can &lt;a href=&quot;https:&#x2F;&#x2F;blog.m-ou.se&#x2F;format-args&#x2F;&quot; target=&quot;_blank&quot;&gt;read the full article at Mara&#x27;s Blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;aws.amazon.com&#x2F;about-aws&#x2F;whats-new&#x2F;2023&#x2F;11&#x2F;aws-sdk-rust&#x2F;?nc1=h_ls&quot; target=&quot;_blank&quot;&gt;AWS SDK for Rust&lt;&#x2F;a&gt; is now generally available&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;loco.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;loco-rs&lt;&#x2F;a&gt;: releasing a framework inspired by Rails on Rust&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>30 - Evolving with Rust: Oxidizing Ideas, Corroding Conventions</title>
          <pubDate>Wed, 22 Nov 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/evolving-with-rust-oxidizing-ideas-corroding-conventions/</link>
          <guid>https://rust-trends.com/newsletter/evolving-with-rust-oxidizing-ideas-corroding-conventions/</guid>
          <description xml:base="https://rust-trends.com/newsletter/evolving-with-rust-oxidizing-ideas-corroding-conventions/">&lt;br&gt;
Hello, Rust Enthusiasts!
&lt;p&gt;Welcome to the latest edition of Rust Trends, your go-to source for everything happening in the world of Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue, we delve into the fascinating insights of Matthias Endler, a renowned Rust consultant, as he explores the increasing adoption of Rust in production environments, especially among tech giants.&lt;&#x2F;p&gt;
&lt;p&gt;We discuss the Rust Foundation&#x27;s latest initiative: a training and certification program. This program, aimed at bolstering Rust&#x27;s growing popularity and demand, is set to enrich the community with quality educational resources and certification opportunities, further solidifying Rust&#x27;s position in the tech industry.&lt;&#x2F;p&gt;
&lt;p&gt;Additionally, we&#x27;re excited to announce the release of Rust 1.74.0. This release continues to demonstrate Rust&#x27;s commitment to innovation and stability, offering developers even more tools and capabilities to build robust, efficient applications.&lt;&#x2F;p&gt;
&lt;p&gt;Stay tuned for more updates and insights in the dynamic world of Rust programming.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;article-on-corrode-why-rust-in-production&quot;&gt;Article on Corrode: Why Rust in Production?&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;30&#x2F;hero.webp&quot; alt=&quot;Corrode Why Rust in Production&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h3 id=&quot;why-rust-in-production&quot;&gt;Why Rust in Production?&lt;&#x2F;h3&gt;
&lt;p&gt;Matthias Endler&#x27;s article, &quot;&lt;a href=&quot;https:&#x2F;&#x2F;corrode.dev&#x2F;why-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Why Rust in Production?&lt;&#x2F;a&gt;&quot; on Corrode, is a comprehensive and insightful exploration of the increasing interest in Rust, especially among tech giants like Microsoft, Google, and Amazon. The article addresses a common gap in the dialogue about Rust: the skewed understanding of its application in production settings, particularly for small and medium-sized businesses.&lt;&#x2F;p&gt;
&lt;p&gt;Matthias, through his role as a Rust consultant, brings a wealth of experience from working with various companies. He emphasizes that businesses often prioritize productivity, stability, and long-term maintainability over mere performance. His insights are backed by public data and surveys, adding credibility to his observations.&lt;&#x2F;p&gt;
&lt;p&gt;The article delves into the reasons for using Rust in production, highlighting its reliability, stability, predictable runtime behavior, cost savings, and developer ergonomics. It also touches upon the focus on long-term sustainability and the increasing popularity of Rust among developers.&lt;&#x2F;p&gt;
&lt;p&gt;However, he doesn&#x27;t shy away from discussing the challenges associated with Rust, such as its immature ecosystem, the scarcity of experienced developers, and the steep learning curve. He provides a balanced view, acknowledging the commitment required to integrate Rust into a technology stack.&lt;&#x2F;p&gt;
&lt;p&gt;For anyone considering Rust for their projects or simply curious about its growing popularity, Matthias Endler&#x27;s article is an essential read.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;who-is-matthias-endler&quot;&gt;Who is Matthias Endler?&lt;&#x2F;h3&gt;
&lt;p&gt;In the dynamic world of Rust programming, Matthias Endler stands out as a notable figure. A seasoned Rust developer and open-source maintainer, Matthias has been instrumental in advancing the Rust ecosystem. His journey with Rust began in 2015, and since 2019, he has been professionally involved in the Rust community. His expertise is not just limited to development; he extends his knowledge through training, consulting, and contracting, focusing on delivering idiomatic Rust code that is straightforward and lacking of unnecessary complexities.&lt;&#x2F;p&gt;
&lt;p&gt;His contributions to the Rust community are significant, with popular Rust crates like &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tinysearch&#x2F;tinysearch&quot; target=&quot;_blank&quot;&gt;tinysearch&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mre&#x2F;hyperjson&quot; target=&quot;_blank&quot;&gt;hyperjson&lt;&#x2F;a&gt;, and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;lycheeverse&#x2F;lychee&quot; target=&quot;_blank&quot;&gt;lychee&lt;&#x2F;a&gt; credited to his name. Matthias is also a familiar face in the Rust conference circuit, having spoken at  events like FOSDEM in Brussels, Cod{e}motion in Amsterdam, and BrisTech in Bristol, among others. He has also conducted workshops at various conferences, sharing his Rust expertise with a wider audience.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-foundation-initiative-for-a-training-and-certification-program&quot;&gt;Rust Foundation Initiative for a Training and Certification Program&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;30&#x2F;crab-certification.webp&quot; alt=&quot;Training and Certification Program&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0&quot;&gt;
&lt;p&gt;The Rust Foundation has announced its plan to develop a &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;news&#x2F;the-rust-foundation-to-develop-training-and-certification-program&#x2F;&quot; target=&quot;_blank&quot;&gt;training and certification program&lt;&#x2F;a&gt; for the Rust programming language. This initiative reflects the language&#x27;s growing popularity, as evidenced by its repeated recognition as the most-loved programming language and the increasing demand for Rust courses. The Foundation aims to use the proceeds from this program to support the Rust community and ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;This program is in its early planning stages and involves collaboration with Rust community experts, including Tim McNamara, an experienced Rust educator. The Foundation&#x27;s goal is to supplement existing Rust education resources, empower educators, and provide a means for professionals to verify their Rust skills. Details on course pricing and structure are still being developed, with a focus on directing all proceeds towards supporting Rust Foundation initiatives and the Rust Project.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;11&#x2F;16&#x2F;Rust-1.74.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.74.0&lt;&#x2F;a&gt; is released, do not forget to run &lt;code&gt;rustup update&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bitswired&#x2F;rustgpt&quot; target=&quot;_blank&quot;&gt;RustGPT&lt;&#x2F;a&gt; a Rust-built web clone of ChatGPT.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;jsoverson.medium.com&#x2F;was-rust-worth-it-f43d171fb1b3&quot; target=&quot;_blank&quot;&gt;Was Rust worth it?&lt;&#x2F;a&gt; Article on Medium&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>29 - Rust Revolution: AI Frontiers &amp; Secure Coding</title>
          <pubDate>Wed, 08 Nov 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-revolution-ai-frontiers-secure-coding/</link>
          <guid>https://rust-trends.com/newsletter/rust-revolution-ai-frontiers-secure-coding/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-revolution-ai-frontiers-secure-coding/">&lt;br&gt;
Hello, Rust Enthusiasts!
&lt;p&gt;Welcome to Rust Trends, where we bring the cutting edge of Rust programming directly to your inbox. This edition is packed with innovation, featuring Grok&#x27;s AI advancements powered by Rust and Prossimo&#x27;s push for safer internet infrastructure. Dive in for a concise, powerful update on Rust&#x27;s impact in tech.&lt;&#x2F;p&gt;
&lt;p&gt;As we continue our journey together, we invite you to engage with our content, share your insights, and help expand the Rust community. Your enthusiasm and support make Rust Trends more than just a newsletter; it&#x27;s a community of passionate developers eager to shape the future.&lt;&#x2F;p&gt;
&lt;p&gt;So, grab your favorite beverage, settle in, and let&#x27;s dive into the transformative world of Rust. Together, let&#x27;s unlock the potential of safe, efficient, and robust software development. Let&#x27;s explore and grow together in the Rust ecosystem.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;grok-a-rust-powered-leap-in-ai&quot;&gt;Grok: A Rust-Powered Leap in AI&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;29&#x2F;twitter-to-X.webp&quot; alt=&quot;Grok&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;Grok emerges as a witty AI assistant on X, formerly known as Twitter, but what truly sets it apart is its Rust-based infrastructure. Developed by &lt;a href=&quot;https:&#x2F;&#x2F;x.ai&#x2F;&quot; target=&quot;_blank&quot;&gt;xAI&lt;&#x2F;a&gt;, Grok leverages Rust&#x27;s robustness to build a reliable and efficient system that underpins its AI operations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;rust-s-role-in-grok-s-development&quot;&gt;Rust&#x27;s Role in Grok&#x27;s Development&lt;&#x2F;h3&gt;
&lt;p&gt;The engineering team at xAI chose Rust for its performance and safety guarantees, which are essential for the distributed systems running Grok. Rust&#x27;s compile-time error checking ensures that Grok&#x27;s infrastructure is less prone to bugs and system failures, a critical feature when synchronizing computations across thousands of GPUs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;efficiency-and-reliability&quot;&gt;Efficiency and Reliability&lt;&#x2F;h3&gt;
&lt;p&gt;Rust&#x27;s efficiency is not just about speed; it&#x27;s about maximizing compute per watt, a key focus for xAI. This efficiency has enabled Grok to rapidly improve, as evidenced by its strong performance on machine learning benchmarks, even with limited training resources compared to larger models.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-future-with-rust&quot;&gt;The Future with Rust&lt;&#x2F;h3&gt;
&lt;p&gt;As xAI prepares for the next phase of Grok&#x27;s capabilities, Rust&#x27;s role becomes even more pivotal. It&#x27;s not just about maintaining the current system; it&#x27;s about scaling up and integrating new features seamlessly. Rust&#x27;s promise of reliability and maintainability makes it an ideal choice for Grok&#x27;s journey ahead.&lt;&#x2F;p&gt;
&lt;p&gt;In the AI landscape, Grok is a shining example of how Rust&#x27;s strengths can be harnessed to build the next generation of intelligent systems.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;memory-safety-for-the-internet-s-most-critical-infrastructure&quot;&gt;Memory safety for the Internet&#x27;s most critical infrastructure&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;29&#x2F;Prossimo.webp&quot; alt=&quot;Prossimo an initiative focused on memory safety for critical internet infrastructure&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%; border:0&quot;&gt;
&lt;p&gt;Prossimo, an initiative focused on memory safety for critical internet infrastructure, advocates for the use of Rust to enhance security and reliability. Key initiatives include replacing OpenSSL with the &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;initiative&#x2F;rustls&#x2F;&quot; target=&quot;_blank&quot;&gt;Rustls&lt;&#x2F;a&gt; TLS library, creating memory-safe drivers for the Linux kernel, and developing a memory-safe &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;initiative&#x2F;av1&#x2F;&quot; target=&quot;_blank&quot;&gt;AV1 decoder&lt;&#x2F;a&gt;. The organization also targets utility tools like sudo and su for safer privilege mediation, and aims to create memory-safe implementations for &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;initiative&#x2F;ntp&#x2F;&quot; target=&quot;_blank&quot;&gt;NTP&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;initiative&#x2F;dns&#x2F;&quot; target=&quot;_blank&quot;&gt;DNS&lt;&#x2F;a&gt;. &lt;a href=&quot;https:&#x2F;&#x2F;www.memorysafety.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Prossimo&lt;&#x2F;a&gt; encourages community involvement through donations and advocacy for memory-safe code in the workplace, with a straightforward framework for funding and commencing initiatives.&lt;&#x2F;p&gt;
&lt;p&gt;Among the funders of the initiatives are names like, Sovereign-Tech-Fund, Cisco, Google, Fly.io, AWS, OpenSSF and FutureWei Technologies.&lt;&#x2F;p&gt;
&lt;p&gt;Nice to see such fruitful initiatives that introduces memory safety to every day software.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>28 - Rust in Action: 10 Project Ideas to Elevate Your Skills</title>
          <pubDate>Fri, 27 Oct 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-in-action-10-project-ideas-to-elevate-your-skills/</link>
          <guid>https://rust-trends.com/newsletter/rust-in-action-10-project-ideas-to-elevate-your-skills/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-in-action-10-project-ideas-to-elevate-your-skills/">&lt;br&gt;
Hello, Rust Enthusiasts!
&lt;p&gt;Welcome back to another edition of Rust Trends! You might notice that we&#x27;re reaching out on a Friday this time, instead of our usual Wednesday. Why the change? Well, we want to set you up for a productive and educational weekend ahead!&lt;&#x2F;p&gt;
&lt;p&gt;In our second last issue, &lt;a href=&quot;&#x2F;newsletter&#x2F;rust-101-the-best-learning-resources-compiled&#x2F;&quot;&gt;Rust 101: The Best Learning Resources Compiled&lt;&#x2F;a&gt;, we explored the best resources to kickstart your journey with Rust. The positive reactions were overwhelming, and we are thrilled to see so many of you eager to learn. But what comes next after you have written your first &quot;Hello, World!&quot; program in Rust? The answer is simple: Projects, projects, projects! This is the best way to retain and build upon what you&#x27;ve learned so far.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s no better method to solidify your understanding of a programming language than by building something from scratch. That is why this edition is dedicated to inspiring you with project ideas tailored for different skill levels. Whether you&#x27;re a beginner looking for a small weekend project or an intermediate developer aiming for something more ambitious, we&#x27;ve got you covered.&lt;&#x2F;p&gt;
&lt;p&gt;So, let&#x27;s turn those learning resources into practical experience and dive into the world of Rust projects! Get ready to make the most out of your weekend with Rust!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-in-action-10-project-ideas-to-elevate-your-skills&quot;&gt;Rust in Action: 10 Project Ideas to Elevate Your Skills&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;28&#x2F;Rust-Weekend-projects.webp&quot; alt=&quot;Rust Weekend projects&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h3 id=&quot;1-grep-command-line-utility-easy&quot;&gt;1. &lt;strong&gt;grep command-line utility (Easy)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a simplified version of the Unix grep command-line utility. Your program should read a file and a search term (or regular expression) as input, then output all lines from the file that contain the search term. Rust Concepts Utilized:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;File I&#x2F;O with the &lt;code&gt;std::fs&lt;&#x2F;code&gt; module for reading files&lt;&#x2F;li&gt;
&lt;li&gt;Regular expressions using Rust&#x27;s regex library for pattern matching&lt;&#x2F;li&gt;
&lt;li&gt;String manipulation for searching and filtering lines&lt;&#x2F;li&gt;
&lt;li&gt;Command-line argument parsing using &lt;code&gt;std::env&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This challenge is a fantastic way to get hands-on experience with text processing and pattern matching in Rust, making it an excellent project for those interested in systems programming.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-url-shortener-service-medium&quot;&gt;2. &lt;strong&gt;URL shortener service (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create your own URL shortener service. The application should take a long URL and return a shortened version, and when accessed, the shortened URL should redirect to the original long URL. This challenge will help you explore the following Rust concepts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Web server setup using frameworks like &lt;code&gt;Rocket&lt;&#x2F;code&gt; or &lt;code&gt;Actix&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Data storage and retrieval, possibly using databases like SQLite or key-value stores like Redis&lt;&#x2F;li&gt;
&lt;li&gt;String manipulation for generating short URLs&lt;&#x2F;li&gt;
&lt;li&gt;HTTP request and response handling&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This is a fantastic project for those looking to delve into web development with Rust and understand how to work with databases, web frameworks, and HTTP protocols.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-text-based-adventure-game-medium&quot;&gt;3. &lt;strong&gt;Text-Based Adventure Game (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a simple text-based adventure game where the user can explore rooms, pick up items, and solve puzzles. This will help you get hands-on experience with:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;User input and output using Rust&#x27;s &lt;code&gt;std::io&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Structs and Enums for game states and items&lt;&#x2F;li&gt;
&lt;li&gt;Control flow for game logic&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-basic-web-scraper-easy&quot;&gt;4. &lt;strong&gt;Basic Web Scraper (Easy)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Build a web scraper that fetches and parses the content of a webpage, extracting specific information like headlines or links. This will involve:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;HTTP requests using libraries like &lt;code&gt;reqwest&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;HTML parsing using libraries like &lt;code&gt;scraper&lt;&#x2F;code&gt; or &lt;code&gt;select&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;String manipulation and regular expressions&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;5-real-time-chat-application-medium&quot;&gt;5. &lt;strong&gt;Real-Time Chat Application (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Develop a real-time chat application where multiple users can join rooms and send messages to each other. This will allow you to explore:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Networking with Rust&#x27;s &lt;code&gt;std::net&lt;&#x2F;code&gt; or third-party libraries like &lt;code&gt;tokio&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Multi-threading for handling multiple clients&lt;&#x2F;li&gt;
&lt;li&gt;Data serialization and deserialization, possibly using formats like JSON&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;6-file-encryption-and-decryption-utility-medium&quot;&gt;6. &lt;strong&gt;File Encryption and Decryption Utility (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a utility that can encrypt and decrypt files using a given key. This will involve:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;File I&#x2F;O with &lt;code&gt;std::fs&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Cryptographic algorithms using libraries like &lt;code&gt;ring&lt;&#x2F;code&gt; or &lt;code&gt;openssl&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Command-line argument parsing with &lt;code&gt;std::env&lt;&#x2F;code&gt; or &lt;code&gt;clap&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;7-markdown-to-html-converter-medium&quot;&gt;7. &lt;strong&gt;Markdown to HTML Converter (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Build a tool that converts Markdown files to HTML. This will help you get hands-on experience with:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Text parsing and manipulation&lt;&#x2F;li&gt;
&lt;li&gt;File I&#x2F;O with &lt;code&gt;std::fs&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;String interpolation and formatting&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;8-simple-http-server-medium&quot;&gt;8. &lt;strong&gt;Simple HTTP Server (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a basic HTTP server that can serve static files and handle basic RESTful operations. This will involve:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Networking with &lt;code&gt;std::net&lt;&#x2F;code&gt; or &lt;code&gt;hyper&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;File I&#x2F;O for serving static files&lt;&#x2F;li&gt;
&lt;li&gt;HTTP protocol understanding&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;9-currency-converter-with-gui-medium&quot;&gt;9. &lt;strong&gt;Currency Converter with GUI (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a desktop application that allows users to convert between different currencies. The application should have a graphical user interface (GUI) where users can input the amount and select the currencies they want to convert between. Rust Concepts Utilized:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;GUI development with &lt;code&gt;Tauri&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;HTTP requests for fetching real-time currency exchange rates, possibly using &lt;code&gt;reqwest&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;State management to update the UI&lt;&#x2F;li&gt;
&lt;li&gt;Event handling for user interactions like button clicks or dropdown selections&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;10-image-processing-tool-medium&quot;&gt;10. &lt;strong&gt;Image Processing Tool (Medium)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a tool that can apply basic image processing techniques like grayscale, blur, and edge detection on image files. This will involve:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Image reading and writing with libraries like &lt;code&gt;image&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Algorithms for image processing&lt;&#x2F;li&gt;
&lt;li&gt;File I&#x2F;O with &lt;code&gt;std::fs&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;11-bonus-real-time-object-detection-system-hard&quot;&gt;11. &lt;strong&gt;Bonus: Real-Time Object Detection System (Hard)&lt;&#x2F;strong&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a real-time object detection system using Rust and machine learning libraries. The application should be able to process video streams and identify and label objects in real-time. Implement features like bounding boxes around detected objects and real-time tracking. Rust Concepts Utilized:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Interfacing with machine learning libraries through FFI (Foreign Function Interface) or using Rust-native libraries like &lt;code&gt;tch-rs&lt;&#x2F;code&gt; for PyTorch&lt;&#x2F;li&gt;
&lt;li&gt;Video stream processing, possibly using libraries like &lt;code&gt;opencv&lt;&#x2F;code&gt; or &lt;code&gt;image&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Multi-threading and concurrency for real-time processing&lt;&#x2F;li&gt;
&lt;li&gt;Data serialization and deserialization for model input&#x2F;output&lt;&#x2F;li&gt;
&lt;li&gt;GUI for displaying the video stream and detection results, possibly using frameworks like &lt;code&gt;Tauri&lt;&#x2F;code&gt; or &lt;code&gt;GTK&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Each of these challenges is a great way to deepen your understanding of Rust&#x27;s capabilities in different domains, from cryptography and text parsing to web development and image processing.&lt;&#x2F;p&gt;
&lt;p&gt;Interested in more ideas or want to share your project feel free to reply to this email.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;spotlight-implementing-bittorrent-with-jon-gjengset&quot;&gt;Spotlight: Implementing BitTorrent with Jon Gjengset&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;28&#x2F;BitTorrent-Youtube-Livestream.webp&quot; alt=&quot;Implementing BitTorrent with Jon Gjengset&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%; border:0&quot;&gt;
&lt;p&gt;In a recent live stream, Jon Gjengset took on an intriguing challenge: implementing a &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jf_ddGnum_4&amp;t=23s&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;BitTorrent client in Rust from scratch&lt;&#x2F;a&gt; and the &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jSTkEPPiULs&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;2nd part&lt;&#x2F;a&gt;. The challenge, part of CodeCrafters&#x27; test-guided learning platform, serves as an excellent example of hands-on learning. Jon navigates through various aspects of BitTorrent and Rust, from decoding bencoded strings to peer handshakes, all while providing invaluable insights.&lt;&#x2F;p&gt;
&lt;p&gt;This is not a sponsored segment; Jon genuinely believes in this learning path and wants to share it with the Rust community. He even managed to troubleshoot and fix some off-by-one errors live, demonstrating the real-world challenges that come with coding. If you are interested in following along, you can find the final code changes on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jonhoo&#x2F;codecrafters-bittorrent-rust&quot; target=&quot;_blank&quot;&gt;Jon&#x27;s GitHub&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re a Rust newbie or a seasoned developer, this stream is a treasure trove of learning and inspiration. And if you decide to take up the challenge yourself, do not forget to use the &lt;a href=&quot;https:&#x2F;&#x2F;app.codecrafters.io&#x2F;join?via=Rust-Trends&quot; target=&quot;_blank&quot;&gt;referral link to sign up for CodeCrafters!&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sammwyy&#x2F;mindns&quot; target=&quot;_blank&quot;&gt;MinDNS&lt;&#x2F;a&gt;: Minimal DNS server written in Rust&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;simeg&#x2F;eureka&quot; target=&quot;_blank&quot;&gt;Eureka&lt;&#x2F;a&gt;: CLI idea notepad made in Rust&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>27 - Navigating the Rust vs Go Debate &amp; Unveiling Alacritty</title>
          <pubDate>Wed, 11 Oct 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/navigating-the-rust-vs-go-debate/</link>
          <guid>https://rust-trends.com/newsletter/navigating-the-rust-vs-go-debate/</guid>
          <description xml:base="https://rust-trends.com/newsletter/navigating-the-rust-vs-go-debate/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Empowering your code, one Rust byte at a time.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Greetings, Rust Enthusiasts and Innovators! 🚀&lt;&#x2F;p&gt;
&lt;p&gt;You&#x27;ve just opened another edition of Rust Trends, the bi-weekly newsletter that keeps you ahead of the curve in the ever-evolving world of Rust programming. Our mission? To empower you with the latest insights, tutorials, and breakthroughs that are shaping the Rust ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;🛠 From Novice to Ninja: Whether you&#x27;re just starting your Rust journey or you&#x27;re a seasoned developer, we&#x27;ve got you covered. Our handpicked resources range from beginner-friendly guides to advanced topics that will challenge even the most experienced Rustaceans.&lt;&#x2F;p&gt;
&lt;p&gt;🌍 Community-Centric: We believe that the strength of Rust lies in its vibrant community. That&#x27;s why we also feature interviews, open-source projects, and community events that you won&#x27;t want to miss.&lt;&#x2F;p&gt;
&lt;p&gt;🔥 Stay Ahead, Stay Informed: In a tech landscape that&#x27;s changing by the nanosecond, staying updated is crucial. With Rust Trends, you&#x27;re not just keeping up—you&#x27;re staying ahead.&lt;&#x2F;p&gt;
&lt;p&gt;So, without further ado, let&#x27;s dive into this edition&#x27;s wealth of Rust wisdom. Ready to explore? Let&#x27;s code!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-vs-go-a-comparison-of-two-popular-programming-languages&quot;&gt;Rust vs Go: A Comparison of Two Popular Programming Languages&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;27&#x2F;Rust-vs-Go.webp&quot; alt=&quot;Rust vs Go&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;Rust and Go are two of the most popular programming languages in 2023, both with a strong focus on performance, concurrency, and reliability. However, they also have different design goals, features, and use cases, making them suitable for different kinds of projects. In this article, we will compare Rust and Go in terms of syntax, speed, safety, and ecosystem, and see which language is better for your needs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;syntax&quot;&gt;Syntax&lt;&#x2F;h3&gt;
&lt;p&gt;Rust and Go have very different syntaxes, reflecting their different philosophies and trade-offs. Rust has a complex and expressive syntax, with many keywords, symbols, and concepts to learn. Rust&#x27;s syntax is designed to enforce memory safety and prevent common errors at compile time, but it also comes with a steep learning curve and a longer development time if you do not include the debugging time. Go, on the other hand, has a simple and minimalist syntax, with few keywords, symbols, and concepts to learn. Go&#x27;s syntax is designed to be easy to read and write, with a focus on simplicity and clarity. Go also has a fast compilation time and a built-in code formatter, similar to Rust&#x27;s rustfmt, making it easier to develop and maintain code.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;speed&quot;&gt;Speed&lt;&#x2F;h3&gt;
&lt;p&gt;Both Rust and Go are fast languages, with a compiled and statically typed nature. However, Rust has an edge over Go in terms of speed and efficiency, thanks to its zero-cost abstractions and low-level control. Rust allows you to write high-level code without sacrificing performance, as it optimizes away any unnecessary overhead at compile time. Rust also gives you direct access to the hardware and memory management, allowing you to fine-tune your code for optimal performance. Go, on the other hand, has some limitations in terms of speed and efficiency, due to its garbage collector. Go&#x27;s garbage collector frees up memory automatically, but it also introduces some runtime overhead and latency. Go only recently added &lt;a href=&quot;https:&#x2F;&#x2F;go.dev&#x2F;blog&#x2F;intro-generics&quot; target=&quot;_blank&quot;&gt;generics since 1.18&lt;&#x2F;a&gt;, which were already longer available in Rust.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;safety&quot;&gt;Safety&lt;&#x2F;h3&gt;
&lt;p&gt;Both Rust and Go are safe languages, with a strong emphasis on reliability and correctness. However, they achieve safety in different ways. Rust guarantees memory safety through its &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;stable&#x2F;book&#x2F;ch04-01-what-is-ownership.html#what-is-ownership&quot; target=&quot;_blank&quot;&gt;ownership&lt;&#x2F;a&gt; system and borrow checker, which ensure that there are no dangling pointers, data races, or memory leaks in your code. Rust also supports other safety features, such as algebraic data types (enums), pattern matching (match), error handling (Result), and testing (#[test]). Go ensures safety through its garbage collector, which manages memory automatically and prevents memory leaks. Go also supports other safety features, such as interfaces (interface{}), defer statements (defer), error handling (error), and testing (testing).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;ecosystem&quot;&gt;Ecosystem&lt;&#x2F;h3&gt;
&lt;p&gt;Both Rust and Go have a rich and growing ecosystem of libraries, frameworks, tools, and communities. However, they also have different strengths and weaknesses in their ecosystems. Rust has a more diverse and innovative ecosystem, with many cutting-edge projects in various domains such as web development (&lt;a href=&quot;https:&#x2F;&#x2F;actix.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Actix&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;SergioBenitez&#x2F;Rocket&quot; target=&quot;_blank&quot;&gt;Rocket&lt;&#x2F;a&gt;), game development (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;amethyst&#x2F;amethyst&quot; target=&quot;_blank&quot;&gt;Amethyst&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bevyengine&#x2F;bevy&quot; target=&quot;_blank&quot;&gt;Bevy&lt;&#x2F;a&gt;), machine learning (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-ml&#x2F;linfa&quot; target=&quot;_blank&quot;&gt;Linfa&lt;&#x2F;a&gt;, &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;smartcorelib&#x2F;smartcore&quot; target=&quot;_blank&quot;&gt;Smartcore&lt;&#x2F;a&gt;), blockchain (Substrate), embedded systems (&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;newsletter&#x2F;are-we-embedded-yet&#x2F;&quot;&gt;Are we Embedded yet?&lt;&#x2F;a&gt; ), etc. Rust also has a strong community of developers who are passionate about the language and its vision. However, Rust also has a more fragmented and unstable ecosystem, with many libraries still in early stages of development or undergoing frequent changes. Go has a more mature and stable ecosystem, with many well-established projects in various domains such as web development (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;gin-gonic&#x2F;gin&quot; target=&quot;_blank&quot;&gt;Gin&lt;&#x2F;a&gt;), microservices (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-kit&#x2F;kit&quot; target=&quot;_blank&quot;&gt;Go-kit&lt;&#x2F;a&gt;), cloud computing (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;kubernetes&#x2F;kubernetes&quot; target=&quot;_blank&quot;&gt;Kubernetes&lt;&#x2F;a&gt;), distributed systems (etcd), etc. Go also has a large community of developers who are pragmatic about the language and its trade-offs. However, Go also has a more conservative and homogeneous ecosystem, with fewer innovations or experiments in the language or its libraries.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Rust and Go are both excellent programming languages that offer high performance, concurrency, and reliability. However, they also have different trade-offs that make them suitable for different kinds of projects. Rust is more suitable for low-latency and high-speed applications that require fine-grained control over the hardware and memory management. Rust is also more suitable for complex applications that benefit from expressive syntax and zero-cost abstractions. Go is more suitable for backend applications and web systems that require fast development time and easy scalability. Go is also more suitable for simple applications that benefit from minimalist syntax and garbage collection.&lt;&#x2F;p&gt;
&lt;p&gt;To read more about Rust vs Go check the links below:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.imaginarycloud.com&#x2F;blog&#x2F;rust-vs-go&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Vs. Go: Differences And Similarities - Imaginary Cloud&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.shuttle.rs&#x2F;blog&#x2F;2023&#x2F;09&#x2F;27&#x2F;rust-vs-go-comparison&quot; target=&quot;_blank&quot;&gt;Rust Vs Go: A Hands-On Comparison - Shuttle.rs&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.trio.dev&#x2F;blog&#x2F;golang-vs-rust&quot; target=&quot;_blank&quot;&gt;Golang vs. Rust: Which Language To Choose In 2023? | Trio Developers&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;alacritty-the-fast-cross-platform-terminal-emulator-built-in-rust&quot;&gt;Alacritty: The Fast, Cross-Platform Terminal Emulator Built in Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;27&#x2F;alacritty-term.webp&quot; alt=&quot;Alacritty Terminal emulator in Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%; border:0&quot;&gt;
&lt;h3 id=&quot;what-is-a-terminal-emulator&quot;&gt;What is a Terminal Emulator?&lt;&#x2F;h3&gt;
&lt;p&gt;A terminal emulator is a software application that replicates the functionality of a traditional computer terminal. It provides a command-line interface for the user to interact with the operating system. Terminal emulators are essential tools for developers, system administrators, and anyone who needs to execute commands in a shell environment.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;alacritty&#x2F;alacritty&quot; target=&quot;_blank&quot;&gt;Alacritty&lt;&#x2F;a&gt; is a modern terminal emulator that aims to provide a high-performance user experience. Built using the Rust programming language, it leverages the power of OpenGL to render terminal content swiftly. Alacritty is cross-platform, supporting BSD, Linux, macOS, and Windows, making it a versatile choice for developers.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;features&quot;&gt;Features&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;High Performance&lt;&#x2F;strong&gt;: Alacritty uses OpenGL for rendering, which significantly boosts its performance. It even has benchmarks to back up its speed claims.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Extensive Configuration&lt;&#x2F;strong&gt;: While it comes with sensible defaults, Alacritty allows for a wide range of customization through its configuration files.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cross-Platform&lt;&#x2F;strong&gt;: Whether you&#x27;re on BSD, Linux, macOS, or Windows, Alacritty has got you covered.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;why-choose-alacritty&quot;&gt;Why Choose Alacritty?&lt;&#x2F;h3&gt;
&lt;p&gt;While Alacritty may not have every feature found in other terminal emulators, it focuses on doing one thing exceptionally well: providing a fast and efficient terminal experience. It leaves features like tabs and splits to window managers or terminal multiplexers, sticking to its philosophy of high performance and configurability.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion-1&quot;&gt;Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;Alacritty is a robust, fast, and customizable terminal emulator that stands out for its performance and cross-platform support. If you&#x27;re looking for a terminal that aligns well with the ethos of the Rust language—safety, speed, and concurrency—Alacritty is worth a try.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;10&#x2F;05&#x2F;Rust-1.73.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.73.0 stable is out&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;reddit.com&#x2F;r&#x2F;rust&#x2F;s&#x2F;hxDiWai9B6&quot; target=&quot;_blank&quot;&gt;InfluxDB switched from Go to Rust.&lt;&#x2F;a&gt; The CTO from InfluxDB is reacting on why.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2023&#x2F;10&#x2F;bare-metal-rust-in-android.html&quot; target=&quot;_blank&quot;&gt;Bare metal Rust in Android&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>26 - Rust 101: The Best Learning Resources Compiled</title>
          <pubDate>Wed, 27 Sep 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-101-the-best-learning-resources-compiled/</link>
          <guid>https://rust-trends.com/newsletter/rust-101-the-best-learning-resources-compiled/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-101-the-best-learning-resources-compiled/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Master Rust with top free resources. From the official Rust Book to hands-on Exercism exercises and expert YouTube tutorials, level up your skills.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome, Rust Innovators!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to another enriching edition of Rust Trends, your go-to source for all things Rust. As the tech landscape continues to evolve at breakneck speed, we&#x27;re here to ensure you stay at the forefront.&lt;&#x2F;p&gt;
&lt;p&gt;This edition is a treasure trove of learning resources, designed to elevate your Rust journey from novice to expert. We&#x27;ve handpicked tutorials, courses, and guides that will help you master everything from the basics to the intricacies of Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re a seasoned Rustacean looking to brush up on your skills or a curious beginner ready to dive into the Rust ecosystem, this edition has something for everyone.&lt;&#x2F;p&gt;
&lt;p&gt;So, let&#x27;s not keep you waiting any longer — Ready, set, Rust!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-101-the-best-learning-resources-compiled&quot;&gt;Rust 101: The Best Learning Resources Compiled&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;26&#x2F;crab-on-books.webp&quot; alt=&quot;Crab on book learning Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;p&gt;The official way of learning Rust is with &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;&quot; target=&quot;_blank&quot;&gt;The Rust Book&lt;&#x2F;a&gt;,  The &lt;a href=&quot;https:&#x2F;&#x2F;rust-book.cs.brown.edu&#x2F;&quot; target=&quot;_blank&quot;&gt;interactive version of The Rust Book&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Ready to level up your Rust skills? Dive into &lt;a href=&quot;https:&#x2F;&#x2F;exercism.org&#x2F;tracks&#x2F;rust&quot; target=&quot;_blank&quot;&gt;Exercism&#x27;s Rust track&lt;&#x2F;a&gt; for hands-on exercises that will take you from novice to pro!&lt;&#x2F;p&gt;
&lt;p&gt;Get started with &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rustlings&quot; target=&quot;_blank&quot;&gt;Rustlings&lt;&#x2F;a&gt;, a collection of small exercises to get you familiar with Rust&#x27;s syntax and features! Follow the README.md in the Rustlings GitHub repository to get started.&lt;&#x2F;p&gt;
&lt;p&gt;Want to learn Rust through practical examples? Check out &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;rust-by-example&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust by Example&lt;&#x2F;a&gt;, the official guide that teaches you Rust one example at a time!&lt;&#x2F;p&gt;
&lt;p&gt;Looking for engaging video tutorials on Rust? Subscribe to &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@letsgetrusty&quot; target=&quot;_blank&quot;&gt;Let&#x27;s Get Rusty&lt;&#x2F;a&gt; on YouTube for insightful lessons and deep dives into Rust programming!&lt;&#x2F;p&gt;
&lt;p&gt;Seeking an in-depth understanding of Rust? Google&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;google.github.io&#x2F;comprehensive-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Comprehensive Rust Guide&lt;&#x2F;a&gt; offers a thorough walkthrough, covering everything from basics to advanced topics.&lt;&#x2F;p&gt;
&lt;p&gt;Struggling with &lt;a href=&quot;https:&#x2F;&#x2F;blog.burntsushi.net&#x2F;rust-error-handling&#x2F;&quot; target=&quot;_blank&quot;&gt;error handling in Rust&lt;&#x2F;a&gt;? BurntSushi&#x27;s blog post offers a comprehensive guide to mastering this crucial aspect of Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;Want to write Rust code that&#x27;s not just correct, but also efficient? Dive into &lt;a href=&quot;https:&#x2F;&#x2F;www.lurklurk.org&#x2F;effective-rust&#x2F;cover.html&quot; target=&quot;_blank&quot;&gt;Effective Rust&lt;&#x2F;a&gt; by David Drysdale for best practices and advanced techniques.&lt;&#x2F;p&gt;
&lt;p&gt;Interested in deep dives into Rust&#x27;s complexities? &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@jonhoo&quot; target=&quot;_blank&quot;&gt;Jon Gjengset&#x27;s YouTube channel&lt;&#x2F;a&gt; offers expert-level discussions and tutorials on advanced Rust topics.&lt;&#x2F;p&gt;
&lt;p&gt;Unlock your coding potential with &lt;a href=&quot;https:&#x2F;&#x2F;www.codingame.com&#x2F;&quot; target=&quot;_blank&quot;&gt;CodinGame&lt;&#x2F;a&gt;, a platform offering fun and challenging games to improve your programming skills, including Rust. Whether you&#x27;re a beginner or an expert, CodinGame provides an engaging way to learn and practice coding in multiple languages.&lt;&#x2F;p&gt;
&lt;p&gt;The course material from Ferrous Systems is available on GitHub, including both the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ferrous-systems&#x2F;rust-training&quot; target=&quot;_blank&quot;&gt;training content&lt;&#x2F;a&gt; (which can be built as an mdBook by following the instructions in the README.md) and the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ferrous-systems&#x2F;rust-exercises&quot; target=&quot;_blank&quot;&gt;exercises&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Best of all, each of the resources mentioned above is completely free, making it easier than ever to enhance your Rust programming skills without breaking the bank.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;must-read-books-for-every-rust-learner&quot;&gt;Must-Read Books for Every Rust Learner&lt;&#x2F;h2&gt;
&lt;p&gt;For those looking to take their Rust skills into the real world, &lt;a href=&quot;https:&#x2F;&#x2F;www.amazon.nl&#x2F;Zero-Production-Rust-introduction-development&#x2F;dp&#x2F;B0BHLDMFDQ?&amp;_encoding=UTF8&amp;tag=rusttrends-21&amp;linkCode=ur2&amp;linkId=d074011f743e2f6dc6786055de915428&amp;camp=247&amp;creative=1211&quot; target=&quot;_blank&quot;&gt;Zero To Production In Rust&lt;&#x2F;a&gt; is a comprehensive guide that I personally find incredibly in-depth and useful.&lt;&#x2F;p&gt;
&lt;p&gt;Advance your Rust programming skills to a professional level with Jon Gjengset&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;www.amazon.nl&#x2F;-&#x2F;en&#x2F;Jon-Gjengset&#x2F;dp&#x2F;1718501854?&amp;_encoding=UTF8&amp;tag=rusttrends-21&amp;linkCode=ur2&amp;linkId=718c34eb5872fdd313846efbe3efd646&amp;camp=247&amp;creative=1211&quot; target=&quot;_blank&quot;&gt;Rust for Rustaceans&lt;&#x2F;a&gt;. The book offers a comprehensive exploration of advanced topics like concurrency, unsafe code, and API design, providing practical insights for building robust and complex Rust applications.&lt;&#x2F;p&gt;
&lt;p&gt;The book links include an affiliate link, which helps us keep Rust Trends content accessible to everyone.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Improved ls command, called &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;eza-community&#x2F;eza&quot; target=&quot;_blank&quot;&gt;eza&lt;&#x2F;a&gt;, written in Rust&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;lencx&#x2F;ChatGPT&quot; target=&quot;_blank&quot;&gt;ChatGPT on your desktop&lt;&#x2F;a&gt; powered by &lt;a href=&quot;https:&#x2F;&#x2F;tauri.app&#x2F;&quot; target=&quot;_blank&quot;&gt;Tauri&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>25 - Navigating Database Crates, Configuration, and UUIDs in Rust</title>
          <pubDate>Wed, 13 Sep 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/navigating-database-crates-configuration-and-uuids-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/navigating-database-crates-configuration-and-uuids-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/navigating-database-crates-configuration-and-uuids-in-rust/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Unlock the latest Rust insights! Dive into database crate choices, explore configuration management, and discover the power of UUIDs in Rust.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rust Enthusiasts!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome back to your bi-weekly digest of Rust Trends. In a world where technology is ever-changing, we&#x27;re committed to keeping you ahead of the curve.&lt;&#x2F;p&gt;
&lt;p&gt;This edition is packed with actionable insights: from making the right database crate choices to working with config files and generating uuids for your next project.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re a Rust veteran or a newcomer eager to learn, we&#x27;ve curated content that caters to all.&lt;&#x2F;p&gt;
&lt;p&gt;So, without further ado, let&#x27;s get started!&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;choosing-a-rust-database-crate-in-2023-diesel-sqlx-or-tokio-postgres&quot;&gt;Choosing a Rust Database Crate in 2023: Diesel, SQLx, or Tokio-Postgres?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;database-crates-diesel-sqlx-tokio-postgress&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;25&#x2F;database-crate.webp&quot; alt=&quot;Database crates&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you love Rust as much as I do, you know it&#x27;s not just about the language—it is about the rich ecosystem that comes with it. When you are coding next big web app, you are going to need to interact with a database. But which crate should you choose for optimal performance, safety, and ease of use?&lt;&#x2F;p&gt;
&lt;p&gt;We have just published a comprehensive blog post that could be your ultimate guide in making this crucial decision. We dive into &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;, &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, and &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt;, breaking down their features, advantages, and when you might want to pick one over the others.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-should-you-care-about-picking-the-right-database-crate&quot;&gt;Why Should You Care About Picking the Right Database Crate?&lt;&#x2F;h3&gt;
&lt;p&gt;You might wonder, &quot;It&#x27;s just a database library; how critical can it be?&quot; Well, your choice can significantly influence not only the performance of your application but also how smoothly your development process goes.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-our-blog-covers&quot;&gt;What Our Blog Covers&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Type Safety:&lt;&#x2F;strong&gt; If you mess up a SQL query, the best-case scenario is a runtime error; the worst case is corrupting your data. Our post talks about how each crate approaches compile-time SQL verification.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Performance:&lt;&#x2F;strong&gt; Every millisecond counts, especially when you&#x27;re scaling up. Learn which crates are optimized for speed.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Developer Productivity:&lt;&#x2F;strong&gt; Not all APIs are created equal. We look at how these libraries can impact your coding experience and long-term maintenance.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Scalability:&lt;&#x2F;strong&gt; As your app grows, so will your database needs. We discuss features like connection pooling and async support.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;database-crates-diesel-sqlx-tokio-postgress&#x2F;&quot; target=&quot;_blank&quot;&gt;Read the Full Rust Trends Blog Post Here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Want to make the best database crate choice for your next Rust project? Check out our blog post to get the insights you need.Hope you find it helpful!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;simplifying-configuration-in-rust-from-single-files-to-the-config-crate&quot;&gt;Simplifying Configuration in Rust: From Single Files to the config Crate&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mehcode&#x2F;config-rs&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;25&#x2F;configuration.webp&quot; alt=&quot;Configuration in Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;In the Rust ecosystem, managing configuration can be as simple or as complex as your project requires. For those just getting started or working on smaller projects, using a single JSON or TOML file for configuration is often sufficient. This straightforward approach can be easily implemented with crates like serde_json or toml. For a step-by-step guide on this simpler method, you can refer to this &lt;a href=&quot;https:&#x2F;&#x2F;dev.to&#x2F;imajindevon&#x2F;why-do-we-need-configuration-creating-and-handling-configuration-files-in-rust-4a46&quot; target=&quot;_blank&quot;&gt;Dev.to article&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;However, as your project grows in complexity, you might find yourself needing more advanced features like layered configurations, environment variable support, and multiple file format compatibility. This is where the config crate comes into play. Developed by mehcode, this crate is a layered configuration system designed specifically for Rust applications. It offers robust support for different file extensions like JSON, TOML, YAML, INI, RON, JSON5 and a plethora of additional features that go beyond a single-file approach.&lt;&#x2F;p&gt;
&lt;p&gt;For a comprehensive look at the config crate and its capabilities, check out its &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mehcode&#x2F;config-rs&quot; target=&quot;_blank&quot;&gt;GitHub repository&lt;&#x2F;a&gt; or a &lt;a href=&quot;https:&#x2F;&#x2F;blog.logrocket.com&#x2F;configuration-management-in-rust-web-services&#x2F;&quot; target=&quot;_blank&quot;&gt;LogRocket Article on the config crate&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re looking for simplicity or a feature-rich configuration system, Rust has you covered.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;spotlight-on-uuid-rs-the-go-to-crate-for-uuids-in-rust&quot;&gt;Spotlight on uuid-rs: The Go-To Crate for UUIDs in Rust&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;uuid-rs&#x2F;uuid&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;25&#x2F;distributed-systems.webp&quot; alt=&quot;UUIDs in distributed systems&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-is-uuid-rs&quot;&gt;What is uuid-rs?&lt;&#x2F;h3&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;uuid-rs&#x2F;uuid&quot; target=&quot;_blank&quot;&gt;uuid-rs&lt;&#x2F;a&gt; crate is a Rust library designed for generating and parsing Universally Unique Identifiers (UUIDs). A UUID is a 128-bit value that serves as a unique identifier, &lt;strong&gt;often used in databases&lt;&#x2F;strong&gt;, distributed systems, and network protocols. The crate is highly popular, with over 846 stars on GitHub and is used by more than 174,000 projects.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Version Support:&lt;&#x2F;strong&gt; Generate UUIDs using various versions, including random-based (v4).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fast Parsing:&lt;&#x2F;strong&gt; Quickly parse UUIDs from string literals or validate them at compile-time.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Feature Flags:&lt;&#x2F;strong&gt; Customize the crate&#x27;s functionality with feature flags like fast-rng for faster random number generation.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;why-use-uuid-rs&quot;&gt;Why Use uuid-rs?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Database Keys:&lt;&#x2F;strong&gt; For generating unique keys in a database, UUIDs are often a better choice than sequential integers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Distributed Systems:&lt;&#x2F;strong&gt; If you&#x27;re building a distributed system where entities need unique identifiers without a central authority, uuid-rs is invaluable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Network Protocols:&lt;&#x2F;strong&gt; In scenarios where each packet or request needs a unique identifier, UUIDs can be extremely useful.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The uuid-rs crate is a robust and efficient solution for working with UUIDs in Rust. Its flexibility and ease of use make it a must-have for any Rust developer dealing with unique identifiers.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;thenewstack.io&#x2F;how-to-write-your-own-email-server-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;How to Write Your Own Email Server in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;typst.app&#x2F;&quot; target=&quot;_blank&quot;&gt;Typst a modern successor to LaTeX&lt;&#x2F;a&gt; in Rust (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;typst&#x2F;typst&quot; target=&quot;_blank&quot;&gt;Github&lt;&#x2F;a&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mCaptcha&#x2F;mCaptcha&quot; target=&quot;_blank&quot;&gt;Proof of Work concept for Captchas in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Choosing a Rust Database Crate in 2023: Diesel, SQLx, or Tokio-Postgres?</title>
          <pubDate>Tue, 12 Sep 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/database-crates-diesel-sqlx-tokio-postgress/</link>
          <guid>https://rust-trends.com/posts/database-crates-diesel-sqlx-tokio-postgress/</guid>
          <description xml:base="https://rust-trends.com/posts/database-crates-diesel-sqlx-tokio-postgress/">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;Since its launch in 2015, Rust has established itself as a major player in the programming world, consistently topping charts as one of the most beloved languages among developers. Its promise of performance, robustness, and safety has made it a top choice for everything from system-level software to web development.&lt;&#x2F;p&gt;
&lt;p&gt;One of the pillars in application and web development is the ability to interact seamlessly with databases. Whether you are working on a small-scale utility tool, a web API, or an enterprise-grade application, odds are you&#x27;ll need to store, retrieve, or manipulate data in a database. That is where Rust&#x27;s rich ecosystem of libraries, commonly referred to as &#x27;crates&#x27;, comes into play.&lt;&#x2F;p&gt;
&lt;p&gt;In this article we focus on three crates that standout for an relational SQL database: &lt;code&gt;Diesel&lt;&#x2F;code&gt;, &lt;code&gt;SQLx&lt;&#x2F;code&gt;, and &lt;code&gt;Tokio-Postgres&lt;&#x2F;code&gt;. Each of these offers a distinct set of features, optimizations, and trade-offs, making them popular for different scenarios and requirements.&lt;&#x2F;p&gt;
&lt;p&gt;If you are a Rust developer wondering which database crate to choose for your next project, you&#x27;ve come to the right place. This article will dive into these three top contenders, comparing them on various factors such as:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Ease of use&lt;&#x2F;li&gt;
&lt;li&gt;Performance&lt;&#x2F;li&gt;
&lt;li&gt;Features&lt;&#x2F;li&gt;
&lt;li&gt;Community support&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;By the end, you&#x27;ll have the information you need to make an informed decision for your next Rust project.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-database-crates-matter&quot;&gt;Why Database Crates Matter&lt;&#x2F;h2&gt;
&lt;p&gt;In today&#x27;s interconnected, data-driven world, the database is often considered the backbone of any software application. As developers, our interaction with databases is so frequent that the quality of the tools we use for this interaction can significantly impact not just the development process, but also the performance and reliability of the application itself. That is why choosing the database crate is crucial.&lt;&#x2F;p&gt;
&lt;img src=&quot;..&#x2F;..&#x2F;newsletter&#x2F;25&#x2F;database-crate.webp&quot; alt=&quot;Database crate&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h3 id=&quot;importance-in-application-development&quot;&gt;Importance in Application Development&lt;&#x2F;h3&gt;
&lt;h4 id=&quot;type-safety&quot;&gt;Type Safety&lt;&#x2F;h4&gt;
&lt;p&gt;Rust is known for its strong emphasis on type safety and is therefore &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch03-02-data-types.html&quot;&gt;statically typed&lt;&#x2F;a&gt;, and a great database crate extends this safety. A mistake in a database query can lead to runtime errors or, worse, data corruption. &lt;strong&gt;Compile-time SQL verification&lt;&#x2F;strong&gt; minimizes these risks, and speed up the feedback cycle.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;performance&quot;&gt;Performance&lt;&#x2F;h4&gt;
&lt;p&gt;Database operations can often be a bottleneck in application performance. A well-optimized database library can make efficient use of resources, enabling your application to run faster and handle more users. This is what we expect from a Rust application.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;developer-productivity&quot;&gt;Developer Productivity&lt;&#x2F;h4&gt;
&lt;p&gt;A great database library provides a clean, understandable API that aligns with the language&#x27;s idioms. This not only makes it easier to write code but also makes it more maintainable.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;scalability&quot;&gt;Scalability&lt;&#x2F;h4&gt;
&lt;p&gt;As your application grows, so does the complexity of your database operations. Quality database libraries offer features like connection pooling (i.e. process that maintains a set of open connections to a database, handing them out for repeated use), batch operations, and async support, which are vital for scalability.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;ecosystem-compatibility&quot;&gt;Ecosystem Compatibility&lt;&#x2F;h4&gt;
&lt;p&gt;The ideal database crate should play well with other libraries and frameworks you may be using. For instance, a web framework like &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;actix&#x2F;examples&quot;&gt;Actix has a great set of code examples&lt;&#x2F;a&gt;, for both &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; and &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt;, making your development process smoother.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;common-challenges-in-database-interaction&quot;&gt;Common Challenges in Database Interaction&lt;&#x2F;h3&gt;
&lt;h4 id=&quot;connection-management&quot;&gt;Connection Management&lt;&#x2F;h4&gt;
&lt;p&gt;Managing database connections effectively is a common challenge. Opening too many can stress the database, while too few can lead to underutilization. As developers we need to strike a balance and the crate should assist in this.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;query-complexity&quot;&gt;Query Complexity&lt;&#x2F;h4&gt;
&lt;p&gt;Queries can become increasingly complex. A bad library can make these queries hard to maintain and debug, leading to reduced performance and increased likelihood of errors.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;database-migrations&quot;&gt;Database Migrations&lt;&#x2F;h4&gt;
&lt;p&gt;Managing schema changes or transitioning from one database system to another can be cumbersome. Some database crates offer built-in support for migrations, easing this process.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;asynchronous-programming&quot;&gt;Asynchronous Programming&lt;&#x2F;h4&gt;
&lt;p&gt;(Web) Applications frequently rely on asynchronous I&#x2F;O operations. While Rust’s async&#x2F;await syntax is powerful, not all database libraries support it, which can lead to complications in asynchronous applications.&lt;&#x2F;p&gt;
&lt;p&gt;In the sections that follow, we will take a closer look at how &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;, &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, and &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; measure up against these challenges and needs, giving you the insights you require to make the best choice for your project.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;diesel-a-safe-extensible-orm-and-query-builder-for-rust&quot;&gt;Diesel: A safe, extensible ORM and Query Builder for Rust&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;Diesel&lt;&#x2F;strong&gt; is a safe, extensible Object-Relational Mapping (ORM) and query-building library for Rust. The library takes full advantage of Rust&#x27;s strong typing and ownership model, making it easier for developers to write robust database applications without worrying about SQL injection vulnerabilities or other common pitfalls. As an ORM, &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; provides abstractions that allow developers to interact with a database in a more idiomatic Rust manner, rather than raw SQL queries.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DSL for Query Generation&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Diesel&lt;&#x2F;strong&gt; provides a Domain Specific Language (DSL) for creating SQL queries. This DSL allows you to construct queries in a type-safe, Rust-idiomatic way, reducing errors and increasing code readability. Note that the DSL of &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; is only relevant when working with &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;. It must be said that the DSL makes it more convenient to write &lt;a href=&quot;http:&#x2F;&#x2F;diesel.rs&#x2F;guides&#x2F;composing-applications.html&quot;&gt;reusable components&lt;&#x2F;a&gt;. Besides the DSL you can always fallback to Raw SQL. Note that it takes some time to get familiarized with DSL.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Strong Type System&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;One of &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;&#x27;s major highlights is its strong type system that ties into Rust&#x27;s native type system. This adds an additional layer of safety, ensuring that you are less likely to make mistakes when writing queries.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Asynchronous Support (with diesel-async)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;While &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; itself is synchronous, you can integrate it with the async runtime by using third-party extensions like &lt;code&gt;diesel-async&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compatibility with Connection Poolers&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;While the library itself doesn&#x27;t offer built-in connection pooling, it is designed to work seamlessly with third-party connection poolers like &lt;code&gt;bb8&lt;&#x2F;code&gt; and &lt;code&gt;deadpool&lt;&#x2F;code&gt;. This makes it flexible and adaptable to various use-cases.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Migration Tools&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Diesel&lt;&#x2F;strong&gt;&#x27;s robust type system and built-in migration support make it a good fit for data migration tasks.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;community-and-ecosystem&quot;&gt;Community and Ecosystem&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Diesel&lt;&#x2F;strong&gt; enjoys a robust community and is one of the more mature database libraries in the Rust ecosystem. It has a high number of contributors and maintainers (see &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;database-crates-diesel-sqlx-tokio-postgress&#x2F;#diesel-overview&quot;&gt;Diesel overview&lt;&#x2F;a&gt;), and it is widely used in both open-source and commercial projects. The ecosystem around &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; is rich, with various plugins and extensions to support features like JSON serialization and integration with other popular Rust libraries.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;sqlx-the-rust-sql-toolkit&quot;&gt;SQLx: The Rust SQL Toolkit&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;SQLx&lt;&#x2F;strong&gt; is a modern and versatile SQL client for Rust, offering a unique feature set geared towards maintainability and robustness. One of its standout features is the support for compile-time SQL verification. This means that your SQL queries are checked at compile-time for syntax and even some level of semantic correctness, reducing the runtime errors related to database queries.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features-1&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Asynchronous Support&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SQLx&lt;&#x2F;strong&gt; is natively designed with asynchronous programming in mind, fully supporting Rust&#x27;s &lt;code&gt;async&#x2F;await&lt;&#x2F;code&gt; syntax. This makes it an ideal choice for modern web applications that require non-blocking IO.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Raw SQL with Compile-time Checks&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Unlike many ORMs that try to abstract SQL away, &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; embraces it. You write raw SQL queries, which are then verified at compile-time for correctness. This combines the power and flexibility of SQL with the safety guarantees of Rust.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Built-in Connection Pooling&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Connection management is simplified with &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;&#x27;s built-in support for database connection pooling called &lt;code&gt;PgPool&lt;&#x2F;code&gt;, saving you from having to integrate third-party pooling libraries and optimizing database interactions for you.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;community-and-ecosystem-1&quot;&gt;Community and Ecosystem&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;SQLx&lt;&#x2F;strong&gt; has rapidly gained traction in the Rust community, thanks to its modern approach to database interaction. Its GitHub repository is active, with contributions from a variety of developers (see &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;database-crates-diesel-sqlx-tokio-postgress&#x2F;#sqlx-overview&quot;&gt;SQLx overview&lt;&#x2F;a&gt;). There is also an active community around it, discussing improvements, best practices, and providing help and support. The ecosystem around &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; is growing.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tokio-postgres-a-native-asynchronous-postgresql-client&quot;&gt;Tokio-postgres: A native, asynchronous PostgreSQL client.&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; is a Rust library designed for working directly with PostgreSQL databases in an asynchronous manner. Unlike &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; and &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, which offer various levels of abstraction and ORM capabilities, &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; is oriented towards a more direct, low-level interaction with the database. This makes it a suitable choice for those who require fine-grained control over their SQL queries and database operations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features-2&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Asynchronous Support&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Fully integrated with the Tokio runtime, &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; is designed for asynchronous database operations. This enables highly concurrent, non-blocking applications.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Raw SQL Execution&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; allows for raw SQL query execution, giving developers maximum control over their database interactions.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compatibility with Connection Poolers&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;While the library itself doesn&#x27;t offer built-in connection pooling, it is designed to work seamlessly with third-party connection poolers like &lt;code&gt;bb8&lt;&#x2F;code&gt; and &lt;code&gt;deadpool&lt;&#x2F;code&gt;. This makes it flexible and adaptable to various use-cases.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;community-and-ecosystem-2&quot;&gt;Community and Ecosystem&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; benefits from being a part of the larger Tokio ecosystem, which is widely adopted for asynchronous programming in Rust. The library has a somewhat specialized use-case, but it is well-maintained and has a solid community of users and contributors. Although not as extensive as the ecosystems around &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; or &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, there is community support for extending its functionalities through third-party libraries and poolers.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;feature-matrix-comparison&quot;&gt;Feature Matrix Comparison&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;&#x2F;th&gt;&lt;th&gt;&lt;code&gt;diesel&lt;&#x2F;code&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;code&gt;sqlx&lt;&#x2F;code&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;code&gt;tokio-postgres&lt;&#x2F;code&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Asynchronous support&lt;&#x2F;td&gt;&lt;td&gt;Yes with &lt;code&gt;diesel-async&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Synchronous support&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;td&gt;Yes (&lt;code&gt;postgres&lt;&#x2F;code&gt;)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;ORM (Object Relational Mapping)&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Compile-time SQL verification&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Raw SQL execution&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Connection pooling&lt;&#x2F;td&gt;&lt;td&gt;Via &lt;code&gt;bb8&lt;&#x2F;code&gt; or &lt;code&gt;deadpool&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Built-in&lt;&#x2F;td&gt;&lt;td&gt;Via &lt;code&gt;bb8&lt;&#x2F;code&gt; or &lt;code&gt;deadpool&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Macros for query generation&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Supports multiple databases&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No (PostgreSQL specific)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Integrated migration tools&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;Yes&lt;&#x2F;td&gt;&lt;td&gt;No&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Query Interface&lt;&#x2F;td&gt;&lt;td&gt;DSL &amp;amp; Raw SQL&lt;&#x2F;td&gt;&lt;td&gt;Raw SQL with Macros&lt;&#x2F;td&gt;&lt;td&gt;Raw SQL&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;In this context:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DSL (Domain Specific Language)&lt;&#x2F;strong&gt;: &lt;code&gt;diesel&lt;&#x2F;code&gt; offers a Rust-based DSL to construct queries, which allows for more type safety and is more idiomatic to Rust. You can also use raw SQL if desired.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Raw SQL with Macros&lt;&#x2F;strong&gt;: &lt;code&gt;sqlx&lt;&#x2F;code&gt; primarily uses raw SQL but provides macros to enable compile-time verification.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Raw SQL&lt;&#x2F;strong&gt;: &lt;code&gt;tokio-postgres&lt;&#x2F;code&gt; and &lt;code&gt;postgres&lt;&#x2F;code&gt; are more focused on raw SQL without much abstraction.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It is worth noting that while the above mentions the primary query interfaces for each crate, many of these libraries offer a blend of features, and developers can often choose between raw SQL or more abstracted query generation based on their needs.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;making-your-choice&quot;&gt;Making Your Choice&lt;&#x2F;h2&gt;
&lt;p&gt;After diving into each of these prominent Rust database crates, the next step is to decide which one aligns most closely with your project’s specific needs. While all three libraries offer a robust set of features, the &lt;strong&gt;best&lt;&#x2F;strong&gt; choice will depend on a variety of factors, such as performance requirements, type safety, level of control, and the kind of community support you&#x27;re looking for.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;performance-1&quot;&gt;Performance&lt;&#x2F;h3&gt;
&lt;p&gt;If your primary concern is high-performance, non-blocking IO, you might lean towards &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; or &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt;, both of which are designed for asynchronous operations. &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;, while robust and feature-rich, operates synchronously by default, although there are third-party extensions for async support.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;type-safety-1&quot;&gt;Type Safety&lt;&#x2F;h3&gt;
&lt;p&gt;When it comes to type safety, &lt;strong&gt;Diesel&lt;&#x2F;strong&gt;&#x27;s strong integration with Rust&#x27;s type system offers arguably the most robust compile-time checks. &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; also provides compile-time SQL verification, making it a good choice for projects where type safety is a priority.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;level-of-control&quot;&gt;Level of Control&lt;&#x2F;h3&gt;
&lt;p&gt;If you need fine-grained control over your SQL queries and prefer to work at a lower level, &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; might be the way to go. &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; and &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; provide various levels of abstraction and ORM capabilities, which could be seen as either an advantage or a limitation, depending on your project&#x27;s needs.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;community-support&quot;&gt;Community Support&lt;&#x2F;h3&gt;
&lt;p&gt;Community engagement is another crucial factor. A well-supported library often translates into better documentation, more third-party extensions, and quicker help when you run into issues. &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; and &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; have larger communities and more active repositories compared to &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt;. However, &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; benefits from being part of the larger Tokio ecosystem, which is itself widely adopted.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;project-maturity&quot;&gt;Project Maturity&lt;&#x2F;h3&gt;
&lt;p&gt;Finally, consider the maturity of your selected library. More established projects like &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; have been battle-tested in a variety of environments, which may give you more confidence in their stability. &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, while newer, has rapidly gained maturity and traction. &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt;, being more specialized, might not have the same breadth of usage but is stable and reliable for its intended use-cases.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Choosing a database library is often a trade-off between various factors such as performance, type safety, level of abstraction, and community support. Your project&#x27;s specific needs will guide your choice, and fortunately, whether you choose &lt;strong&gt;Diesel&lt;&#x2F;strong&gt; for its powerful ORM capabilities, &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; for its asynchronous support and type safety, or &lt;strong&gt;Tokio-Postgres&lt;&#x2F;strong&gt; for low-level control, you&#x27;re in good hands.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;my-two-cents&quot;&gt;My Two Cents&lt;&#x2F;h3&gt;
&lt;p&gt;My go-to choice has to be &lt;strong&gt;SQLx&lt;&#x2F;strong&gt;, and for good reason. Not only does it offer native support for asynchronous programming, but it also comes with built-in connection pooling, elevating its efficiency to the next level. Moreover &lt;strong&gt;SQLx&lt;&#x2F;strong&gt; has compile-time SQL verification, ensuring that your queries are bulletproof before they even hit the runtime. To top it all off, it seamlessly integrates with the Actix Web framework, making it an unparalleled tool in my development arsenal.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;diesel-overview&quot;&gt;Diesel overview&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Snapshot Date:&lt;&#x2F;strong&gt; September 8, 2023&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GitHub Repository:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;diesel-rs&#x2F;diesel&quot;&gt;Diesel GitHub&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stars:&lt;&#x2F;strong&gt; 10900+&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Contributors:&lt;&#x2F;strong&gt; 308&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Documentation:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;diesel.rs&#x2F;guides&#x2F;&quot;&gt;Diesel Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;sqlx-overview&quot;&gt;SQLx overview&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Snapshot Date:&lt;&#x2F;strong&gt; September 8, 2023&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GitHub Repository:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;launchbadge&#x2F;sqlx&quot;&gt;SQLx GitHub&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stars:&lt;&#x2F;strong&gt; 9700+&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Contributors:&lt;&#x2F;strong&gt; 322&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Documentation:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;sqlx&#x2F;latest&#x2F;sqlx&#x2F;&quot;&gt;SQLx Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;tokio-postgres-overview&quot;&gt;Tokio-postgres overview&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Snapshot Date:&lt;&#x2F;strong&gt; September 8, 2023&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GitHub Repository:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sfackler&#x2F;rust-postgres&quot;&gt;Tokio-postgres GitHub&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stars:&lt;&#x2F;strong&gt; 3000+&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Contributors:&lt;&#x2F;strong&gt; 120&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Documentation:&lt;&#x2F;strong&gt; &lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;tokio-postgres&#x2F;latest&#x2F;tokio_postgres&#x2F;&quot;&gt;Tokio-postgres Documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>24 - Navigating the Evolving Landscape of Rust: Your Biweekly Compass</title>
          <pubDate>Wed, 30 Aug 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/navigating-the-evolving-landscape-of-rust-your-biweekly-compass/</link>
          <guid>https://rust-trends.com/newsletter/navigating-the-evolving-landscape-of-rust-your-biweekly-compass/</guid>
          <description xml:base="https://rust-trends.com/newsletter/navigating-the-evolving-landscape-of-rust-your-biweekly-compass/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Our newsletter offers the latest updates, best practices, and community insights. From new guidelines on Cargo.lock files to optimized compile times.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rust Enthusiasts!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to another enriching edition of Rust Trends, your biweekly compass for navigating the ever-evolving Rust ecosystem. As Rust continues to solidify its position in the world of programming, we are here to keep you updated on the latest developments, best practices, and community dialogues.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue, we delve deep into the much-discussed change in Rust&#x27;s guidance on committing &lt;code&gt;Cargo.lock&lt;&#x2F;code&gt; files — a shift that reflects the language&#x27;s growing maturity and diverse user base. We also bring you insights on how Rust compile times are optimized, a topic that resonates with every Rustacean out there.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you are a seasoned developer or a newcomer eager to explore, we have curated content that caters to all levels of expertise. So, fasten your seat belts as we embark on another exciting journey through the Rust universe!&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s get started!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;updated-best-practices-for-committing-cargo-lock-files&quot;&gt;Updated Best Practices for Committing Cargo.lock Files&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;08&#x2F;29&#x2F;committing-lockfiles.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;24&#x2F;cargo-lock-file.webp&quot; alt=&quot;Cargo.lock file&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The Rust Cargo team has updated its guidance on committing &lt;code&gt;Cargo.lock&lt;&#x2F;code&gt; files. Previously, the team advised committing this file for packages with binaries but not for libraries. The new recommendation is more flexible, suggesting that developers should do what is best for their individual projects. This change is aimed at accommodating the evolving needs of the Rust community, especially as the language gains mainstream adoption. The &lt;code&gt;cargo new&lt;&#x2F;code&gt; command will also no longer ignore &lt;code&gt;Cargo.lock&lt;&#x2F;code&gt; for libraries starting from nightly-2023-08-24. The team emphasizes the importance of regular testing against the latest dependencies, regardless of whether the &lt;code&gt;Cargo.lock&lt;&#x2F;code&gt; file is committed.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The update addresses several issues:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Background:&lt;&#x2F;strong&gt; The old guidelines helped maintain high quality in Rust&#x27;s package ecosystem but also had downsides like making it harder to bisect code history.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Why the Change:&lt;&#x2F;strong&gt; Rust&#x27;s growing mainstream adoption and the need for a better onboarding experience for new developers have necessitated this change.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Wider Ecosystem:&lt;&#x2F;strong&gt; Advances in CI and tools like Dependabot have provided alternative ways to manage dependencies, making the old guidance less relevant.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For more details and to provide feedback, you can read the full blog post on the &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;08&#x2F;29&#x2F;committing-lockfiles.html&quot; target=&quot;_blank&quot;&gt;Rust Blog&lt;&#x2F;a&gt; and the updated &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;nightly&#x2F;cargo&#x2F;faq.html#why-have-cargolock-in-version-control&quot; target=&quot;_blank&quot;&gt;Cargo Book&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;speeding-up-rust-compile-times-insights-from-august-2023&quot;&gt;Speeding Up Rust Compile Times: Insights from August 2023&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;nnethercote.github.io&#x2F;2023&#x2F;08&#x2F;25&#x2F;how-to-speed-up-the-rust-compiler-in-august-2023.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;24&#x2F;compiler.webp&quot; alt=&quot;Rust compiler&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The Rust programming language is known for its focus on safety and performance, but compile times can sometimes be a bottleneck for developers. &lt;strong&gt;Nicholas Nethercote&lt;&#x2F;strong&gt;, a contributor to the Rust compiler, recently published an &lt;a href=&quot;https:&#x2F;&#x2F;nnethercote.github.io&#x2F;2023&#x2F;08&#x2F;25&#x2F;how-to-speed-up-the-rust-compiler-in-august-2023.html&quot; target=&quot;_blank&quot;&gt;article&lt;&#x2F;a&gt; detailing various improvements made to speed up the Rust compiler as of August 2023. Here&#x27;s a summary of key takeaways to help you speed up your
Rust compile times.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Hash Algorithm Update for Incremental Compilation&lt;&#x2F;strong&gt;
In the realm of incremental compilation, a notable enhancement was introduced through pull request &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;pull&#x2F;107925&quot; target=&quot;_blank&quot;&gt;#107925&lt;&#x2F;a&gt;. This update modified the hashing algorithm responsible for detecting changes in code fragments. Specifically, the algorithm was transitioned from SipHash-2-4 to SipHash-1-3. As a result, the average wall-time for compilation was reduced by 1.63%. This optimization is particularly beneficial for incremental builds, where the hash function plays a crucial role in identifying code changes that require recompilation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;LLVM Version Upgrades Boost Rust Compiler Efficiency&lt;&#x2F;strong&gt;
The Low-Level Virtual Machine (LLVM) plays a pivotal role in the Rust compiler&#x27;s back-end, handling tasks like code optimization and generation. Two separate pull requests (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;pull&#x2F;109474&quot; target=&quot;_blank&quot;&gt;#109474&lt;&#x2F;a&gt; and an update to LLVM 17) were responsible for upgrading the LLVM version used by the Rust compiler. These upgrades led to a reduction in average wall-time by 1.19% and 1.91%, respectively. The enhancements are attributed to both the increased efficiency of LLVM itself and the superior quality of the code it produces.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Streamlining Code Checks for Faster Compilation&lt;&#x2F;strong&gt;
Lints in Rust are essentially code checks that help identify issues like syntax errors or potential bugs. A specific update, made through pull request &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rust&#x2F;pull&#x2F;113734&quot; target=&quot;_blank&quot;&gt;#113734&lt;&#x2F;a&gt;, optimized the way these code checks (lints) are executed. This led to a 1.05% reduction in the average time it takes to compile a project. Just like some of the other updates, this one also particularly benefits incremental builds, where only parts of the code that have changed are recompiled.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Enhancements in Codegen Units and Parallelization&lt;&#x2F;strong&gt;
The Rust compiler has been fine-tuned to better utilize parallelization, particularly in its back-end operations. A minimum size for Codegen Units (CGUs) has been introduced in non-incremental builds. This change helps in reducing both peak memory (up to 19%) usage and the size of the compiled binary. However, the author points out that perfecting this aspect is challenging, given the multiple metrics that sometimes conflict with each other.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;&#x2F;strong&gt;
While the improvements may seem incremental, they add up over time and contribute to a more efficient compilation process. The article also touches on other areas like runtime benchmarking and future improvements, making it a comprehensive read for anyone interested in Rust compiler performance.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;navigating-the-serde-controversy-a-lesson-in-community-trust-and-security-for-rust-developers&quot;&gt;Navigating the Serde Controversy: A Lesson in Community Trust and Security for Rust Developers&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.bleepingcomputer.com&#x2F;news&#x2F;security&#x2F;rust-devs-push-back-as-serde-project-ships-precompiled-binaries&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;24&#x2F;serde-serialization.webp&quot; alt=&quot;Serde serialization&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;What Happened:&lt;&#x2F;strong&gt;
The Serde project, a popular serialization library in Rust, faced backlash from the community for shipping precompiled binaries. The issue arose when the project&#x27;s maintainers decided to include precompiled binaries in the package, which is against the norms of the Rust ecosystem. The binaries were intended to speed up the build process, but they raised concerns about security and trust within the community. The situation led to a heated debate, with some developers even considering forking the project (source: &lt;a href=&quot;https:&#x2F;&#x2F;www.bleepingcomputer.com&#x2F;news&#x2F;security&#x2F;rust-devs-push-back-as-serde-project-ships-precompiled-binaries&#x2F;&quot; target=&quot;_blank&quot;&gt;BleepingComputer&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;How It Was Recovered:&lt;&#x2F;strong&gt;
The Serde project took immediate action to address the concerns raised by the community. An issue was opened on GitHub to discuss the matter transparently. They acknowledged the community&#x27;s concerns and decided to revert the changes that included precompiled binaries. The issue was marked as resolved, and the project moved forward with its regular development cycle, ensuring to maintain the trust and security standards expected in the Rust ecosystem (&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;serde-rs&#x2F;serde&#x2F;issues&#x2F;2538&quot; target=&quot;_blank&quot;&gt;GitHub Issue #2538&lt;&#x2F;a&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;The proposed forking by some community members would have been a poor outcome, leading to fragmentation and potential confusion. Personally, I am very pleased with how the situation was handled and resolved, reinforcing the importance of community trust and collaboration.&lt;&#x2F;p&gt;
&lt;p&gt;This incident serves as a lesson for the Rust community about the importance of maintaining trust and security while making changes that could potentially affect many projects.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Release Note:&lt;&#x2F;strong&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;serde-rs&#x2F;serde&#x2F;releases&#x2F;tag&#x2F;v1.0.184&quot; target=&quot;_blank&quot;&gt;Serde release v1.0.184&lt;&#x2F;a&gt;: Restore from-source serde_derive build on all platforms - eventually we&#x27;d like to use a first-class precompiled macro if such a thing becomes supported by cargo &#x2F; crates.io&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;08&#x2F;24&#x2F;Rust-1.72.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.72.0 stable is out&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.shuttle.rs&#x2F;blog&#x2F;2023&#x2F;08&#x2F;23&#x2F;rust-web-framework-comparison&quot; target=&quot;_blank&quot;&gt;Best Rust Web Frameworks to Use in 2023&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.phylum.io&#x2F;rust-malware-staged-on-crates-io&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Malware Staged on Crates.io&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;We are thrilled to have you as part of our growing community of Rust enthusiasts! If you found value in this newsletter, don&#x27;t keep it to yourself — share it with your network and let&#x27;s grow the Rust community together.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;👉 Take Action Now:&lt;&#x2F;strong&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Share:&lt;&#x2F;strong&gt; Forward this email to share this newsletter with your colleagues and friends.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Engage:&lt;&#x2F;strong&gt; Have thoughts or questions? Reply to this email.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subscribe:&lt;&#x2F;strong&gt; Not a subscriber yet? Click &lt;a href=&quot;&#x2F;signup&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; to never miss an update from Rust Trends.&lt;br&gt;&lt;br&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;🔗 Stay Connected:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with our editor, Bob Peters, on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt; for more Rust insights and updates.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>23 - Rust Revelations: Python Bridges, Survey Insights, and Macro Magic</title>
          <pubDate>Wed, 16 Aug 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-revelations-python-bridges-survey-insights-and-macro-magic/</link>
          <guid>https://rust-trends.com/newsletter/rust-revelations-python-bridges-survey-insights-and-macro-magic/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-revelations-python-bridges-survey-insights-and-macro-magic/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Discover Rust Trends! Dive into Python-Rust synergy, 2022 Rust Survey highlights, and macro insights. Stay ahead with Rust&#x27;s latest advancements.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rust Enthusiasts!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to another edition of &#x27;Rust Trends&#x27;! As the world of programming evolves, so does our passion for bringing you the latest insights, techniques, and breakthroughs.&lt;&#x2F;p&gt;
&lt;p&gt;In this issue, we explore the powerful synergy between Python and Rust, delve into the results of the 2022 Rust Survey, and demystify the world of macros.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you&#x27;re a seasoned Rustacean or just starting your journey, there&#x27;s something here for everyone.&lt;&#x2F;p&gt;
&lt;p&gt;Let&#x27;s dive in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;bridging-python-and-rust-a-synergy-of-power-and-performance&quot;&gt;Bridging Python and Rust: A Synergy of Power and Performance&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;3664124&#x2F;how-to-use-rust-with-python-and-python-with-rust.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;23&#x2F;rust-python.webp&quot; alt=&quot;Rust and Python&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Python is renowned for its simplicity and versatility in the programming world, while Rust is celebrated for its speed and memory safety. But what happens when you bring these two titans together? The fusion of Python&#x27;s ease-of-use with Rust&#x27;s performance offers a promising landscape for developers seeking the best of both worlds.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.infoworld.com&#x2F;article&#x2F;3664124&#x2F;how-to-use-rust-with-python-and-python-with-rust.html&quot; target=&quot;_blank&quot;&gt;Infoworld&#x27;s comprehensive guide&lt;&#x2F;a&gt; highlights the seamless integration of Rust within Python applications and the benefits of this convergence. Whether you&#x27;re looking to harness Rust&#x27;s capabilities within your Python scripts or invoking the vast Python ecosystem from Rust, this article has got you covered.&lt;&#x2F;p&gt;
&lt;p&gt;Dive in to discover practical methods, code snippets, and insights to elevate your next project by leveraging the combined strengths of Python and Rust!&lt;&#x2F;p&gt;
&lt;p&gt;Other resources are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;PyO3&#x2F;pyo3&quot; target=&quot;_blank&quot;&gt;PyO3 github repository&lt;&#x2F;a&gt; and its &lt;a href=&quot;https:&#x2F;&#x2F;pyo3.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;user guide&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;DpUlfWP_gtg&quot; target=&quot;_blank&quot;&gt;Let&#x27;s Get Rusty: Calling Rust code from Python&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;demystifying-macros-with-cargo-expand&quot;&gt;Demystifying Macros with Cargo Expand&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;rust-macros-revealed&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;23&#x2F;transformers.webp&quot; alt=&quot;Rust Macros Revealed!&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Ever wondered about the actual code generated by Rust macros? Enter &lt;code&gt;cargo expand&lt;&#x2F;code&gt;. This invaluable tool permits you to glimpse the outcome of macro expansions, revealing the intricate, and at times boilerplate-intensive, code that&#x27;s produced.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Dive into Rust Macros:&lt;&#x2F;strong&gt; For an  exploration, don&#x27;t miss our latest blog post: &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;posts&#x2F;rust-macros-revealed&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Macros Revealed!&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Crafting Your Own Macros:&lt;&#x2F;strong&gt; Intrigued to craft macros of your own? Dive deeper with the &lt;a href=&quot;https:&#x2F;&#x2F;blog.logrocket.com&#x2F;macros-in-rust-a-tutorial-with-examples&#x2F;&quot; target=&quot;_blank&quot;&gt;comprehensive guide on creating macros&lt;&#x2F;a&gt; in Rust. Or for a visual learner&#x27;s treat, check out this insightful YouTube tutorial on &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;KsJHlqULpO4&quot; target=&quot;_blank&quot;&gt;Declarative Rust macros&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;crWfcA064is&quot; target=&quot;_blank&quot;&gt;Procedural Rust macros&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;2022-annual-rust-survey-results-highlights&quot;&gt;2022 Annual Rust Survey Results Highlights&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;08&#x2F;07&#x2F;Rust-Survey-2023-Results.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;23&#x2F;rust-work.webp&quot; alt=&quot;Are you using Rust at work?&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;For the 6th year in a row, the Rust Project conducted a survey on the Rust programming language with 9,433 total survey completions. Here are the key highlights.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Participation:&lt;&#x2F;strong&gt; In 2022, Rust saw 9,433 total survey completions, a significant increase in survey views, and a slight decrease in total responses.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Community Growth:&lt;&#x2F;strong&gt; The survey was offered in 11 languages, indicating the growing global nature of the Rust community. The majority of respondents were from the United States, Germany, and China.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Rust Usage:&lt;&#x2F;strong&gt; Over 90% of respondents identified as Rust users. 47% use Rust daily, and 30% can write production-ready code in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Professional Use:&lt;&#x2F;strong&gt; 29.7% of respondents use Rust for most of their coding work, a 51.8% increase from the previous year. The top reasons for using Rust include writing &lt;strong&gt;&quot;bug-free software&quot;&lt;&#x2F;strong&gt;, performance, and security.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Future Concerns:&lt;&#x2F;strong&gt; 26% are concerned about proper support for Rust developers, 38% worry about Rust becoming too complex, and 34% have no worries about Rust&#x27;s future.&lt;&#x2F;p&gt;
&lt;p&gt;For a detailed analysis and more insights, check out the full post: &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;08&#x2F;07&#x2F;Rust-Survey-2023-Results.html&quot; target=&quot;_blank&quot;&gt;2022 Annual Rust Survey Results&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Like any programming language, Rust has room for refinement. Yet, I truly believe its potential is vast and its future is promising, with a wide array of applications on the horizon.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Looking for a Rust PodCast, what about &lt;a href=&quot;https:&#x2F;&#x2F;rustacean-station.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Rustacean-Station&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.scanner.dev&#x2F;getting-started-with-serverless-rust-in-aws-lambda&#x2F;&quot; target=&quot;_blank&quot;&gt;Getting started with serverless Rust in AWS Lambda&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Push yourself to explore the uncharted territories of Rust. Venturing beyond your usual limits can substantially enrich your evolution as a coder.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Rust Macros Revealed!</title>
          <pubDate>Sun, 06 Aug 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/rust-macros-revealed/</link>
          <guid>https://rust-trends.com/posts/rust-macros-revealed/</guid>
          <description xml:base="https://rust-trends.com/posts/rust-macros-revealed/">&lt;img src=&quot;..&#x2F;..&#x2F;newsletter&#x2F;23&#x2F;transformers.webp&quot; alt=&quot;Rust Macros Revealed!&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;
&lt;h2 id=&quot;macros-in-rust&quot;&gt;Macros in Rust&lt;&#x2F;h2&gt;
&lt;p&gt;In the world of programming, repetition is often seen as a bad thing. Rust macros provide a way to avoid repetitive code, allowing you to define reusable code templates. Unlike functions, macros don&#x27;t operate on values; instead, they operate on the code itself.&lt;&#x2F;p&gt;
&lt;p&gt;Macros in Rust work like meta-programming. They are a way to define reusable chunks of code that get &quot;expanded&quot; or &quot;transformed&quot; into more detailed code at compile time. This is like giving the compiler a recipe to generate specific chunks of code on the fly.&lt;&#x2F;p&gt;
&lt;p&gt;For instance, you might have used the &lt;code&gt;println!()&lt;&#x2F;code&gt; macro. The &lt;code&gt;!&lt;&#x2F;code&gt; indicates it&#x27;s a macro. With macros, you can achieve functionalities that functions can&#x27;t offer, like variadic arguments or pattern-based code generation. Another example of a macros are expressions like &lt;code&gt;#[tokio::main]&lt;&#x2F;code&gt;, called an attribute macro.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-use-cargo-expand&quot;&gt;Why Use &lt;code&gt;cargo expand&lt;&#x2F;code&gt;?&lt;&#x2F;h3&gt;
&lt;p&gt;When working with macros, you might wonder what the actual code generated by these macros looks like. This is where &lt;code&gt;cargo expand&lt;&#x2F;code&gt; comes in handy. It allows you to see the result of all the macro expansions, giving you a peek into the detailed, often boilerplate-heavy, code that gets generated.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-cargo-expand-with-your-code&quot;&gt;Using &lt;code&gt;cargo expand&lt;&#x2F;code&gt; with Your Code&lt;&#x2F;h3&gt;
&lt;p&gt;Consider the simple &lt;a href=&quot;https:&#x2F;&#x2F;actix.rs&#x2F;&quot;&gt;Actix Web server&lt;&#x2F;a&gt; code provided below:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;actix_web::{web, App, HttpServer, Responder, HttpResponse};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;health_check&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; impl Responder {
&lt;&#x2F;span&gt;&lt;span&gt;   HttpResponse::Ok()
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;tokio&lt;&#x2F;span&gt;&lt;span&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Result&amp;lt;(), std::io::Error&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;     HttpServer::new(|| {
&lt;&#x2F;span&gt;&lt;span&gt;        App::new()
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;route&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;health_check&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, web::get().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to&lt;&#x2F;span&gt;&lt;span&gt;(health_check))
&lt;&#x2F;span&gt;&lt;span&gt;    })
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;bind&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;127.0.0.1:8000&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)?
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;run&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    .await
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, the &lt;code&gt;#[tokio::main]&lt;&#x2F;code&gt; is an attribute macro provided by the &lt;a href=&quot;https:&#x2F;&#x2F;tokio.rs&#x2F;&quot;&gt;Tokio crate&lt;&#x2F;a&gt;. Tokio is an asynchronous runtime for the Rust programming language. It provides the building blocks needed for writing network applications. The attribute macro sets up the necessary boilerplate to run asynchronous code in the main function. But what does this boilerplate look like?&lt;&#x2F;p&gt;
&lt;p&gt;To find out, you&#x27;d first need to install &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dtolnay&#x2F;cargo-expand&quot;&gt;cargo expand&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo install cargo-expand
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, in the root of your Rust project, run:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo expand
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output will be the code after all macros, including &lt;code&gt;#[tokio::main]&lt;&#x2F;code&gt;, have been expanded. This &quot;expanded&quot; version will show you the underlying boilerplate introduced by the macro, revealing all the magic that happens behind the scenes.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;#![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;feature&lt;&#x2F;span&gt;&lt;span&gt;(prelude_import)]
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;prelude_import&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;std::prelude::rust_2021::*;
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;macro_use&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;extern crate&lt;&#x2F;span&gt;&lt;span&gt; std;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;actix_web::{web, App, HttpServer, Responder, HttpResponse};
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;health_check&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; impl Responder {
&lt;&#x2F;span&gt;&lt;span&gt;    HttpResponse::Ok()
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;main&lt;&#x2F;span&gt;&lt;span&gt;() -&amp;gt; Result&amp;lt;(), std::io::Error&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; body = async {
&lt;&#x2F;span&gt;&lt;span&gt;        HttpServer::new(|| {
&lt;&#x2F;span&gt;&lt;span&gt;                App::new().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;route&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;health_check&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, web::get().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;to&lt;&#x2F;span&gt;&lt;span&gt;(health_check))
&lt;&#x2F;span&gt;&lt;span&gt;            })
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;bind&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;127.0.0.1:8000&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)?
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;run&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;            .await
&lt;&#x2F;span&gt;&lt;span&gt;    };
&lt;&#x2F;span&gt;&lt;span&gt;    #[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;allow&lt;&#x2F;span&gt;&lt;span&gt;(clippy::expect_used, clippy::diverging_sub_expression)]
&lt;&#x2F;span&gt;&lt;span&gt;    {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;tokio::runtime::Builder::new_multi_thread()
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;enable_all&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;build&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Failed building the Runtime&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)
&lt;&#x2F;span&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;block_on&lt;&#x2F;span&gt;&lt;span&gt;(body);
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s break down the transformation that has occurred due to the #[tokio::main] macro:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Async Block&lt;&#x2F;strong&gt;: The entire async part of the original main function has been encapsulated inside an async block, and this block is assigned to the &lt;code&gt;body&lt;&#x2F;code&gt; variable:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; body = async { ... };
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This &lt;code&gt;body&lt;&#x2F;code&gt; variable holds the asynchronous logic, but by itself, it doesn&#x27;t execute anything. It merely describes the asynchronous computation.&lt;&#x2F;p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;&lt;strong&gt;Tokio Runtime Setup&lt;&#x2F;strong&gt;: For the asynchronous code to be executed, a runtime is required. This runtime manages the low-level details of task scheduling, IO, etc. The expanded code sets up this runtime explicitly:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;tokio::runtime::Builder::new_multi_thread()
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;enable_all&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;build&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;expect&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Failed building the Runtime&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here, a multi-threaded Tokio runtime is being built with all features enabled.&lt;&#x2F;p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;&lt;strong&gt;Blocking on Async&lt;&#x2F;strong&gt;: The following line:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;block_on&lt;&#x2F;span&gt;&lt;span&gt;(body);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Tells the runtime to execute the async block (&lt;code&gt;body&lt;&#x2F;code&gt;) and block the current thread until this asynchronous computation has finished.&lt;&#x2F;p&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;&lt;strong&gt;Clippy Allowance&lt;&#x2F;strong&gt;: The line &lt;code&gt;#[allow(clippy::expect_used, clippy::diverging_sub_expression)]&lt;&#x2F;code&gt; is a hint to the Clippy linting tool to ignore certain potential warnings about the subsequent code. This is added to ensure the generated code doesn&#x27;t trigger linting warnings.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;summary&quot;&gt;Summary:&lt;&#x2F;h3&gt;
&lt;p&gt;In essence, the &lt;code&gt;#[tokio::main]&lt;&#x2F;code&gt; macro abstracts away the complexities of setting up the Tokio runtime and managing the transition between synchronous and asynchronous code. By using this macro, developers can focus on the core asynchronous logic without getting bogged down by boilerplate. The expanded version reveals all the &quot;magic&quot; that happens behind the scenes to make the async main function work seamlessly.&lt;&#x2F;p&gt;
&lt;p&gt;In essence, &lt;code&gt;cargo expand&lt;&#x2F;code&gt; offers an invaluable tool for anyone diving deep into Rust&#x27;s powerful macro system, helping developers demystify and understand the inner workings of their code. You can try it your self on &lt;code&gt;#[derive()]&lt;&#x2F;code&gt; Traits. By adding &lt;code&gt;#[derive(Debug)]&lt;&#x2F;code&gt; to one of your custom structs or enums. Use &lt;code&gt;cargo expand&lt;&#x2F;code&gt; to see what code is generated, and then use the &lt;code&gt;println!(&quot;{:?}&quot;, instance_of_your_struct);&lt;&#x2F;code&gt; to print the debug representation. Similarly, explore with &lt;code&gt;#[derive(PartialEq)]&lt;&#x2F;code&gt; and test it by comparing two instances of your struct with &lt;code&gt;==&lt;&#x2F;code&gt; and &lt;code&gt;!=&lt;&#x2F;code&gt;. Happy coding!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>22 - Exploring Rust: From Simulations to Safety Standards</title>
          <pubDate>Wed, 02 Aug 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/exploring-rust-from-simulations-to-safety-standards/</link>
          <guid>https://rust-trends.com/newsletter/exploring-rust-from-simulations-to-safety-standards/</guid>
          <description xml:base="https://rust-trends.com/newsletter/exploring-rust-from-simulations-to-safety-standards/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Dive into the world of Rust programming, exploring its applications in simulations, safety-critical systems, and parallel computing.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rust Enthusiasts!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to another edition of &quot;Rust Trends&quot;, your biweekly update on the dynamic world of Rust programming. In this issue, we delve into the fascinating applications of Rust, from creating an ant colony simulation to ensuring the highest safety standards in electronic systems with Rust and Ferrocene. We also explore the power of parallel computing with Rayon, a data-parallelism library for Rust.&lt;&#x2F;p&gt;
&lt;p&gt;So, sit back, grab your favorite beverage, and let&#x27;s embark on this exciting exploration of Rust&#x27;s capabilities and advancements. Whether you&#x27;re a seasoned Rustacean or a curious newcomer, there&#x27;s something for everyone in this edition. Let&#x27;s get started!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-ants-colony-simulation-a-unique-pet-project&quot;&gt;Rust Ants Colony Simulation: A Unique Pet Project&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bones-ai&#x2F;rust-ants-colony-simulation&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;22&#x2F;giant_ant_simulation.webp&quot; alt=&quot;Rust Ants Colony Simulation&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;
In the world of Rust programming, there&#x27;s always something new and exciting to explore. Today, we&#x27;re introducing a fascinating pet project (pun intended) that&#x27;s been buzzing in the Rust community: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bones-ai&#x2F;rust-ants-colony-simulation&quot; target=&quot;_blank&quot;&gt;the Rust Ants Colony Simulation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;This project, is an ant colony simulation implemented in Rust. Despite its current inefficiency, which allows it to handle only about 500 ants on an older laptop, it&#x27;s a captivating exploration of Rust&#x27;s capabilities. The simulation is built using Rust and the &lt;a href=&quot;https:&#x2F;&#x2F;bevyengine.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Bevy game engine&lt;&#x2F;a&gt;, showcasing the versatility of Rust in different domains.&lt;&#x2F;p&gt;
&lt;p&gt;You can find the &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;98pUSZAM_7M&quot; target=&quot;_blank&quot;&gt;timelapse video on Youtube&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Thought-Provoking Insights&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rust in Game Development:&lt;&#x2F;strong&gt; Rust&#x27;s performance characteristics make it a suitable choice for game development. The use of the Bevy game engine in this project is a testament to this. How might Rust evolve as a language for game development in the future?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Simulation Efficiency:&lt;&#x2F;strong&gt; The current implementation can handle about 500 ants. This opens up discussions about optimization in Rust. What strategies could be employed to increase the efficiency of such a simulation?&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;ferrocene-elevating-safety-standards-with-the-rust-compiler&quot;&gt;Ferrocene: Elevating Safety Standards with the Rust Compiler&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;ferrous-systems.com&#x2F;ferrocene&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;22&#x2F;ferrocene_logo_horizontal.webp&quot; alt=&quot;Ferrocene&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;
In the realm of coding, safety is paramount, especially when it comes to applications like autonomous driving systems, medical equipment, or industrial control systems. Enter &lt;a href=&quot;https:&#x2F;&#x2F;ferrous-systems.com&#x2F;ferrocene&#x2F;&quot; target=&quot;_blank&quot;&gt;Ferrocene&lt;&#x2F;a&gt;, a unique variant of the Rust compiler, designed with a singular purpose - to ensure the highest level of safety in electrical and electronic systems.&lt;&#x2F;p&gt;
&lt;p&gt;Ferrocene is not just any Rust compiler. It&#x27;s currently undergoing a rigorous qualification process under two globally recognized standards - ISO 26262 and IEC 61508. ISO 26262 is a critical standard for the functional safety of electrical and electronic systems in production automobiles, a key requirement for applications like autonomous vehicle software. IEC 61508, on the other hand, is a comprehensive standard for functional safety of electrical, electronic, and programmable electronic safety-related systems, essential for industries like healthcare and manufacturing.&lt;&#x2F;p&gt;
&lt;p&gt;For two years, the Ferrocene project has been in development, meticulously crafted to meet these stringent safety standards. The result? A release candidate that&#x27;s currently available and poised to make a significant impact in the field of safety-critical applications, from medical devices that monitor patient health to industrial systems that control complex manufacturing processes.&lt;&#x2F;p&gt;
&lt;p&gt;The ultimate goal of Ferrocene is to provide a version of the Rust compiler that not only meets but surpasses these safety standards. It&#x27;s about elevating the bar for safety in the digital world, ensuring that safety-critical applications can rely on a robust and secure foundation. With Ferrocene, the future of safe coding in critical applications looks promising.&lt;&#x2F;p&gt;
&lt;p&gt;Join Ferrous Systems announcement party on &lt;a href=&quot;https:&#x2F;&#x2F;www.eventbrite.com&#x2F;e&#x2F;a-decade-of-rust-with-ferrous-systems-tickets-680492891557?aff=oddtdtcreator&quot; target=&quot;_blank&quot;&gt;October 4th, 2023, online&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;fearless-concurrency-with-rayon&quot;&gt;Fearless concurrency with Rayon&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rayon-rs&#x2F;rayon&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;22&#x2F;Robots-working-parallel.webp&quot; alt=&quot;Robots working in parallel just like Rayon&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;
Rayon is a powerful data-parallelism library for Rust that allows developers to easily convert sequential computations into parallel ones. It&#x27;s incredibly lightweight and ensures data-race freedom, providing a safe environment for parallel execution.&lt;&#x2F;p&gt;
&lt;p&gt;The beauty of Rayon lies in its simplicity. To convert a sequential iterator into a parallel one, you typically just replace your &lt;code&gt;iter()&lt;&#x2F;code&gt; call with &lt;code&gt;par_iter()&lt;&#x2F;code&gt;, and Rayon handles the rest. This makes it straightforward to leverage the power of parallel computing in your Rust applications.&lt;&#x2F;p&gt;
&lt;p&gt;Rayon also offers the &lt;code&gt;join&lt;&#x2F;code&gt; and &lt;code&gt;scope&lt;&#x2F;code&gt; functions for creating parallel tasks manually, providing more flexibility when needed. Moreover, it supports &lt;code&gt;custom thread pools&lt;&#x2F;code&gt;, giving you even more control over your parallel computations.&lt;&#x2F;p&gt;
&lt;p&gt;One of the key features of Rayon is its guarantee of data-race freedom. This means that if your code compiles, it will typically behave the same way it did before, but faster. Parallel iterators, in particular, are guaranteed to produce the same results as their sequential counterparts.&lt;&#x2F;p&gt;
&lt;p&gt;To use Rayon, you simply add it as a dependency in your Cargo.toml file and bring the necessary traits into scope using the Rayon prelude. Rayon currently requires Rustc 1.59.0 or greater.&lt;&#x2F;p&gt;
&lt;p&gt;Rayon also supports WebAssembly through an adapter and some project configuration. This allows you to bring the power of Rayon to web applications.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Key Takeaways:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Rayon allows easy conversion of sequential computations into parallel ones in Rust.&lt;&#x2F;li&gt;
&lt;li&gt;It guarantees data-race freedom, ensuring safe parallel execution.&lt;&#x2F;li&gt;
&lt;li&gt;Rayon supports custom thread pools and manual task creation for greater flexibility.&lt;&#x2F;li&gt;
&lt;li&gt;It&#x27;s compatible with WebAssembly, extending its use to web applications.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Thought-Provoking Questions:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;How can the simplicity of converting sequential iterators to parallel ones with Rayon change the way we approach programming in Rust?&lt;&#x2F;li&gt;
&lt;li&gt;What impact does the guarantee of data-race freedom have on the reliability of parallel computing in Rust?&lt;&#x2F;li&gt;
&lt;li&gt;How can the WebAssembly support in Rayon broaden its application in web development?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;For more information, check out the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rayon-rs&#x2F;rayon&quot; target=&quot;_blank&quot;&gt;Rayon GitHub page&lt;&#x2F;a&gt;. For a Youtube explainer checkout this &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;YxG7PhZ3fb4&quot; target=&quot;_blank&quot;&gt;video from Let&#x27;s Gets Rusty&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Push yourself to explore the uncharted territories of Rust. Venturing beyond your usual limits can substantially enrich your evolution as a coder.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>21 - Rust Unleashed: Powering Frontend, Backend, and Static Sites</title>
          <pubDate>Wed, 19 Jul 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-unleashed-powering-frontend-backend-and-static-sites/</link>
          <guid>https://rust-trends.com/newsletter/rust-unleashed-powering-frontend-backend-and-static-sites/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-unleashed-powering-frontend-backend-and-static-sites/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Step into the future of web development!&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rustaceans!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to this week&#x27;s edition of &quot;Rust Unleashed: Powering Frontend, Backend, and Static Sites&quot;. We&#x27;ve handpicked a series of articles and updates from the ever-evolving world of Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;In this edition, we&#x27;re focusing on the power of Rust in both frontend and backend web development, and its growing influence in the realm of static site generation. We&#x27;ll be exploring the latest advancements, sharing expert insights, and showcasing real-world applications of Rust in these areas.&lt;&#x2F;p&gt;
&lt;p&gt;So, grab your favorite cup of coffee, get comfortable, and let&#x27;s dive into this exciting journey into the world of Rust!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;leptos-a-cutting-edge-rust-framework-for-the-modern-web&quot;&gt;Leptos: A Cutting-Edge Rust Framework for the Modern Web&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.leptos.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;21&#x2F;frontend-backend-leptos.webp&quot; alt=&quot;Frontend and Backend, Fullstack, Leptos&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.leptos.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Leptos&lt;&#x2F;a&gt; is a &lt;strong&gt;full-stack&lt;&#x2F;strong&gt;, fully typed Rust framework designed for modern web development. It combines the best paradigms of contemporary web development with the power of Rust.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-features&quot;&gt;Key Features&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Interactive Web Applications:&lt;&#x2F;strong&gt; Leptos simplifies the process of building interactive web applications in Rust. It enables developers to create full-stack apps that start working immediately and are progressively enhanced with client-side interactivity.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Simple Tooling:&lt;&#x2F;strong&gt; With Leptos, developers can kickstart projects quickly using straightforward tooling with minimal configuration.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Reactive Signals:&lt;&#x2F;strong&gt; Leptos makes it easy to manage state without fighting the borrow checker, thanks to reactive signals.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Server Functions:&lt;&#x2F;strong&gt; Leptos allows developers to write &quot;server functions&quot; that work across both the server and client, reducing the boilerplate of setting up new API endpoints.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Type Safety:&lt;&#x2F;strong&gt; With Rust&#x27;s type safety, developers can rest easy knowing that their entire app is protected.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;performance&quot;&gt;Performance&lt;&#x2F;h3&gt;
&lt;p&gt;Leptos boasts high performance, scoring 92% on the &lt;a href=&quot;https:&#x2F;&#x2F;krausest.github.io&#x2F;js-framework-benchmark&#x2F;2023&#x2F;table_chrome_113.0.5672.63.html&quot; target=&quot;_blank&quot;&gt;js-framework-benchmark&lt;&#x2F;a&gt; official results for Chrome 113, outperforming popular frameworks like Vue, Svelte, and React.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;ui-patterns-and-language-integration&quot;&gt;UI Patterns and Language Integration&lt;&#x2F;h3&gt;
&lt;p&gt;Leptos enables developers to build websites and apps using self-contained components with reactive state management. It also seamlessly integrates Rust backend code with the user interface, allowing for the creation of &quot;full-stack components&quot;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;tool-integration&quot;&gt;Tool Integration&lt;&#x2F;h3&gt;
&lt;p&gt;Leptos integrates perfectly with tools like Tailwind, allowing developers to build on design patterns shared across the web. It also offers great tooling like hot-reloading template updates and a dedicated Leptos language server and VSCode &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bram209&#x2F;leptos-language-server&quot; target=&quot;_blank&quot;&gt;extension&lt;&#x2F;a&gt;, designed to streamline the Leptos coding experience and maintain a consistent code style throughout the project.&lt;&#x2F;p&gt;
&lt;p&gt;For more information or to get started with Leptos, visit their &lt;a href=&quot;https:&#x2F;&#x2F;www.leptos.dev&#x2F;&quot;&gt;official website&lt;&#x2F;a&gt;. If you&#x27;re looking for an alternative to Leptos, consider &lt;a href=&quot;https:&#x2F;&#x2F;sycamore-rs.netlify.app&#x2F;&quot; target=&quot;_blank&quot;&gt;Sycamore&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;unlock-your-coding-potential-watch-this-epic-leptos-tutorial-on-youtube&quot;&gt;Unlock Your Coding Potential: Watch this Epic Leptos Tutorial on YouTube&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vAjle3c9Xqc&amp;t=612s&amp;ab_channel=CodetotheMoon&quot;&gt;&lt;img src=&quot;..&#x2F;21&#x2F;chatbot-llm-leptos.webp&quot; alt=&quot;Chatbot with Leptos&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 80%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Code to the Moon, a popular YouTube channel, recently published an insightful &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vAjle3c9Xqc&amp;t=612s&amp;ab_channel=CodetotheMoon&quot;&gt;tutorial&lt;&#x2F;a&gt; on building a ChatBot. This walkthrough uses the open-source language model, Leptos, and a crate from Rustformers known as &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rustformers&#x2F;llm&quot; target=&quot;_blank&quot;&gt;LLM&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;LLM, or Large Language Model, is a pivotal model in Natural Language Processing (NLP) that predicts the likelihood of a sentence or a sequence of words, the same way &lt;a href=&quot;https:&#x2F;&#x2F;openai.com&#x2F;blog&#x2F;chatgpt&quot; target=&quot;_blank&quot;&gt;ChatGPT&lt;&#x2F;a&gt; works. It plays a crucial role in various NLP tasks, including speech recognition, machine translation, and text generation. In this tutorial, LLM powers the ChatBot&#x27;s ability to generate human-like text responses.&lt;&#x2F;p&gt;
&lt;p&gt;The tutorial employs a specific LLM called &lt;a href=&quot;https:&#x2F;&#x2F;huggingface.co&#x2F;TheBloke&#x2F;Wizard-Vicuna-7B-Uncensored-GPTQ&quot; target=&quot;_blank&quot;&gt;Wizard-Vicuna&lt;&#x2F;a&gt;, an open-source language model that forms the heart of the ChatBot project. The performance of open-source language models like Wizard-Vicuna is rapidly improving, making them increasingly feasible for use on personal computer hardware.&lt;&#x2F;p&gt;
&lt;p&gt;This walkthrough not only guides you through the process of building a ChatBot but also offers valuable insights and tips. It&#x27;s an excellent resource for anyone interested in Rust, Leptos, Rustformers, or chatbot development in general.&lt;&#x2F;p&gt;
&lt;p&gt;Enjoy the journey of learning and creating with this tutorial!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;zola-the-one-stop-static-site-engine&quot;&gt;Zola: The One-Stop Static Site Engine&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
  &lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Zola&lt;&#x2F;a&gt; is a comprehensive static site generator that provides all the tools you need in a single executable, eliminating the need for additional dependencies. It offers features such as Markdown to HTML conversion, Sass compilation, syntax highlighting, and table of contents generation, which traditionally require a development environment or JavaScript libraries.
&lt;p&gt;Designed for speed and scalability, Zola can generate an average site in less than a second. It renders your entire site as static files, making it capable of handling high traffic levels without the need for server or database management.&lt;&#x2F;p&gt;
&lt;p&gt;Zola&#x27;s user-friendly design includes an intuitive command-line interface and a flexible template engine. This allows you to focus on creating content for your blog, knowledge base, landing page, or a combination of these. Zola also enhances your Markdown writing with shortcodes and internal links, simplifying content creation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;deployment&#x2F;github-pages&#x2F;&quot;&gt;Deploying your website to Github Pages&lt;&#x2F;a&gt;, a &lt;a href=&quot;https:&#x2F;&#x2F;savjee.be&#x2F;blog&#x2F;benchmarking-static-website-hosting-providers&#x2F;&quot; target=&quot;_blank&quot;&gt;fast&lt;&#x2F;a&gt;, free-of-charge web hosting service, is easily accomplished with Zola.&lt;&#x2F;p&gt;
&lt;p&gt;For more information or to get started with Zola, visit their &lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot; target=&quot;_blank&quot;&gt;official website&lt;&#x2F;a&gt;. Discover the benefits of this all-in-one static site generator today.
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;21&#x2F;static-website-generator.webp&quot; alt=&quot;Zola static website generator&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 80%&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Encourage yourself to discover new aspects of Rust. Stepping outside your comfort zone can enhance your growth as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>20 - Master Rust in Just 2 Months: Google Debunks Learning Curve Myth</title>
          <pubDate>Wed, 05 Jul 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/master-rust-in-just-2-months-google-debunks-learning-curve-myth/</link>
          <guid>https://rust-trends.com/newsletter/master-rust-in-just-2-months-google-debunks-learning-curve-myth/</guid>
          <description xml:base="https://rust-trends.com/newsletter/master-rust-in-just-2-months-google-debunks-learning-curve-myth/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Learn from Google and improve your journey to learn Rust faster&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rustaceans!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to this week&#x27;s edition of the Rust Trends newsletter. We&#x27;ve curated a collection of insightful articles for you, overflowing with the latest updates and discoveries from the Rust programming landscape.&lt;&#x2F;p&gt;
&lt;p&gt;In this edition, we spotlight Google&#x27;s recent exploration into Rust, debunking myths and confirming truths about the language. We also delve into the challenges and triumphs experienced by Google developers as they navigate Rust, from compiler speed to code quality.&lt;&#x2F;p&gt;
&lt;p&gt;So, prepare your favorite brew, settle in, and let&#x27;s embark on this enlightening journey into the world of Rust!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;fast-track-your-rust-skills-google-shatters-6-month-learning-myth&quot;&gt;Fast-Track Your Rust Skills: Google shatters 6-month learning myth&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;opensource.googleblog.com&#x2F;2023&#x2F;06&#x2F;rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;20&#x2F;Cartoon_crab.webp&quot; alt=&quot;A crab learning to code&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Google&#x27;s recent exploration into Rust has debunked a major myth: Rust does not take more than six months to learn. In fact, developers can become productive in Rust in just two months or less, a timeline comparable to adopting other languages.&lt;&#x2F;p&gt;
&lt;p&gt;In the same study, Google confirmed a few truths and debunked other rumors about Rust. Slow build speeds were identified as the top challenge, confirming complaints about the Rust compiler&#x27;s speed. However, the quality of Rust&#x27;s compiler error messages and the high quality of Rust code were both confirmed, with over 85% of developers confident in their Rust code&#x27;s correctness.&lt;&#x2F;p&gt;
&lt;p&gt;The study also revealed that the top challenges for Google developers using Rust were Macros, Ownership and borrowing, and Async programming, rather than writing unsafe code and handling C&#x2F;C++ interop. These insights provide a more nuanced understanding of the Rust experience, helping both current and prospective Rust developers navigate the language more effectively.&lt;&#x2F;p&gt;
&lt;p&gt;To read the &lt;a href=&quot;https:&#x2F;&#x2F;opensource.googleblog.com&#x2F;2023&#x2F;06&#x2F;rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html&quot; target=&quot;_blank&quot;&gt;full article click here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;crate-mastery-discover-the-websites-every-rust-programmer-needs&quot;&gt;Crate Mastery: Discover the websites every Rust programmer needs&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;20&#x2F;crab_crate_lifting.webp&quot; alt=&quot;A crab learning to code&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 30%&quot;&gt;
Whether you are a beginner just starting out or an experienced programmer looking to stay updated, these websites are sure to be invaluable tools in your journey.
&lt;p&gt;The first website, &lt;a href=&quot;https:&#x2F;&#x2F;blessed.rs&#x2F;crates&quot; target=&quot;_blank&quot;&gt;Blessed.rs&lt;&#x2F;a&gt;, offers an overview of popular and well-maintained Rust crates. It&#x27;s a fantastic starting point for beginners, providing a curated list of reliable crates to explore and learn from.&lt;&#x2F;p&gt;
&lt;p&gt;Our second recommendation is &lt;a href=&quot;https:&#x2F;&#x2F;lib.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Lib.rs&lt;&#x2F;a&gt;, another excellent resource for discovering and evaluating Rust crates. This site provides crates sorted by category, new trending and popular, helping you make informed decisions about which crates to use in your projects.&lt;&#x2F;p&gt;
&lt;p&gt;We believe these resources will greatly assist you in navigating the Rust ecosystem, enhancing your understanding and efficiency.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;zero-cost-abstractions&quot;&gt;Zero-cost abstractions&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
    &lt;div class=&quot;column&quot;&gt;
Rust&#x27;s core principle of &#x27;zero-cost abstractions&#x27; is a powerful concept that extends beyond programming. It is the idea that you can have high-level abstractions that make programming easier, without sacrificing the low-level control that is necessary for performance.
&lt;p&gt;In Rust, iterators are a zero-cost abstraction. They allow you to work with sequences of elements in a high-level, abstract way, without sacrificing performance.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; sum = vec![&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;].&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;iter&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;sum&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;println!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, sum); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; Prints 10
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this code, we are using the iter() method to create an iterator over a vector, and the sum() method to add up the elements. This is a high-level, easy-to-read way of working with sequences, but it is also efficient: the Rust compiler can optimize this code to be as fast as the equivalent low-level loop.&lt;&#x2F;p&gt;
&lt;p&gt;One of the great benefits of Rust!
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;img src=&quot;..&#x2F;20&#x2F;Iterator.webp&quot; alt=&quot;A crab learning to code&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%&quot;&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>19 - Are we Embedded yet?</title>
          <pubDate>Wed, 21 Jun 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/are-we-embedded-yet/</link>
          <guid>https://rust-trends.com/newsletter/are-we-embedded-yet/</guid>
          <description xml:base="https://rust-trends.com/newsletter/are-we-embedded-yet/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;This edition is to check in on the state of Rust for Embedded Systems&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello, Rustaceans!&lt;&#x2F;p&gt;
&lt;p&gt;Welcome to this week&#x27;s edition of the Rust Trends newsletter. We have an exciting lineup of articles prepared for you, packed with valuable insights and updates from the world of Rust programming.&lt;&#x2F;p&gt;
&lt;p&gt;In this edition, we focus on embedded systems and the roadblocks that stand in the way of Rust adoption. We will also introduce you to a hex viewer written in Rust, for your binary data analysis needs.&lt;&#x2F;p&gt;
&lt;p&gt;So grab your favorite beverage, sit back, and let&#x27;s dive right in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;embedded-systems-and-the-5-roadblocks-to-rust-adoption&quot;&gt;Embedded Systems and the 5 Roadblocks to Rust Adoption&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;19&#x2F;microcontroller.webp&quot; alt=&quot;Microcontroller&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%&quot;&gt;
&lt;p&gt;Rust has been making progress as a language for adoption in the embedded systems world. However, several significant roadblocks hinder its widespread acceptance. This &lt;a href=&quot;https:&#x2F;&#x2F;www.embedded.com&#x2F;5-roadblocks-to-rust-adoption-in-embedded-systems&#x2F;&quot; target=&quot;_blank&quot;&gt;article on Embedded.com&lt;&#x2F;a&gt; highlights 5 roadblocks to Rust adoption in embedded systems. These are the takeaways:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Rust faces roadblocks in embedded systems adoption due to limited commercial support from microcontroller vendors, leaving developers to figure things out on their own.&lt;&#x2F;li&gt;
&lt;li&gt;The learning curve for Rust is steeper than other languages, leading to higher training costs and longer development times for teams interested in using it for embedded systems.&lt;&#x2F;li&gt;
&lt;li&gt;Conservative adoption of technologies in the embedded industry, coupled with the investment in existing workflows and talent, makes switching to Rust less appealing for many companies.&lt;&#x2F;li&gt;
&lt;li&gt;Rust&#x27;s integration with existing toolchains and development processes in embedded systems may require significant rework, potentially leading to lost insights and additional development time.&lt;&#x2F;li&gt;
&lt;li&gt;The lack of a formal specification and standardization in Rust poses challenges for commercial support and consistency, particularly in safety-critical applications with long product lifetimes.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Moreover, the author mentions, &lt;em&gt;&quot;I hate to say it, but an experienced professional can do the same things in C or C++ that a Rust programmer can do just as safely.&quot;&lt;&#x2F;em&gt; I strongly disagree with this statement. The reason why embedded firmware has so many vulnerabilities is that languages like C and C++ do not provide inherent protection against making mistakes in the first place. As humans, we are prone to errors, and in my opinion, enforcing programming practices that ensure the correct approach is the only truly safe way forward.&lt;&#x2F;p&gt;
&lt;p&gt;The key food for thought is: How can the industry strike a balance between risk aversion and embracing new technologies to drive progress?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;embedded-rust-the-lay-of-the-land&quot;&gt;Embedded Rust: the lay of the land&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;19&#x2F;rust-micro.webp&quot; alt=&quot;Microcontroller with Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%&quot;&gt;
&lt;p&gt;For starters a nice overview for Embedded Rust is the repository &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-embedded&#x2F;awesome-embedded-rust&quot; target=&quot;_blank&quot;&gt;Awesome Embedded Rust&lt;&#x2F;a&gt;. &lt;a href=&quot;https:&#x2F;&#x2F;docs.rust-embedded.org&#x2F;book&#x2F;&quot; target=&quot;_blank&quot;&gt;The official Embedded Rust Book&lt;&#x2F;a&gt; and a great &lt;a href=&quot;https:&#x2F;&#x2F;blog.mbedded.ninja&#x2F;programming&#x2F;languages&#x2F;rust&#x2F;running-rust-on-microcontrollers&#x2F;&quot; target=&quot;_blank&quot;&gt;blogpost by the Mbedded Ninja&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Moreover several microcontroller vendors have started providing support (un) officially for the Rust programming language. Here are a few notable ones:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Nordic Semiconductor support for Rust for their nrf52,  and nrf53 series of microcontrollers. They provide a Rust-enabled software hardware abstraction layer called &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;nrf-rs&#x2F;nrf-hal&quot; target=&quot;_blank&quot;&gt;nrf-hal&lt;&#x2F;a&gt;, which allows developers to write firmware using Rust for their microcontrollers.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;STMicroelectronics Rust support for their STM32 microcontroller family. They offer a Rust-specific hardware abstraction layer (HAL) called &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;stm32-rs&#x2F;stm32-rs&quot; target=&quot;_blank&quot;&gt;stm32-rs&lt;&#x2F;a&gt;, enabling developers to write embedded software in Rust for STM32 microcontrollers.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;NXP Semiconductors Rust support for their i.MX RT series of microcontrollers. They offer the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;imxrt-rs&#x2F;imxrt-hal&quot; target=&quot;_blank&quot;&gt;imxrt-rs crate&lt;&#x2F;a&gt;, which is a Rust API for programming i.MX RT microcontrollers, allowing developers to leverage the Rust language for embedded development.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Espressif official support for the popular ESP32 controllers. They offer &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;esp-rs&quot; target=&quot;_blank&quot;&gt;esp-rs crate&lt;&#x2F;a&gt; and the &lt;a href=&quot;https:&#x2F;&#x2F;esp-rs.github.io&#x2F;book&#x2F;&quot; target=&quot;_blank&quot;&gt;ESP32 book&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Infineon official support for Rust for their &lt;a href=&quot;https:&#x2F;&#x2F;www.electronicsmedia.info&#x2F;2023&#x2F;03&#x2F;09&#x2F;microcontrollers-supporting-rust-ecosystem&#x2F;&quot; target=&quot;_blank&quot;&gt;(Automotive) Microcontrollers&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It&#x27;s important to note that the availability and extent of Rust support may vary among different microcontroller vendors and their specific microcontroller families. It&#x27;s always recommended to consult the official documentation and resources provided by the respective vendors for the most up-to-date information on Rust support.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;hex-viewer-empowering-binary-data-analysis-with-rust&quot;&gt;Hex Viewer: Empowering Binary Data Analysis with Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;19&#x2F;Pac-man.webp&quot; alt=&quot;Pac-Man kill screen&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 40%&quot;&gt;
&lt;p&gt;Hex editors play a crucial role in low-level data analysis and manipulation. Every embedded system developer should have one in their toolkit.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;hexyl&quot; target=&quot;_blank&quot;&gt;Hexyl&lt;&#x2F;a&gt;, a powerful hex viewer for the terminal, is written entirely in Rust. It utilizes colored output to differentiate various categories of bytes, offering an efficient and intuitive approach to working with binary data.&lt;&#x2F;p&gt;
&lt;p&gt;An example of a well-known hack that involved the use of a hex editor:&lt;&#x2F;p&gt;
&lt;p&gt;Is the case of the &quot;Pac-Man Kill Screen&quot; in the classic arcade game Pac-Man. In the original Pac-Man arcade machine, a bug caused the game to reach an unplayable level 256, known as the &quot;kill screen.&quot; This bug occurred due to an integer overflow issue, where the game&#x27;s code was unable to handle a higher level number.&lt;&#x2F;p&gt;
&lt;p&gt;In order to bypass this issue and reach the kill screen intentionally, some skilled players and hackers used a hex editor to modify the game&#x27;s code. By locating the specific section of code responsible for the level counter and adjusting it, they were able to bypass the limitations and continue playing beyond level 256. If you want to learn more about it watch this &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NKKfW8X9uYk&amp;ab_channel=RetroGameMechanicsExplained&quot; target=&quot;_blank&quot;&gt;youtube movie&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Ps. Did someone forward this email to you? Sign up here for our newsletter.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>18 - Lightning fast search, and the state of Rust and ML</title>
          <pubDate>Wed, 07 Jun 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/lightning-fast-search-and-the-state-of-rust-and-ml/</link>
          <guid>https://rust-trends.com/newsletter/lightning-fast-search-and-the-state-of-rust-and-ml/</guid>
          <description xml:base="https://rust-trends.com/newsletter/lightning-fast-search-and-the-state-of-rust-and-ml/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;A search engine written in Rust, a comprehensive overview of Rust and ML, and the state of the Rust Ecosystem&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome to the new edition of Rust Trends! First things first, we must address the elephant in the virtual room. You may have noticed a slight delay in our newsletter delivery recently. Well, let’s just say that the Rust community has gained a new recruit, and we couldn’t be more thrilled (and sleep-deprived) about it! Yes, dear readers, a tiny Rustacean has entered the world, and we were temporarily distracted by the cuteness overload. I became a father for the first time.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s dive into today’s topics and discover the latest and greatest in the world of Rust programming!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-lightning-fast-search-engine-written-in-rust&quot;&gt;A Lightning-Fast Search Engine written in Rust!&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;18&#x2F;Lightning.webp&quot; alt=&quot;Lightning fast search engine Meilisearch&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%&quot;&gt;
&lt;p&gt;Are you tired of sluggish search functionality in your website projects? Look no further! Meilisearch is an open-source, lightning-fast search engine designed specifically for developers and written in Rust. Meilisearch empowers developers to deliver seamless and efficient search experiences in their applications. Let’s dive into the exciting world of Meilisearch!&lt;&#x2F;p&gt;
&lt;p&gt;GitHub Repository: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;meilisearch&#x2F;meilisearch&quot; target=&quot;_blank&quot;&gt;Link to Meilisearch on GitHub&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Built with a focus on speed and simplicity, Meilisearch utilizes highly efficient indexing and search algorithms, ensuring rapid search results regardless of dataset size. Powered by Rust, Meilisearch leverages the language’s performance and safety guarantees, delivering exceptional search performance for your applications.&lt;&#x2F;p&gt;
&lt;p&gt;Ready to harness the power of Meilisearch? We have got you covered! Follow the comprehensive tutorial from Digital Ocean to seamlessly integrate Meilisearch into your web projects and unlock its impressive search capabilities. Whether you are building a web application, command-line tool, or any other (Rust) project, Meilisearch can supercharge your search functionality.&lt;&#x2F;p&gt;
&lt;p&gt;Tutorial: &lt;a href=&quot;https:&#x2F;&#x2F;www.digitalocean.com&#x2F;community&#x2F;tutorials&#x2F;how-to-deploy-and-configure-meilisearch-on-ubuntu-22-04&quot; target=&quot;_blank&quot;&gt;Link to Meilisearch Tutorial&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The step-by-step tutorial will guide you through the process of setting up Meilisearch, with the help of Docker, indexing your data, and performing lightning-fast searches. You will discover the Meilisearch frontend client library (Node.js), which offers a straightforward interface for interacting with the search engine. With detailed explanations and code snippets, you will quickly master Meilisearch integration. You can also have a look at the Meilisearch &lt;a href=&quot;https:&#x2F;&#x2F;www.meilisearch.com&#x2F;docs&#x2F;learn&#x2F;getting_started&#x2F;quick_start&quot;&gt;documentation&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;meilisearch&#x2F;meilisearch-rust&quot; target=&quot;_blank&quot;&gt;Rust SDK&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Do not let sluggish searches hinder your (Rust) projects any longer. Embrace Meilisearch and provide your users with exceptional search experiences. Get ready to revolutionize the performance and efficiency of your search operations with Meilisearch powered by Rust!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-rise-of-rust-a-growing-community-and-promising-future&quot;&gt;The Rise of Rust: A Growing Community and Promising Future&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;18&#x2F;eco_system.webp&quot; alt=&quot;Ecosystem&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%&quot;&gt;
&lt;p&gt;We are excited to present key takeaways from an insightful article on the Rust programming language and its dynamic community. Rust’s popularity continues to surge, with a growing user base and increasing usage across industries. Its seamless integration with other programming languages makes it an excellent choice for mixed-language projects.&lt;&#x2F;p&gt;
&lt;p&gt;Although Rust is relatively young, many developers who specialize in other programming languages have embraced it, bringing their professional experience to the Rust ecosystem. While there are still some drawbacks in terms of tooling and ecosystem maturity, significant progress has been made.&lt;&#x2F;p&gt;
&lt;p&gt;Rust is widely regarded as a language that delivers on its promises of memory safety and performance. The Rust community is actively involved in various surveys, providing valuable insights into the community and the technology’s potential. Interestingly, most Rust developers have recently started their journey with the language, indicating a growing interest and the need for employers to adapt their expectations when hiring.&lt;&#x2F;p&gt;
&lt;p&gt;In terms of technology domains, Rust excels in server-side projects, cloud computing infrastructure, and distributed applications. The Linux platform is a popular choice for Rust developers, while CLI tools dominate the Rust project landscape due to the availability of CLI libraries.&lt;&#x2F;p&gt;
&lt;p&gt;Rust’s adoption by tech giants like Microsoft, Google, Amazon, and Meta further solidifies its position. However, most Rust developers currently use the language outside of their official work, suggesting a potential for further industry adoption.&lt;&#x2F;p&gt;
&lt;p&gt;Rust’s performance characteristics, security features, and documentation receive high praise from developers. Nevertheless, some developers find Rust more challenging to program in and requires more effort to learn compared to other languages. Areas that require improvement include debugging, profiling, and enhancing the library ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;In conclusion, Rust’s community is young and growing rapidly. Industry adoption is on the rise, supported by enthusiastic developers and evolving tooling. While Rust presents unique challenges, its future looks promising. As a company considering Rust, it’s crucial to have senior engineers with Rust experience to guide the transition and invest in educating and training developers to maximize productivity.&lt;&#x2F;p&gt;
&lt;p&gt;Read the &lt;a href=&quot;https:&#x2F;&#x2F;www.infoq.com&#x2F;articles&#x2F;rust-ecosystem-review-2023&#x2F;&quot; target=&quot;_blank&quot;&gt;full article from InfoQ&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-growing-landscape-of-machine-learning-in-rust&quot;&gt;The Growing Landscape of Machine Learning in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt; &lt;div class=&quot;column&quot;&gt; Machine Learning (ML) in Rust is gaining momentum as an alternative ecosystem to established languages like Python. With its impressive performance, low-level control, and zero-cost abstractions, Rust offers a compelling choice for ML enthusiasts. Although still in its early stages, the Rust ML ecosystem has seen the emergence of ambitious projects and meta-crates, providing developers with practical solutions.
&lt;p&gt;&lt;strong&gt;A Growing Ecosystem&lt;&#x2F;strong&gt;&lt;br&gt;
Rust ML offers individual implementations of various ML methods and algorithms, along with meta-crates like &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-ml&#x2F;linfa&quot;&gt;linfa&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;smartcorelib.org&#x2F;&quot; target=&quot;_blank&quot;&gt;smartcore&lt;&#x2F;a&gt;, which bundle multiple algorithms for convenience. These developments provide a strong foundation for developers looking to explore ML in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Opportunities for Contributors&lt;&#x2F;strong&gt;&lt;br&gt;
The Rust ML community encourages contributions to existing projects and the creation of new ones. With ample opportunities for developers to make a difference, the ecosystem is open for collaboration. The unofficial Working Group in the ML domain and the Zulip chat provide avenues for seeking help and engaging with like-minded individuals.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The Path Ahead&lt;&#x2F;strong&gt;&lt;br&gt;
The Rust ML ecosystem is still young but holds significant potential. Rust’s unique features, such as memory safety and concurrency, contribute to the development of robust and efficient ML solutions. As the community grows and more developers explore Rust’s capabilities, we can expect further advancements in ML within the Rust ecosystem.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;&#x2F;strong&gt;&lt;br&gt;
Machine Learning in Rust is an exciting frontier that offers an alternative to established ecosystems. With ambitious projects, bundled solutions, and room for contributors, the Rust ML ecosystem is steadily evolving. Rust’s performance and high-level abstractions make it an appealing choice for ML practitioners. As the ecosystem continues to mature, we anticipate further growth and innovation in the field of ML in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Learn more at &lt;a href=&quot;https:&#x2F;&#x2F;www.arewelearningyet.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Are we learning yet?&lt;&#x2F;a&gt; &lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
    &lt;a href=&quot;https:&#x2F;&#x2F;www.arewelearningyet.com&#x2F;&quot; target=&quot;_blank&quot;&gt;
    &lt;img src=&quot;..&#x2F;18&#x2F;Are_We_Learning_yet.webp&quot; alt=&quot;Are we learning yet&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;
    &lt;&#x2F;a&gt;
    &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>17 - Development tool, video explainer, and a historic application</title>
          <pubDate>Wed, 10 May 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/development-tool-video-explainer-and-a-historic-application/</link>
          <guid>https://rust-trends.com/newsletter/development-tool-video-explainer-and-a-historic-application/</guid>
          <description xml:base="https://rust-trends.com/newsletter/development-tool-video-explainer-and-a-historic-application/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Adding more cargo to your dev tools, learn about collections and make use of your history&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hello and welcome to the newest edition of Rust Trends, your go-to source for staying informed on the latest developments and trends in the Rust programming language. We bring you the most up-to-date news, tutorials, and expert insights to keep you in the loop on all things Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s dive into today’s topics and discover the latest and greatest in the world of Rust programming!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;streamlining-your-rust-development-process-with-cargo-edit&quot;&gt;Streamlining Your Rust Development Process with cargo-edit&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;pulse&#x2F;streamlining-your-rust-development-process-cargo-edit-rust-trends&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;17&#x2F;cargo-add.webp&quot; alt=&quot;cargo add&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Managing dependencies in your Rust projects can be a time-consuming task, but it doesn’t have to be. In our latest blog post, we explore how to use &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;pulse&#x2F;streamlining-your-rust-development-process-cargo-edit-rust-trends&quot; target=&quot;_blank&quot;&gt;cargo-edit&lt;&#x2F;a&gt;, a powerful tool that can help simplify the process of adding, removing, and updating dependencies in your Cargo.toml file.&lt;&#x2F;p&gt;
&lt;p&gt;Learn how to use cargo add and cargo rm commands to streamline your development process and keep your dependencies up-to-date. Check it out now!&lt;&#x2F;p&gt;
&lt;p&gt;Add this tool to your belt. Interested in more cargo tools? Check out the previous newsletter editions with cargo fix or cargo watch.
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;crust-of-rust-std-collections-by-jon-gjengset&quot;&gt;Crust of Rust: std::collections, by Jon Gjengset&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=EF3Z4jdD1EQ&amp;t=2s&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;17&#x2F;library.webp&quot; alt=&quot;Rust’s standard library&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
Jon Gjengset is a well-known figure in the Rust community. He is a Ph.D. candidate at MIT and has been an active contributor to the Rust programming language, particularly in the areas of distributed systems and networking. He is also a popular content creator, having produced a number of educational videos on Rust.
&lt;p&gt;One of Jon’s most popular video series is called “Crust of Rust”, which is a deep-dive exploration of Rust’s standard library. In the “Crust of Rust: std::collections” video, Jon walks through the implementation of Rust’s built-in collection types, including vectors, hash maps, and more. It’s a great resource for anyone looking to gain a better understanding of how Rust’s collections work under the hood.&lt;&#x2F;p&gt;
&lt;p&gt;Here’s the link to the &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=EF3Z4jdD1EQ&amp;t=2s&amp;ab_channel=JonGjengset&quot; target=&quot;_blank&quot;&gt;video&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;replace-your-shell-history-with-atuin&quot;&gt;Replace your shell history with Atuin&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;Introducing &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ellie&#x2F;atuin&quot; target=&quot;_blank&quot;&gt;Atuin&lt;&#x2F;a&gt;, the ultimate shell history manager written in Rust! Atuin replaces your shell history with a powerful SQLite database, allowing you to record additional context for your commands such as exit code, duration, time, and command shown. With Atuin, you can easily search your command history using a full-screen UI or filter your search by specific criteria, search for all successful `cargo build` commands, recorded after 2pm yesterday.
&lt;p&gt;What’s more, Atuin offers optional and fully encrypted synchronization of your history between machines via an Atuin server, which you can host yourself or use the server provided.&lt;&#x2F;p&gt;
&lt;p&gt;And the best part? Your old history file is not replaced, so you won’t lose any of your valuable command history. With Atuin, you can access the same history across terminals, sessions, and machines and quickly jump to previous items with &lt;code&gt;Alt-&amp;lt;num&amp;gt;&lt;&#x2F;code&gt; or switch filter modes via &lt;code&gt;Ctrl-R&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Try &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ellie&#x2F;atuin&quot; target=&quot;_blank&quot;&gt;Atuin&lt;&#x2F;a&gt; today and take your command history management to the next level!&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ellie&#x2F;atuin&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;17&#x2F;atuin.webp&quot; alt=&quot;Atuin&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Streamlining Your Rust Development Process with cargo-edit</title>
          <pubDate>Wed, 10 May 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/posts/cargo-edit/</link>
          <guid>https://rust-trends.com/posts/cargo-edit/</guid>
          <description xml:base="https://rust-trends.com/posts/cargo-edit/">&lt;p&gt;As your Rust projects grow in complexity, managing dependencies can become a time-consuming and error-prone task. Fortunately, cargo-edit is a powerful tool that can help simplify the process of adding, removing, and updating dependencies in your Cargo.toml file. In this blog post, we&#x27;ll take a closer look at how to use cargo-edit in your Rust projects.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;&#x2F;h2&gt;
&lt;p&gt;Before we dive into how to use cargo-edit, let&#x27;s first make sure it&#x27;s installed. cargo-edit is available as a Rust package, which means you can install it using cargo:
cargo install cargo-edit
Once cargo-edit is installed, you can use it in your Rust projects.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;adding-a-dependency&quot;&gt;Adding a Dependency&lt;&#x2F;h2&gt;
&lt;p&gt;To add a dependency to your Rust project using cargo-edit, simply run the cargo add command followed by the name of the dependency:
cargo add my-dependency
This will automatically add the latest version of the my-dependency package to your Cargo.toml file, along with any necessary changes to your Cargo.lock file.
If you want to add a specific version of a dependency, you can specify the version number using the @ sign:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; add my-dependency@1.2.3
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will add version 1.2.3 of the my-dependency package to your project. If a package has features you can also add them
cargo add my-dependency --features my-feature&lt;&#x2F;p&gt;
&lt;h2 id=&quot;example-with-serde-and-it-s-derive-feature&quot;&gt;example with serde and it&#x27;s derive feature&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; add serde&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --features&lt;&#x2F;span&gt;&lt;span&gt; serde&#x2F;derive
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;removing-a-dependency&quot;&gt;Removing a Dependency&lt;&#x2F;h2&gt;
&lt;p&gt;To remove a dependency from your Rust project using cargo-edit, simply run the cargo remove command followed by the name of the dependency:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; remove my-dependency
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will automatically remove the my-dependency package from your Cargo.toml file, along with any necessary changes to your Cargo.lock file.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;updating-a-dependency&quot;&gt;Updating a Dependency&lt;&#x2F;h2&gt;
&lt;p&gt;To update a dependency in your Rust project using cargo-edit, simply run the cargo update command followed by &lt;code&gt;-p&lt;&#x2F;code&gt; and the name of the dependency:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; update&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span&gt; my-dependency
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will automatically update the my-dependency package to the latest version, along with any necessary changes to your Cargo.lock file.
If you want to update all dependencies in your project, you can simply run cargo update without specifying a package name.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;cargo-edit is a powerful tool that can help simplify the process of managing dependencies in your Rust projects. With its simple and intuitive commands, adding, removing, and updating dependencies has never been easier. Give it a try in your next Rust project and see how it can help streamline your development process! Looking for the documentation of cargo-edit click here.&lt;&#x2F;p&gt;
&lt;p&gt;Stay ahead of the curve with Rust-Trends. Subscribe now for bi-weekly updates on the latest Rust Trends, news, and tips delivered straight to your inbox!&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>16 - Idiomatic Rust and functional programming</title>
          <pubDate>Mon, 24 Apr 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/idiomatic-rust-and-functional-programming/</link>
          <guid>https://rust-trends.com/newsletter/idiomatic-rust-and-functional-programming/</guid>
          <description xml:base="https://rust-trends.com/newsletter/idiomatic-rust-and-functional-programming/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Exploring the intersection of idiomatic Rust and functional programming&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome to the latest edition of Rust Trends, a newsletter dedicated to keeping you up-to-date on the latest developments and trends in the Rust programming language.&lt;&#x2F;p&gt;
&lt;p&gt;Today’s topics are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Idiomatic Rust&lt;&#x2F;li&gt;
&lt;li&gt;Functional programming&lt;&#x2F;li&gt;
&lt;li&gt;​Cargo Fix&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Let’s dive into today’s topics and discover the latest and greatest in the world of Rust programming!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;idiomatic-rust-what-is-it-and-why-should-i-care&quot;&gt;Idiomatic Rust, what is it and why should I care?&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;16&#x2F;idiomatic_rust.webp&quot; alt=&quot;Idiomatic Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0; border-radius:10px&quot;&gt;
&lt;p&gt;Idiomatic Rust refers to the style of Rust programming that follows the language’s conventions and best practices, utilizing Rust’s unique features to write code that is safe, efficient, and expressive.&lt;&#x2F;p&gt;
&lt;p&gt;Some examples of idiomatic Rust code include:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Using Rust’s ownership and &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;beta&#x2F;rust-by-example&#x2F;scope&#x2F;borrow.html&quot; target=&quot;_blank&quot;&gt;borrowing&lt;&#x2F;a&gt; system to ensure that memory is managed safely and efficiently&lt;&#x2F;li&gt;
&lt;li&gt;Leveraging Rust’s &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;iter&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;iterators&lt;&#x2F;a&gt; and closures to express complex behavior in a clear and efficient way&lt;&#x2F;li&gt;
&lt;li&gt;Using the match expression to handle different cases in a concise and readable way&lt;&#x2F;li&gt;
&lt;li&gt;Using conversion traits like &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;rust-by-example&#x2F;conversion&#x2F;from_into.html&quot; target=&quot;_blank&quot;&gt;From and Into&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;But why should you care about writing idiomatic Rust code? Firstly, idiomatic Rust code tends to be easier to read and maintain, both for yourself and for others who may work with your code in the future. It can also be more efficient, as Rust’s unique features like zero-cost abstractions and memory safety can be utilized to write high-performance code.&lt;&#x2F;p&gt;
&lt;p&gt;In addition, following Rust’s conventions and best practices can help you avoid common pitfalls and mistakes that can lead to bugs and security vulnerabilities. By utilizing Rust’s ownership and borrowing system, for example, you can avoid issues like null pointer dereferencing and memory leaks.&lt;&#x2F;p&gt;
&lt;p&gt;Furthermore, writing idiomatic Rust code can help you become a better Rust programmer. By understanding Rust’s unique features and conventions, you can become more proficient in the language and better equipped to write high-quality, efficient code.&lt;&#x2F;p&gt;
&lt;p&gt;If you are interested in learning more about idiomatic Rust, the Rust programming language website provides extensive documentation on Rust’s design philosophy and best practices, as well as tutorials on e.g. traits, cheatsheets, and &lt;a href=&quot;https:&#x2F;&#x2F;rust-unofficial.github.io&#x2F;patterns&#x2F;idioms&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;examples of idiomatic Rust code&lt;&#x2F;a&gt;. There are also many online communities and forums dedicated to Rust programming, where you can ask questions and share knowledge with other Rust programmers.&lt;&#x2F;p&gt;
&lt;p&gt;In conclusion, writing idiomatic Rust code can help you write more maintainable, efficient, and secure programs, and become a better Rust programmer overall.
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;functional-programming-in-rust&quot;&gt;Functional programming in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt; &lt;img src=&quot;..&#x2F;16&#x2F;Math.webp&quot; alt=&quot;Math&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt; In Rust functional programming is not a strict requirement, but often used in conjunction with idiomatic Rust to achieve more concise, expressive, and safe code.
&lt;p&gt;Functional programming is a programming paradigm that emphasizes the use of functions to perform computations. In functional programming, functions are treated as first-class citizens, meaning that they can be assigned to variables, passed as arguments to other functions, and returned as values from functions. Functional programming also emphasizes immutability, meaning that data structures and variables should not be changed once they are created. Instead, new data structures and variables are created based on existing ones.&lt;&#x2F;p&gt;
&lt;p&gt;Rust provides a number of features that make functional programming easier, such as closures, iterators, and pattern matching. These features allow Rust programmers to write code that is both idiomatic and functional, using functions as building blocks to express complex behavior in a clear and efficient way.&lt;&#x2F;p&gt;
&lt;p&gt;For those interested in functional programming in Rust, there are several resources available as well. The Rust Programming Language book includes a &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;stable&#x2F;book&#x2F;ch13-00-functional-features.html&quot; target=&quot;_blank&quot;&gt;chapter on functional programming&lt;&#x2F;a&gt;, which provides an introduction to functional programming concepts and how they can be applied in Rust. Moreover, there are blog posts, like &lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;rust-functional-programming&quot; target=&quot;_blank&quot;&gt;this&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;deepu.tech&#x2F;functional-programming-in-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;this&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;cargo-fix&quot;&gt;Cargo Fix&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Cargo’s cargo fix subcommand has been a useful tool for Rust programmers to automatically fix some simple compiler warnings, such as unused imports or variables, since its introduction. Over time, the number of warnings that can be fixed automatically has steadily increased, making it even more valuable to developers.
&lt;p&gt;In addition to its existing capabilities, the cargo fix subcommand now also supports automatically fixing some simple Clippy warnings. This means that developers can now rely on Cargo to handle even more of their code maintenance tasks, freeing up time for more important work.&lt;&#x2F;p&gt;
&lt;p&gt;To draw more attention to these increased capabilities, Cargo will now suggest running &lt;code&gt;cargo fix&lt;&#x2F;code&gt; or &lt;code&gt;cargo clippy –fix&lt;&#x2F;code&gt; when it detects warnings that are automatically fixable. For example, when a warning is issued for an unused import Cargo will suggest running cargo fix to fix the issue.&lt;&#x2F;p&gt;
&lt;p&gt;Overall, these updates to Cargo’s cargo fix subcommand are a welcome addition to the Rust ecosystem, making it even easier for developers to write clean and efficient Rust code. To use these great features make sure to upgrade to the latest version of &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;04&#x2F;20&#x2F;Rust-1.69.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.69.0&lt;&#x2F;a&gt; &lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt; &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;04&#x2F;20&#x2F;Rust-1.69.0.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;16&#x2F;boxes_carton.webp&quot; alt=&quot;Cargo fix&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt; &lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not be afraid to try new things in Rust. After all, it is always good to step out of your comfort zone.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>15 - Tesla Model 3 hacked in under two minutes, is it time for Rust to step in?</title>
          <pubDate>Wed, 12 Apr 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/tesla-model-3-hacked-in-under-two-minutes-is-it-time-for-rust-to-step-in/</link>
          <guid>https://rust-trends.com/newsletter/tesla-model-3-hacked-in-under-two-minutes-is-it-time-for-rust-to-step-in/</guid>
          <description xml:base="https://rust-trends.com/newsletter/tesla-model-3-hacked-in-under-two-minutes-is-it-time-for-rust-to-step-in/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Security, Twitter and more …&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;We are excited to announce that we will now be publishing our bi-weekly newsletter on Wednesdays instead of Sundays. We hope this change will better accommodate your busy schedules and provide ample time to read and digest our valuable insights.&lt;&#x2F;p&gt;
&lt;p&gt;In this edition, we are focusing on the important topic of security and safety, which is becoming increasingly critical in today’s digital and connected world.&lt;&#x2F;p&gt;
&lt;p&gt;In addition to this, we will also be bringing you the latest news and updates from the world of Rust programming, so be sure to read on and stay up to date with the latest developments.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s dive into today’s topics and discover the latest and greatest in the world of Rust programming!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;could-rust-be-the-ideal-language-for-secure-systems&quot;&gt;Could Rust be the ideal language for Secure Systems?&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;15&#x2F;Tesla-Model-3-Dashboard-Display.webp&quot; alt=&quot;Tesla 3 Dashboard&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 80%&quot;&gt;
&lt;p&gt;As a systems programming language, Rust has been gaining popularity in recent years due to its unique ownership and borrowing system that prevents common classes of programming errors such as buffer overflows and data races. This has led to Rust being identified by the National Institute of Standards and Technology (NIST) as a &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;news&#x2F;rust-identified-as-safer-coding-tool-by-nist&#x2F;&quot; target=&quot;_blank&quot;&gt;safer coding tool&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;In March 2023, NIST added Rust to its list of Safer Languages on the grounds of its ownership model, which “guarantees both memory safety and thread safety, at compile-time, without requiring a garbage collector.” NIST points out that Rust “allows users to write high-performance code while eliminating many bug classes,” and while Rust does have an “unsafe” mode, the institute explains that risk is mitigated through the narrow scope of actions allowed.&lt;&#x2F;p&gt;
&lt;p&gt;The recent hacking of the Tesla Model 3 at the Pwn2Own contest, &lt;a href=&quot;https:&#x2F;&#x2F;www.darkreading.com&#x2F;vulnerabilities-threats&#x2F;tesla-model-3-hacked-2-minutes-pwn2own-contest&quot; target=&quot;_blank&quot;&gt;in under 2 minutes&lt;&#x2F;a&gt;, highlights the importance of secure coding practices, particularly in safety-critical applications such as those in the automotive industry. This contest was organized by the &lt;a href=&quot;https:&#x2F;&#x2F;www.zerodayinitiative.com&#x2F;blog&#x2F;2023&#x2F;3&#x2F;21&#x2F;pwn2own-vancouver-schedule-2023&quot; target=&quot;_blank&quot;&gt;Zero Day Initiative&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Rust’s safety features make it an ideal language for developing &lt;a href=&quot;https:&#x2F;&#x2F;www.thoughtworks.com&#x2F;en-de&#x2F;insights&#x2F;blog&#x2F;programming-languages&#x2F;rust-automotive-software&quot; target=&quot;_blank&quot;&gt;secure systems&lt;&#x2F;a&gt;, but there is one major hurdle to overcome before it can be widely adopted in these applications: ISO 26262 compliance.&lt;&#x2F;p&gt;
&lt;p&gt;ISO 26262 is an international standard for functional safety in the automotive industry that sets requirements for the development of safety-critical systems. Rust is not currently ISO 26262 compliant, but &lt;a href=&quot;https:&#x2F;&#x2F;ferrous-systems.com&#x2F;blog&#x2F;sealed-rust-the-pitch&#x2F;&quot; target=&quot;_blank&quot;&gt;Ferrous Systems aims to develop a safety-critical subset of the language&lt;&#x2F;a&gt; that meets the standard’s requirements. If successful, this could make Rust a more attractive option for developing secure systems in the automotive industry and other safety-critical applications.&lt;&#x2F;p&gt;
&lt;p&gt;In conclusion, Rust’s unique features make it a safer coding tool than traditional programming languages, and its potential for use in safety-critical applications is significant. With ongoing efforts to bring Rust up to standard, it could become the ideal language for developing secure systems in the future. The recent recognition of Rust’s safety features by NIST, combined with the need for secure coding practices highlighted by the Tesla Model 3 hack, reinforces the importance of prioritizing security in software development.
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-in-space-and-beyond&quot;&gt;Rust in Space and Beyond&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;15&#x2F;Gama_satellite.webp&quot; alt=&quot;Test Satellite&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;Another area for safety-critical application is space. Tweede Golf, a member of the &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;members&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Foundation&lt;&#x2F;a&gt;, gave a &lt;a href=&quot;https:&#x2F;&#x2F;tweedegolf.nl&#x2F;en&#x2F;blog&#x2F;89&#x2F;rust-at-nlr&quot; target=&quot;_blank&quot;&gt;presentation on Rust&lt;&#x2F;a&gt; to the Royal Netherlands Aerospace Centre.
&lt;p&gt;Additionally, since the SpaceX launch of 3 January 2023, French company Gama has had a &lt;a href=&quot;https:&#x2F;&#x2F;www.sail-world.com&#x2F;news&#x2F;257330&#x2F;Gama-launches-its-Gama-Alpha-solar-sail-mission&quot; target=&quot;_blank&quot;&gt;test satellite&lt;&#x2F;a&gt; in orbit that runs largely on Rust software. &lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;build-system-made-in-rust&quot;&gt;Build System made in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Meta, the social media company behind Facebook, has announced the release of their new open-source build system called Buck2. &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;buck2&quot; target=&quot;_blank&quot;&gt;Buck2&lt;&#x2F;a&gt; is designed to improve the build experience for developers and make it faster and more efficient.
&lt;p&gt;In Meta’s internal tests, Buck2 completed builds two times faster than its predecessor, Buck1, written in Java. Buck2 is written in Rust, and its design is based on principles that include a complete separation of core and language-specific rules, increased parallelism, integration with remote execution and virtual file systems, and a redesigned console output.&lt;&#x2F;p&gt;
&lt;p&gt;The open-source release of Buck2 is almost identical to the internal version, with the only differences being the toolchains and remote execution, which have open-source alternatives supplied. Buck2 also supports virtual file systems, making it faster and more efficient.&lt;&#x2F;p&gt;
&lt;p&gt;In real-world usage, Buck2 is significantly faster than Buck1, making it an excellent choice for developers looking to speed up their builds. Thousands of developers at Meta are already using Buck2, performing millions of builds per day, with hopes that the wider industry will see benefits as well.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;buck2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;15&#x2F;Buck2-Hero.webp&quot; alt=&quot;Buck2&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Twitter open-sourced its stack, &lt;a href=&quot;https:&#x2F;&#x2F;opensource.twitter.dev&#x2F;projects&#x2F;?q=rust&quot; target=&quot;_blank&quot;&gt;these&lt;&#x2F;a&gt; are the parts that use Rust. Part of the-algorithm repo is Navi (High-Performance Machine Learning Serving Server)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;2023.rustnl.org&#x2F;&quot; target=&quot;_blank&quot;&gt;RustNL 2023 conference&lt;&#x2F;a&gt;, 10 May 2023&lt;&#x2F;li&gt;
&lt;li&gt;Recently an online conference was held, Ukrainian Rust Conference 2023, for more info look at their &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang-ua&#x2F;learn_rust_together#-learn-rust-together-&quot; target=&quot;_blank&quot;&gt;Github repo&lt;&#x2F;a&gt;, and do not forget to check out the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang-ua&#x2F;learn_rust_together&#x2F;blob&#x2F;master&#x2F;cheat_sheets.md&quot; target=&quot;_blank&quot;&gt;cheatsheets&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>14 - Building your backend in Rust</title>
          <pubDate>Sun, 26 Mar 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/building-your-backend-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/building-your-backend-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/building-your-backend-in-rust/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Hot reloading, Test coverage and more&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome to the most recent release of the Rust Trends newsletter, where I present to you the most up-to-date news and insights from the dynamic Rust community. No matter if you’re an experienced Rust developer or a newcomer, there’s something in here for you. In this edition, we’ll explore topics like building your backend using Rust, the advantages of hot reloading, and how to achieve comprehensive test coverage.&lt;&#x2F;p&gt;
&lt;p&gt;Let’s dive into today’s topics and discover the latest and greatest in the world of Rust programming!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;building-a-backend-in-rust&quot;&gt;Building a Backend in Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;14&#x2F;Rust-Backend-sketch.webp&quot; alt=&quot;Rust Backend&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%&quot;&gt;
&lt;p&gt;Are you curious about why you should build your backend in Rust? Not only is it fast, secure, and reliable, resources become more widely available. Rust’s unique combination of performance and safety features has made it a go-to choice for backend development. Rust is an excellent choice for building your backend.&lt;&#x2F;p&gt;
&lt;p&gt;But that is not all! If you want to make use of a serverless approach like AWS API Gateway, you can still benefit from writing the functions, called lambdas on AWS, in Rust. Check out this page on &lt;a href=&quot;https:&#x2F;&#x2F;maxday.github.io&#x2F;lambda-perf&#x2F;&quot; target=&quot;_blank&quot;&gt;lambda performances&lt;&#x2F;a&gt; (cold start, average memory used, and duration). A youtube video on the same topic from the same author can be found &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=aIKnb8iMtRA&amp;ab_channel=maxday&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;And if you are still wondering why Rust is worth considering for your backend, we have got an &lt;a href=&quot;https:&#x2F;&#x2F;blog.adamchalmers.com&#x2F;why-rust-on-backend&quot; target=&quot;_blank&quot;&gt;opinion piece&lt;&#x2F;a&gt;, from a credible source, that is sure to persuade you. It discusses the unique features of Rust that make it stand out from other programming languages and explains why Rust is quickly becoming a top choice for backend developers.&lt;&#x2F;p&gt;
&lt;p&gt;So, what are you waiting for? Click on those links and start exploring the power of Rust on the backend!
&lt;br&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;hot-reloading-with-cargo-watch&quot;&gt;Hot reloading with cargo watch&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;watchexec&#x2F;cargo-watch&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;14&#x2F;cargo-watch.webp&quot; alt=&quot;Cargo Watch&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;If you are looking for a handy tool to automate the build and rebuild process in your Rust project directory, look no further than cargo-watch. This nifty tool automatically builds and rebuilds your Rust project when changes are saved, so you can focus on coding without worrying about manually rebuilding every time you make a change.
&lt;p&gt;To install cargo-watch, simply run the following command:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo install cargo-watch
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make sure to include the path with the binaries (e.g., &lt;code&gt;&#x2F;Users&#x2F;bob&#x2F;.cargo&#x2F;bin&lt;&#x2F;code&gt;) in your &lt;code&gt;$PATH&lt;&#x2F;code&gt; variable, and you can execute it from anywhere on your CLI.&lt;&#x2F;p&gt;
&lt;p&gt;Here are some useful commands to use in a Rust project directory:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Rebuilding on changes:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo watch
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Clearing the screen before each run:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo watch&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -c
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Monitor directory for changes:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo watch –watch src&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -x&lt;&#x2F;span&gt;&lt;span&gt; ‘run’
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Check out the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;watchexec&#x2F;cargo-watch&quot; target=&quot;_blank&quot;&gt;cargo-watch Github repository&lt;&#x2F;a&gt; for more information and documentation. Happy coding!&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;test-coverage-to-make-sure-we-got-you-covered&quot;&gt;Test coverage, to make sure we got you covered&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Are you looking for a tool to help you test and ensure code coverage in your Rust project? Meet cargo tarpaulin! This handy tool provides coverage statistics and visualizations, allowing you to easily identify untested code and ensure comprehensive test coverage.
&lt;p&gt;To install cargo tarpaulin, simply run the following command:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo install cargo-tarpaulin
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once installed, you can use the following command to generate a coverage report for your Rust project:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo tarpaulin –workspace
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command generates a coverage report for all the tests in your project, including integration tests.&lt;&#x2F;p&gt;
&lt;p&gt;You can also use the following command to customize the coverage report:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;## Output a coverage report in different formats, such as HTML, JSON, or XML:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cargo tarpaulin –out Html –output-dir .&#x2F;target&#x2F;coverage
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can set coverage goals, e.g. –line 75, for your project and fail the build if the coverage is below 75%. Check out the &lt;a href=&quot;https:&#x2F;&#x2F;lib.rs&#x2F;crates&#x2F;cargo-tarpaulin&quot; target=&quot;_blank&quot;&gt;cargo tarpaulin Github repository&lt;&#x2F;a&gt; for more information and documentation. With cargo tarpaulin, you can ensure comprehensive test coverage and identify any untested code in your Rust project.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;14&#x2F;testing.webp&quot; alt=&quot;Testing&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;03&#x2F;23&#x2F;Rust-1.68.1.html&quot; target=&quot;_blank&quot;&gt;Announcing Rust 1.68.1&lt;&#x2F;a&gt; – 23 March 2023, don’t forget &lt;code&gt;rustup update&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Do not hesitate to explore new possibilities in Rust. Pushing yourself out of your comfort zone can be a great way to learn and grow as a programmer.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>13 - Rust Nation UK 2023, Code search and a Rust Magazine</title>
          <pubDate>Sun, 12 Mar 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/rust-nation-uk-2023-code-search-and-a-rust-magazine/</link>
          <guid>https://rust-trends.com/newsletter/rust-nation-uk-2023-code-search-and-a-rust-magazine/</guid>
          <description xml:base="https://rust-trends.com/newsletter/rust-nation-uk-2023-code-search-and-a-rust-magazine/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Search, explore and learn&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome to the latest edition of the Rust Trends newsletter, where I bring you the latest news and updates from the vibrant Rust community. Whether you are a seasoned Rust programmer or just getting started, there is something here for everyone. In this edition, we are excited to highlight a few key events and resources that are sure to be of interest. From a highly anticipated conference to a cutting-edge magazine with a range of topics, we have got you covered. So sit back, relax, and dive into the world of Rust with us!&lt;&#x2F;p&gt;
&lt;p&gt;Today’s topics:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Rust Nation UK 2023, some interesting talks&lt;&#x2F;li&gt;
&lt;li&gt;GitHub’s new code search&lt;&#x2F;li&gt;
&lt;li&gt;Rust Magazine&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;rust-nation-uk-2023-some-interesting-talks&quot;&gt;Rust Nation UK 2023, some interesting talks&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.rustnationuk.com&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;13&#x2F;rust-nation.webp&quot; alt=&quot;Rust Nation 2023&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border: 0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Although &lt;a href=&quot;https:&#x2F;&#x2F;www.rustnationuk.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Nation 2023&lt;&#x2F;a&gt; took place on February 16th and 17th, the &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;@rustnationuk&#x2F;videos&quot; target=&quot;_blank&quot;&gt;conference’s talks&lt;&#x2F;a&gt; have just been released on YouTube, offering a wealth of insights and inspiration for Rustaceans everywhere. Here are some of the highlights from the conference’s talented speakers:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;fast-flexible-iteration-with-rust-rhai&quot;&gt;Fast Flexible Iteration with Rust &amp;amp; Rhai&lt;&#x2F;h3&gt;
&lt;p&gt;In his talk at Rust Nation, Jonathan Strong introduced Rhai, a scripting language made in Rust that provides a safe and easy way to add scripting to any application. Rhai is an embedded scripting language and evaluation engine for Rust that allows for fast and flexible iteration. Strong explored how Rust can be used as a script and how Rhai can help to make that process even more efficient.&lt;&#x2F;p&gt;
&lt;p&gt;To learn more about Rhai and its applications, check out the video of &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=u4Dd7dBxcEA&amp;list=PL1AoGvxomykTuOMzY5KrI4WiPCsIlYnAM&amp;index=3&amp;t=1s&quot; target=&quot;_blank&quot;&gt;Jonathan’s talk&lt;&#x2F;a&gt; on YouTube.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;spreading-rust-to-the-rest-of-the-company-moving-past-the-proof-of-concept&quot;&gt;Spreading Rust to the Rest of the Company: Moving Past the Proof of Concept&lt;&#x2F;h3&gt;
&lt;p&gt;In his talk at Rust Nation, Tim McNamara, New Zealand’s “Rust guy” and Senior Software Engineer at AWS, discussed strategies for expanding Rust adoption in the workplace beyond the initial proof of concept. McNamara shared tips and ideas for bringing developers, including those without Rust expertise, up to speed with projects, and explored how to build a sustainable team even after the initial enthusiasm has faded.&lt;&#x2F;p&gt;
&lt;p&gt;If you are interested in expanding Rust adoption in your workplace or want to learn more about how to build a sustainable team, check out the video of &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4DLhTPsg8QQ&amp;list=PL1AoGvxomykTuOMzY5KrI4WiPCsIlYnAM&amp;index=9&quot; target=&quot;_blank&quot;&gt;Tim’s talk on YouTube&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;navigating-the-ecosystem-s-constant-flux&quot;&gt;Navigating the Ecosystem’s Constant Flux&lt;&#x2F;h3&gt;
&lt;p&gt;In his talk at Rust Nation, Jon Gjengset explored the challenges of building applications and services with stability and long-term project sustainability in mind in Rust’s constantly evolving ecosystem. Gjengset discussed the changes that can happen when working with Rust, including crate versioning, backward compatibility, unstable features, minimum supported Rust versions, and 1.0 releases. He offered strategies for living with these changes and making the stable life easier.&lt;&#x2F;p&gt;
&lt;p&gt;As a long-time contributor to the Rust toolchain and ecosystem, Gjengset brings deep knowledge and experience to this topic. He’s also been teaching Rust since 2018, including live-streaming intermediate-level Rust programming and creating videos on advanced topics like async and await, pinning, variance, atomics, and dynamic dispatch.&lt;&#x2F;p&gt;
&lt;p&gt;To learn more about navigating Rust’s constant flux and building sustainable applications and services, check out the video of &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_cswE_R8iFw&amp;list=PL1AoGvxomykTuOMzY5KrI4WiPCsIlYnAM&amp;index=8&quot; target=&quot;_blank&quot;&gt;Jon’s talk on YouTube&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;github-s-code-search&quot;&gt;GitHub’s Code search&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;2023-02-06-the-technology-behind-githubs-new-code-search&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;13&#x2F;code_search.webp&quot; alt=&quot;Code search&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; &quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;2023-02-06-the-technology-behind-githubs-new-code-search&#x2F;&quot; target=&quot;_blank&quot;&gt;GitHub’s new code search&lt;&#x2F;a&gt; experience allows developers to ask questions of code and get answers through iteratively searching, browsing, navigating, and reading code. To achieve this, GitHub built its own search engine from scratch, called Blackbird, specifically designed for code search in Rust. Existing solutions for code search didn’t meet the unique needs of code search, such as searching for punctuation, not stemming, not stripping stop words, and searching with regular expressions, and didn’t work at GitHub’s scale of over 200 million repositories with constantly changing code. For more information look also at this &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=QCs76SC1ZZ0&quot; target=&quot;_blank&quot;&gt;talk on Youtube&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-magazine&quot;&gt;Rust Magazine&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rustmagazine.org&#x2F;issue-2&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;13&#x2F;rust-magazine.webp&quot; alt=&quot;Rust Magazine issue 2&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 50%; border:0 &quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The second and latest edition of &lt;a href=&quot;https:&#x2F;&#x2F;rustmagazine.org&#x2F;issue-2&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust Magazine&lt;&#x2F;a&gt;, a publication dedicated to the Rust programming language community. The magazine features contributions from Rustaceans all over the world and is maintained by a diverse editorial team.&lt;&#x2F;p&gt;
&lt;p&gt;Among others, this edition explores topics like optimizing Rust binary search and designing an API for a user-friendly retry crate.&lt;&#x2F;p&gt;
&lt;p&gt;They have nice articles so I would bookmark them if I were you.&lt;&#x2F;p&gt;
&lt;p&gt;Rust Magazine issue 2&lt;&#x2F;p&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;03&#x2F;09&#x2F;Rust-1.68.0.html&quot; target=&quot;_blank&quot;&gt;Announcing Rust 1.68.0&lt;&#x2F;a&gt; – 9 March 2023, don’t forget &lt;code&gt;rustup update&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Popular Github repo &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;RustPython&#x2F;RustPython&quot; target=&quot;_blank&quot;&gt;RustPython&lt;&#x2F;a&gt; – a Python 3 interpreter written in Rust&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>12 - Emulators and memory management visualization</title>
          <pubDate>Sun, 26 Feb 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/emulators-and-memory-management-visualization/</link>
          <guid>https://rust-trends.com/newsletter/emulators-and-memory-management-visualization/</guid>
          <description xml:base="https://rust-trends.com/newsletter/emulators-and-memory-management-visualization/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Understand your program by having a mental picture&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Who said programming should be boring? In this edition, we will bring back the good old times with retro gaming in Rust! Moreover, this newsletter showcases a visualization tool for a better understanding of Rust programs in terms of borrowing, heap, and stack. Grab some coffee and let’s dive in…&lt;&#x2F;p&gt;
&lt;h2 id=&quot;nintendo-emulator-in-rust&quot;&gt;Nintendo Emulator in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;An emulator is a software program that is designed to emulate the behavior of the Nintendo Entertainment System (NES), a popular video game console that was first released in the mid-1980s. The purpose of an emulator is to allow you to play Nintendo games on your computer or e.g. your Raspberry Pico without the need for the original console.
&lt;p&gt;When you run an NES emulator, written in Rust, on your computer or other devices, it creates a virtual environment that mimics the hardware of the original NES console. The emulator includes software that emulates the various components of the console, such as the CPU, and the graphics processing unit. The emulator also includes software that can read and interpret the code of NES game cartridges, which you can download &lt;a href=&quot;https:&#x2F;&#x2F;www.consoleroms.com&#x2F;roms&#x2F;nes&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt; and play in the &lt;a href=&quot;https:&#x2F;&#x2F;henrikpersson.github.io&#x2F;nes&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;NES wasm emulator&lt;&#x2F;a&gt; in your browser.&lt;&#x2F;p&gt;
&lt;p&gt;Once the emulator is up and running, you can load the virtual game cartridges into the emulator, and it will execute the code of the game as if it were being played on the original console. The emulator will output the video that the game would generate on the original hardware, allowing you to play the game on your computer.&lt;&#x2F;p&gt;
&lt;p&gt;Overall, an NES emulator is a powerful tool that allows users to enjoy classic NES games on modern hardware, preserving the experience of playing these games for future generations.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;12&#x2F;super-mario.webp&quot; alt=&quot;Super Mario&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border: 1&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;memory-management-what-the-hack-is-a-stack-and-heap&quot;&gt;Memory management: what the hack is a Stack and Heap?&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;12&#x2F;memory-stack.webp&quot; alt=&quot;Stack memory&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border: 0&quot;&gt;&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;The stack and the heap are two areas of memory that a program can use to store data.
&lt;p&gt;The stack is a memory region that is used to keep track of function calls and local variables. It works like a stack of plates: you add a new plate (or item) to the top of the stack, and when you are done with it, you remove it from the top. This order is called Last In First Out (LIFO). The simplicity makes it fast because it can be managed easily and either lives in RAM (fast) or cache (faster) of your CPU. Moreover, the stack is limited in size&lt;&#x2F;p&gt;
&lt;p&gt;The heap, on the other hand, is a larger and more flexible area of memory that can be used to store data that is too large to fit on the stack or needs to be dynamically allocated during the program’s execution (e.g. mutable vectors or Boxed variables).&lt;&#x2F;p&gt;
&lt;p&gt;Overall, the stack is faster and more efficient, but it has less memory available and is less flexible. The heap is slower and more complex, but it can be used to store larger amounts of data and is more flexible. Knowing when to use each of these memory regions is an important part of writing efficient and effective computer programs. To understand the choices that are made on memory management in Rust (e.g. &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch04-01-what-is-ownership.html&quot; target=&quot;_blank&quot;&gt;ownership&lt;&#x2F;a&gt;), knowing what a Stack and Heap are is a must.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Some nice reading material:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A stack and heap discussion on &lt;a href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;79923&#x2F;what-and-where-are-the-stack-and-heap&quot; target=&quot;_blank&quot;&gt;StackOverflow&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;web.mit.edu&#x2F;rust-lang_v1.25&#x2F;arch&#x2F;amd64_ubuntu1404&#x2F;share&#x2F;doc&#x2F;rust&#x2F;html&#x2F;book&#x2F;first-edition&#x2F;the-stack-and-the-heap.html&quot; target=&quot;_blank&quot;&gt;The Stack and the Heap in Rust&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Stack-based_memory_allocation&quot; target=&quot;_blank&quot;&gt;Stack based memory allocation&lt;&#x2F;a&gt; on Wikipedia&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Memory_management#Manual_memory_management&quot; target=&quot;_blank&quot;&gt;Heap based memory allocation&lt;&#x2F;a&gt; on Wikipedia&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;understanding-code-with-help-of-a-visualization-tool&quot;&gt;Understanding code with help of a visualization tool&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;The Rust borrow checker is a key component of the Rust programming language that enforces ownership and borrowing rules at compile-time, ensuring that programs are free from certain kinds of memory errors such as data races and null pointer dereferences. The borrow checker analyzes a Rust program’s use of mutable and immutable references to ensure that they are used correctly and that the lifetime of the references is valid throughout the program’s execution. By enforcing these rules, the borrow checker helps Rust programs achieve memory safety and prevents common programming errors that can lead to crashes or security vulnerabilities.
&lt;p&gt;To get a better understanding of this topic &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cognitive-engineering-lab&#x2F;aquascope&quot; target=&quot;_blank&quot;&gt;Aquascope&lt;&#x2F;a&gt; can be a very useful tool.&lt;&#x2F;p&gt;
&lt;p&gt;“Aquascope is a tool that generates interactive visualizations of Rust programs. These visualizations show how Rust’s borrow checker “thinks” about a program, and how a Rust program actually executes.”&lt;&#x2F;p&gt;
&lt;p&gt;Go ahead and give it a try!&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;12&#x2F;aquascope.webp&quot; alt=&quot;Aquascope visualization tool borrow checker&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 90%; border: 0&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>11 - Error Handling in Rust</title>
          <pubDate>Sun, 12 Feb 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/error-handling-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/error-handling-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/error-handling-in-rust/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;We all make errors. But how to handle them?&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;I am excited to bring you a new edition of our newsletter, focused on a topic that is crucial to every programmer: error handling in Rust. No matter how experienced or talented you are, errors are an inevitable part of the programming process. But do not worry, Rust provides a robust and efficient way to handle them.&lt;&#x2F;p&gt;
&lt;p&gt;In this edition, we will dive into the world of error handling in Rust and explore how you can handle errors in your programs with ease. From the Result type and the ? operator, to the match operator and beyond, we will cover all the essential elements of error handling in Rust. So, without further ado, let’s dive in!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;introduction-to-error-handling&quot;&gt;Introduction to Error Handling&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;The idea behind error handling in Rust is to make it explicit and unavoidable for the programmer to deal with errors. If you look at other programming languages handling errors is optional. E.g. if you do not use a Try and Except in Python you can still run your script. This can lead to subtle bugs that are difficult to debug and fix.
&lt;p&gt;Rust achieves strict handling of errors by using its type system to force it at compile time. In other words, the code will not compile and therefore not run. Which makes writing incorrect code harder from the start.&lt;&#x2F;p&gt;
&lt;p&gt;Errors in Rust can be classified into two categories:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Recoverable errors&lt;&#x2F;li&gt;
&lt;li&gt;Unrecoverable errors&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Recoverable errors&lt;&#x2F;strong&gt; are errors that can be handled and recovered from within the program. These errors are usually indicated by the Result type, which represents the result of an operation that might fail.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Unrecoverable errors&lt;&#x2F;strong&gt;, on the other hand, are errors that cannot be handled within the program and cause the program to terminate immediately. These errors are usually indicated by using the panic! macro or assert macro that calls panic!, which stops the program and displays an error message. Unrecoverable errors are typically used for cases where something unexpected has occurred, such as an assertion failure or a bug in the code.&lt;&#x2F;p&gt;
&lt;p&gt;In my opinion, there is no justification for intentionally causing a panic. This is because panics can always be replaced with recoverable errors, which provide a more flexible and controlled method of handling errors. So we will focus on the recoverable errors.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;11&#x2F;error_icon.webp&quot; alt=&quot;Error icon&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 60%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;recoverable-errors&quot;&gt;Recoverable errors&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;11&#x2F;error-head.webp&quot; alt=&quot;Error head&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;In Rust, errors are represented as values of the `Result` type, which is an enumeration with two variants: Ok and Err.
&lt;p&gt;When an operation returns Ok(T), it means that the operation was successful and the value of type T is returned.&lt;&#x2F;p&gt;
&lt;p&gt;When an operation returns Err(E), it means that the operation failed and an error of type E is returned.&lt;&#x2F;p&gt;
&lt;p&gt;The programmer can then handle the error by using techniques such as &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch06-02-match.html&quot; target=&quot;_blank&quot;&gt;pattern matching&lt;&#x2F;a&gt;, propagating the error up the call stack with &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator&quot; target=&quot;_blank&quot;&gt;the ? operator&lt;&#x2F;a&gt;, or by using error-handling functions such as unwrap() or expect().&lt;&#x2F;p&gt;
&lt;p&gt;Besides the &lt;code&gt;Result&lt;&#x2F;code&gt; type there is another important type called &lt;code&gt;Option&lt;&#x2F;code&gt;. In Rust, the &lt;code&gt;Option&lt;&#x2F;code&gt; type is a way to represent the presence or absence of a value. It is a generic enum with two variants: Some(T) and None. Some(T) holds a value of type T, while None represents the absence of a value.&lt;&#x2F;p&gt;
&lt;p&gt;For example, you can use an &lt;code&gt;Option&lt;&#x2F;code&gt; value to represent the result of a function that may or may not find a value, like searching a vector for an item. Instead of returning an error code or throwing an exception, the function would return Some(T) if a value was found and None otherwise.&lt;&#x2F;p&gt;
&lt;p&gt;In this way, the &lt;code&gt;Option&lt;&#x2F;code&gt; type can be seen as part of error handling because it provides a way to handle the absence of a value in a type-safe and explicit way, without relying on error codes or exceptions.&lt;&#x2F;p&gt;
&lt;p&gt;The following links might be useful to you to dive deeper into the discussed topics:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The Rust Book: &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch09-02-recoverable-errors-with-result.html&quot; target=&quot;_blank&quot;&gt;Recoverable Errors&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;src&#x2F;std&#x2F;io&#x2F;error.rs.html#68-70&quot; target=&quot;_blank&quot;&gt;Error struct&lt;&#x2F;a&gt; in the standard library&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;result&#x2F;enum.Result.html&quot; target=&quot;_blank&quot;&gt;&lt;code&gt;Result&lt;&#x2F;code&gt; type&lt;&#x2F;a&gt; in the standard library&lt;&#x2F;li&gt;
&lt;li&gt;Great &lt;a href=&quot;https:&#x2F;&#x2F;blog.burntsushi.net&#x2F;rust-error-handling&#x2F;&quot; target=&quot;_blank&quot;&gt;blog post by Burntsushi (Andrew Gallant)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Another &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;result&#x2F;enum.Result.html&quot; target=&quot;_blank&quot;&gt;blog post on unwrap by Burntsushi&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.thoughtworks.com&#x2F;en-in&#x2F;insights&#x2F;blog&#x2F;programming-languages&#x2F;rust-automotive-software&quot; target=&quot;_blank&quot;&gt;Rust as a programming language for automotive software?&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;company&#x2F;rust-trends&quot; target=&quot;_blank&quot;&gt;Did you know there is also a Rust Trends LinkedIn Page?&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;02&#x2F;09&#x2F;Rust-1.67.1.html&quot; target=&quot;_blank&quot;&gt;Rust 1.67.1&lt;&#x2F;a&gt;, February the 9th. Do not forget to run &lt;code&gt;rustup update&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>10 - Connecting the world with Rust</title>
          <pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/connecting-the-world-with-rust/</link>
          <guid>https://rust-trends.com/newsletter/connecting-the-world-with-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/connecting-the-world-with-rust/">&lt;br&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;q&gt;Making your own API, a new editor in Rust and more …&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;&lt;&#x2F;blockquote&gt;
&lt;p&gt;Welcome to the tenth edition of our newsletter! The Rust community is thriving and has an abundance of informative articles, tutorials, applications, and repositories. However, with so much to choose from, it can be overwhelming. We have handpicked the best of the best for you, so let’s dive in!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Connecting the world with Rust&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Introducing Lapce: a new editor built with the power of Rust&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The Rust Foundation&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;connecting-the-world-with-rust&quot;&gt;Connecting the world with Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Writing your own API (Application Programming Interface) can be a rewarding and challenging task. An API allows you to expose specific functionality of your software to other developers, enabling them to interact with your application in a predictable and standardized way. In this article, we will take a look at what it takes to write your own API in Rust.
&lt;p&gt;Before you start writing your API, it is important to think about what you want to achieve with it. Do you want to expose specific functionality of your application to other developers? Do you want to allow other applications to access data stored in your application? Answering these questions will help you determine the scope and functionality of your API.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have a clear idea of what you want your API to do, the next step is to choose a framework for building it. There are several popular options for building APIs in Rust, the most popular ones are &lt;a href=&quot;https:&#x2F;&#x2F;rocket.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Rocket&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;actix.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Actix&lt;&#x2F;a&gt;. Each of these frameworks has its own set of features and benefits, so it is worth doing some research to determine which one is the best fit for your needs.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have chosen a framework, you can start designing the structure and functionality of your API. This will involve creating endpoints, which are specific points of access for interacting with your API, and defining the input and output of each endpoint. You will also need to consider how you want to handle authentication, error handling, and other important aspects of API development. To learn more see some links below:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;swagger.io&#x2F;resources&#x2F;articles&#x2F;best-practices-in-api-design&#x2F;&quot; target=&quot;_blank&quot;&gt;Best practices in API design&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.logrocket.com&#x2F;current-state-rust-web-frameworks&#x2F;&quot; target=&quot;_blank&quot;&gt;The current state of Rust web frameworks&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;rocket.rs&#x2F;v0.5-rc&#x2F;guide&#x2F;&quot; target=&quot;_blank&quot;&gt;Rocket Guide&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;actix.rs&#x2F;docs&#x2F;&quot; target=&quot;_blank&quot;&gt;Actix Documenation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;With these resources and a little bit of practice, you will be well on your way to writing your own API in Rust. Happy coding!&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
    &lt;img src=&quot;..&#x2F;10&#x2F;connect-the-world.webp&quot; alt=&quot;Connecting the world&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;introducing-lapce-a-new-editor-built-with-the-power-of-rust&quot;&gt;Introducing Lapce: a new editor built with the power of Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt; &lt;a href=&quot;https:&#x2F;&#x2F;lapce.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;10&#x2F;Lapce-editor.webp&quot; alt=&quot;Lapce editor&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;We are excited to highlight a new editor for programming in Rust: &lt;a href=&quot;https:&#x2F;&#x2F;lapce.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Lapce&lt;&#x2F;a&gt;. This graphical editor, is built in Rust and utilizes the power of Droid and OpenGL.
&lt;p&gt;One of the things that sets Lapce apart is its clean and user-friendly interface. Additionally, it offers optional &lt;a href=&quot;https:&#x2F;&#x2F;docs.lapce.dev&#x2F;get-started&#x2F;modal-editing&quot; target=&quot;_blank&quot;&gt;modal-editing&lt;&#x2F;a&gt; with Vim-like modes, making it a great choice for those who prefer this type of editing.&lt;&#x2F;p&gt;
&lt;p&gt;Another feature we really liked is called &lt;a href=&quot;https:&#x2F;&#x2F;docs.lapce.dev&#x2F;features&#x2F;code-lens&quot; target=&quot;_blank&quot;&gt;Code Lens&lt;&#x2F;a&gt;, which allows for a more efficient way of folding code and getting a general overview of a file. Keep in mind that Lapce is currently still in its pre-alpha stage.&lt;&#x2F;p&gt;
&lt;p&gt;With ~23k Github stars and 129 contributors, Lapce is definitely worth checking, for a quick &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_52ZUg-QmW0&quot; target=&quot;_blank&quot;&gt;youtube movie on Lapce&lt;&#x2F;a&gt; follow the link.&lt;&#x2F;p&gt;
&lt;p&gt;Other editors we have highlighted in previous newsletters are &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;your-dev-environment-on-steroids&#x2F;#helix&quot; target=&quot;_blank&quot;&gt;Helix&lt;&#x2F;a&gt; (also written in Rust) and &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;your-dev-environment-on-steroids&#x2F;#vscode&quot; target=&quot;_blank&quot;&gt;Visual Studio Code&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;snippets&quot;&gt;Snippets&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2023&#x2F;01&#x2F;26&#x2F;Rust-1.67.0.html&quot; target=&quot;_blank&quot;&gt;Rust 1.67.0 released&lt;&#x2F;a&gt;. Want to see the release details?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;mdBook&quot; target=&quot;_blank&quot;&gt;mdBook&lt;&#x2F;a&gt; create online books from Markdown files. Made in Rust.&lt;&#x2F;li&gt;
&lt;li&gt;Strengthen your &lt;a href=&quot;https:&#x2F;&#x2F;exercism.org&#x2F;tracks&#x2F;rust&quot; target=&quot;_blank&quot;&gt;Rust skills with Exercism&lt;&#x2F;a&gt; and choose the Rust Track.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;the-rust-foundation&quot;&gt;The Rust Foundation&lt;&#x2F;h2&gt;
&lt;p&gt;The Rust programming language is widely known for its focus on safety and reliability, making it a popular choice for systems programming and other performance-critical applications. &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;&quot; target=&quot;_blank&quot;&gt;The Rust foundation&lt;&#x2F;a&gt; aims to support the continued development and growth of the Rust programming language by providing resources and infrastructure to the community of volunteer developers who maintain the language.&lt;&#x2F;p&gt;
&lt;p&gt;Some specific ways the Rust foundation supports the Rust project include:&lt;&#x2F;p&gt;
&lt;p&gt;Providing funding for development and infrastructure costs, such as hosting and testing services.
Supporting community events, such as Rust conferences and meetups, to foster collaboration and learning among Rust developers.
Managing the trademark and branding of the Rust programming language to ensure consistency and protect against misuse.
The Rust foundation also seeks to advance the state of the art in systems programming by supporting research and development in areas such as memory safety, performance, and language design. Overall, the goal of the Rust foundation is to ensure that the Rust programming language can continue to evolve and improve, while also providing a stable and sustainable platform for developers to build on. Moreover, &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;grants&#x2F;&quot; target=&quot;_blank&quot;&gt;the foundation gives out grants&lt;&#x2F;a&gt; to the public to fund initiatives related to Rust.&lt;&#x2F;p&gt;
&lt;p&gt;They recently released their &lt;a href=&quot;https:&#x2F;&#x2F;foundation.rust-lang.org&#x2F;news&#x2F;rust-foundation-annual-report-2022&#x2F;&quot; target=&quot;_blank&quot;&gt;annual report for 2022&lt;&#x2F;a&gt; that highlights the financials and important milestones.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>9 - Algorithms, Networking and Operating Systems</title>
          <pubDate>Sun, 15 Jan 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/algorithms-networking-and-operating-systems/</link>
          <guid>https://rust-trends.com/newsletter/algorithms-networking-and-operating-systems/</guid>
          <description xml:base="https://rust-trends.com/newsletter/algorithms-networking-and-operating-systems/">&lt;br&gt;
&lt;blockquote&gt;
    &lt;p&gt;&lt;q&gt;Looking at algorithms, network programming, and other related topics, with a focus on the Rust programming language.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;We are back with another exciting edition of the Rust-Trends newsletter! Whether you are looking to learn more about the language, stay up-to-date with the latest developments, or just get some inspiration for your next project, we’ve got you covered. So please grab a cup of coffee and join us as we explore the world of Rust!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Algorithms written in Rust&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Will this be your next Operating System in Rust?&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Networking with Rust crates&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;algorithms-written-in-rust&quot;&gt;Algorithms written in Rust&lt;&#x2F;h2&gt;
&lt;img src=&quot;..&#x2F;9&#x2F;algorithms.webp&quot; alt=&quot;Algorithms&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;
Algorithms are a crucial part of computer science, and they play a vital role in many areas of software development. From sorting data to searching for information, algorithms help us solve problems and perform tasks efficiently.
&lt;p&gt;If you are a Rust programmer looking to learn more about algorithms, a great resource to check out is &lt;a href=&quot;https:&#x2F;&#x2F;the-algorithms.com&#x2F;language&#x2F;rust&quot; target=&quot;_blank&quot;&gt;this website&lt;&#x2F;a&gt;. The website is accompanied by this &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;TheAlgorithms&#x2F;Rust&quot; target=&quot;_blank&quot;&gt;repository&lt;&#x2F;a&gt; that showcases the collection of algorithms written in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;The “TheAlgorithms&#x2F;Rust” repository contains a wide range of algorithms, including those for sorting, searching, and ciphers. It also includes implementations of various data structures, such as lists, trees, and graphs. The repository is maintained by contributors who are committed to keeping it up-to-date and relevant for Rust programmers.&lt;&#x2F;p&gt;
&lt;p&gt;If you are interested in learning more about algorithms and how they can be implemented in Rust, be sure to check it out. The nice thing about the website is that it uses the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;integer32llc&#x2F;rust-playground&quot; target=&quot;_blank&quot;&gt;online playground&lt;&#x2F;a&gt; platform, so you do not need to have Rust installed to try it out.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;will-this-be-your-next-operating-system-in-rust&quot;&gt;Will this be your next Operating System in Rust?&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;9&#x2F;Raspberry-pi.webp&quot; alt=&quot;Raspberry Pi and Rust programming&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;Rust is a language that is gaining popularity in Operating System (OS) development and the Raspberry Pi is a low-cost and powerful platform that can be used to learn and experiment with building an OS.
&lt;p&gt;There are several &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-embedded&#x2F;rust-raspberrypi-OS-tutorials&quot; target=&quot;_blank&quot;&gt;tutorials&lt;&#x2F;a&gt; and resources available for learning how to develop an OS in Rust on the Raspberry Pi, including creating a custom kernel, developing drivers, and creating a minimal operating system. There are also projects like &lt;a href=&quot;https:&#x2F;&#x2F;www.tockos.org&#x2F;&quot; target=&quot;_blank&quot;&gt;TockOS&lt;&#x2F;a&gt;, which uses Rust to create a secure and efficient embedded operating system.&lt;&#x2F;p&gt;
&lt;p&gt;The Rust programming language provides a powerful and safe alternative for building an OS on the Raspberry Pi. The growing community and resources available make it an attractive choice for those interested in this field.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;networking-with-rust-crates&quot;&gt;Networking with Rust crates&lt;&#x2F;h2&gt;
&lt;p&gt;Rust is a system programming language, that provides a safe and efficient way to build networked systems. One of the key features of Rust for network programming is its low-level control over memory, which allows for building high-performance and efficient networked systems. Additionally, Rust provides built-in support for low-level network programming, such as socket programming, which enables developers to handle network protocols such as TCP, UDP, and other transport protocols.&lt;&#x2F;p&gt;
&lt;p&gt;To get started with network programming in Rust, you can use the standard library‘s support for low-level network programming, such as the &lt;code&gt;std::net module&lt;&#x2F;code&gt;, or use specialized libraries such as &lt;strong&gt;mio&lt;&#x2F;strong&gt; and &lt;strong&gt;tokio&lt;&#x2F;strong&gt; which provide more high-level abstractions and are built on top of the standard library.&lt;&#x2F;p&gt;
&lt;p&gt;Here are a few resources that you may find helpful when getting started with network programming in Rust:&lt;&#x2F;p&gt;
&lt;p&gt;The Rust documentation on &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;net&#x2F;&quot; target=&quot;_blank&quot;&gt;Network Programming&lt;&#x2F;a&gt;
The &lt;a href=&quot;https:&#x2F;&#x2F;tokio.rs&#x2F;&quot;&gt;Tokio project&lt;&#x2F;a&gt; and the starter &lt;a href=&quot;https:&#x2F;&#x2F;tokio.rs&#x2F;tokio&#x2F;tutorial&quot; target=&quot;_blank&quot;&gt;tutorial&lt;&#x2F;a&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;tokio-rs&#x2F;mio&quot; target=&quot;_blank&quot;&gt;Mio&lt;&#x2F;a&gt;: minimalistic, efficient async I&#x2F;O library for Rust.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>8 - WebAssembly and Rust, learning Rust, and be ready to take notes</title>
          <pubDate>Sun, 01 Jan 2023 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/webassembly-and-rust-learning-rust-and-be-ready-to-take-notes/</link>
          <guid>https://rust-trends.com/newsletter/webassembly-and-rust-learning-rust-and-be-ready-to-take-notes/</guid>
          <description xml:base="https://rust-trends.com/newsletter/webassembly-and-rust-learning-rust-and-be-ready-to-take-notes/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;Showcasing WebAssembly, a course on Rust and a note-taking app written in Rust&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Happy New Year Rustaceans! 2023 is the year of more Rust Trends. No boring summary of the year, but instead content specifically selected for you. Let me know what you think of the newsletters and subjects you want to hear more about. Let’s dive in …&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rust + WebAssembly = Web + Speed&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Comprehensive Rust, want to learn Rust?&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Note-taking app the Rust alternative for Notion&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;rust-webassembly-web-speed&quot;&gt;Rust + WebAssembly = Web + Speed&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;WebAssembly (Wasm) is a binary format for running code in web browsers that has gained a lot of traction in the last few years. It allows developers to run code written in languages other than JavaScript, such as C++ or Rust, in the browser, enabling the creation of more complex and performant web applications.
&lt;p&gt;Rust has a number of features that make it especially suited for compiling to Wasm, including a focus on performance and safety, a strong type system, and low-level control over memory. &lt;a href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=MraEYwI9C5o&amp;t=163s&amp;ab_channel=Let%27sGetRusty&quot; target=&quot;_blank&quot;&gt;2 minutes Youtube intro&lt;&#x2F;a&gt; by Let’s Get Rusty.&lt;&#x2F;p&gt;
&lt;p&gt;Using Rust and WebAssembly together allows developers to take advantage of Rust’s strengths while still being able to run their code in the browser. This can be useful for applications that need to perform computationally intensive tasks, such as image or video processing, scientific simulations, or data visualization. A real-world example is the all-in-one design program &lt;a href=&quot;https:&#x2F;&#x2F;www.websitebuilderinsider.com&#x2F;how-figma-uses-wasm&#x2F;&quot; target=&quot;_blank&quot;&gt;Figma&lt;&#x2F;a&gt;. Note that &lt;a href=&quot;https:&#x2F;&#x2F;www.figma.com&#x2F;blog&#x2F;webassembly-cut-figmas-load-time-by-3x&#x2F;&quot; target=&quot;_blank&quot;&gt;Figma uses C++&lt;&#x2F;a&gt; but could also have been Rust.&lt;&#x2F;p&gt;
&lt;p&gt;Overall, Rust and WebAssembly offer a lot of potential for building high-performance and reliable web applications. As more developers start using this combination, we can expect to see even more exciting and innovative applications built with Rust and &lt;a href=&quot;https:&#x2F;&#x2F;webassembly.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Wasm&lt;&#x2F;a&gt;. Looking for more examples check this out: &lt;a href=&quot;https:&#x2F;&#x2F;madewithwebassembly.com&#x2F;all-projects&quot; target=&quot;_blank&quot;&gt;Made with WebAssembly&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;8&#x2F;figma.gif&quot; alt=&quot;Figma&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;comprehensive-rust-want-to-learn-rust&quot;&gt;Comprehensive Rust, want to learn Rust?&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;google.github.io&#x2F;comprehensive-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;8&#x2F;android.webp&quot; alt=&quot;Android&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;google.github.io&#x2F;comprehensive-rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Comprehensive Rust&lt;&#x2F;a&gt; is a 4-day course developed by the Google Android team. Only the fourth day is Android specific, for the rest a nice generic course to follow for starters.
&lt;p&gt;This course comes with a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;comprehensive-rust&quot; target=&quot;_blank&quot;&gt;GitHub repository&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;In a previous newsletter, we also highlighted that Android was using Rust and that they saw a steep &lt;a href=&quot;https:&#x2F;&#x2F;rust-trends.com&#x2F;the-rust-enthusiasm-is-spreading&#x2F;&quot; target=&quot;_blank&quot;&gt;decline in vulnerabilities&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;note-taking-app-the-rust-alternative-for-notion&quot;&gt;Note-taking app the Rust alternative for Notion&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;appflowy.io&#x2F;&quot; target=&quot;_blank&quot;&gt;AppFlowy.io&lt;&#x2F;a&gt; calls itself the open-source alternative to Notion. They started in November 2021 and have got a lot of traction from the beginning.
&lt;p&gt;It is written in Rust and &lt;a href=&quot;https:&#x2F;&#x2F;flutter.dev&#x2F;&quot; target=&quot;_blank&quot;&gt;Flutter&lt;&#x2F;a&gt; and has been one of the trending &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;AppFlowy-IO&#x2F;appflowy&quot; target=&quot;_blank&quot;&gt;GitHub repositories&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you are looking for a free and good note-taking app, for sure give it a try.&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;appflowy.io&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;8&#x2F;AppFlowy.webp&quot; alt=&quot;AppFlowy&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>7 - Your Dev Environment on Steroids</title>
          <pubDate>Sun, 18 Dec 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/your-dev-environment-on-steroids/</link>
          <guid>https://rust-trends.com/newsletter/your-dev-environment-on-steroids/</guid>
          <description xml:base="https://rust-trends.com/newsletter/your-dev-environment-on-steroids/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;Improving your tools will help to improve your code&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The last newsletter of 2022 the next one will be published on the 1st of January 2023. Time flies when you are having fun with Rust. Let’s dive in…&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enhanced Visual Studio Code&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ChatGPT a glimpse into the future&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The editor written in Rust&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;enhanced-visual-studio-code&quot;&gt;Enhanced Visual Studio Code&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;As a developer, you need a development environment or editor to write and debug your code. A popular editor is &lt;a href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;&quot; target=&quot;_blank&quot;&gt;VSCode&lt;&#x2F;a&gt;, which can be enhanced with extensions. The most downloaded Rust extension is &lt;a href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;languages&#x2F;rust&quot; target=&quot;_blank&quot;&gt;rust-analyzer&lt;&#x2F;a&gt;. If you want a more thorough &lt;a href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;languages&#x2F;rust#_linting&quot; target=&quot;_blank&quot;&gt;static code analysis&lt;&#x2F;a&gt;, consider using `clippy` instead of the default `check` tool. While check only verifies that your code compiles, clippy analyzes your code and provides useful information and tips.
&lt;p&gt;For debugging, you can use the &lt;a href=&quot;https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=vadimcn.vscode-lldb&quot; target=&quot;_blank&quot;&gt;CodeLLdb&lt;&#x2F;a&gt; extension. With this debugger, you can step through your code, put in watches, inspect variables, and see your call stack, among other features.&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;docs&#x2F;languages&#x2F;rust&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;7&#x2F;VScode.webp&quot; alt=&quot;VSCode&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;chatgpt-a-glimpse-into-the-future&quot;&gt;ChatGPT a glimpse into the future&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;features&#x2F;copilot&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;7&#x2F;ai-programmer.webp&quot; alt=&quot;Copilot AI programmer&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;ChatGPT, developed by OpenAI, is an artificial intelligence chatbot that is capable of performing many tasks, including writing code or refactoring existing code. You can find a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mpociot&#x2F;chatgpt-vscode&quot; target=&quot;_blank&quot;&gt;VSCode plugin&lt;&#x2F;a&gt; that uses ChatGPT here (note: the plugin is still a bit hacky because there is no official API for ChatGPT yet). If you would like to see a demo video on YouTube, click &lt;a href=&quot;https:&#x2F;&#x2F;gpt3demo.com&#x2F;apps&#x2F;chatgpt-for-vscode&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.
&lt;p&gt;If you want to chat with GPT follow &lt;a href=&quot;https:&#x2F;&#x2F;chat.openai.com&#x2F;chat&quot; target=&quot;_blank&quot;&gt;this&lt;&#x2F;a&gt; link. You will need to sign-up but it is definitively worth it.&lt;&#x2F;p&gt;
&lt;p&gt;Another AI tool that is used in production and helps you write code is &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;features&#x2F;copilot&quot; target=&quot;_blank&quot;&gt;Copilot&lt;&#x2F;a&gt;. They call it the AI pair programmer.&lt;&#x2F;p&gt;
&lt;p&gt;AI will be the future of in-editor resources, such as StackOverflow, as well as a pair programmer and reviewer all in one…​&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-editor-written-in-rust&quot;&gt;The editor written in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Are you interested in trying something new? Consider giving &lt;a href=&quot;https:&#x2F;&#x2F;helix-editor.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Helix&lt;&#x2F;a&gt; a try – it is an editor written in Rust. To get started, watch this &lt;a href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;xHebvTGOdH8&quot; target=&quot;_blank&quot;&gt;YouTube video&lt;&#x2F;a&gt;. If you’d like to see the manual, click &lt;a href=&quot;https:&#x2F;&#x2F;docs.helix-editor.com&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.
&lt;p&gt;Helix is designed to be used without a mouse, keeping your hands on the keyboard. If you’re already familiar with editors like Vim, the transition to Helix should be easy.&lt;&#x2F;p&gt;
&lt;p&gt;Consider giving Helix a try in your next hobby project and let me know your experience with it.&lt;&#x2F;p&gt;
&lt;p&gt;Helix the editor written in Rust&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;helix-editor.com&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;7&#x2F;Helix.webp&quot; alt=&quot;Helix Text Editor written in Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 70%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>6 - The Rust Enthusiasm is spreading</title>
          <pubDate>Sun, 04 Dec 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/the-rust-enthusiasm-is-spreading/</link>
          <guid>https://rust-trends.com/newsletter/the-rust-enthusiasm-is-spreading/</guid>
          <description xml:base="https://rust-trends.com/newsletter/the-rust-enthusiasm-is-spreading/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;You can get addicted to Rust. Do not take this addiction lightly.&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The Rust enthusiasm is spreading. You can get addicted to Rust. Do not take this addiction lightly. Let’s dive into the topics…&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The drop in vulnerabilities in Android 13&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;A port scanner in Rust&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The Rust Book, now available in a crate format&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;the-drop-in-vulnerabilities-in-android-13&quot;&gt;The drop in vulnerabilities in Android 13&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Google says that the number of memory safety vulnerabilities has dropped considerably over the past few years&#x2F;releases. They believe Android’s ongoing shift from memory-unsafe to memory-safe languages is a major factor.
&lt;p&gt;There is a strong correlation between the use of Rust and the decrease in vulnerabilities found. Note that correlation is not causation, but there is strong evidence like:&lt;&#x2F;p&gt;
&lt;p&gt;To date, there have been zero memory safety vulnerabilities discovered in Android’s Rust code.&lt;&#x2F;p&gt;
&lt;p&gt;Want to read more head over to their &lt;a href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2022&#x2F;12&#x2F;memory-safe-languages-in-android-13.html&quot; target=&quot;_blank&quot;&gt;security blog&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
 &lt;a href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2022&#x2F;12&#x2F;memory-safe-languages-in-android-13.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;6&#x2F;android-rust.webp&quot; alt=&quot;Android and Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;a-port-scanner-in-rust&quot;&gt;A port scanner in Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;
 &lt;a href=&quot;https:&#x2F;&#x2F;rustscan.github.io&#x2F;RustScan&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;6&#x2F;rustscan.webp&quot; alt=&quot;Rustscan portscanner in Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border: 1&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;A well-known port scanner is Nmap (Network mapper). Did you know there is a (faster) Rust alternative called &lt;a href=&quot;https:&#x2F;&#x2F;rustscan.github.io&#x2F;RustScan&#x2F;&quot; target=&quot;_blank&quot;&gt;RustScan&lt;&#x2F;a&gt;? To be fair it uses Nmap under the hood but utilizes multiple threads to speed up scanning.
&lt;p&gt;The well-maintained &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;RustScan&#x2F;RustScan&quot; target=&quot;_blank&quot;&gt;repository of RustScan can be found here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;You can run Rustscan also in a Docker image. This was done to make performance consistent across different Operating Systems, because of the high open file limit.&lt;&#x2F;p&gt;
&lt;p&gt;Using a Docker in your Rust development is not new. There is an official &lt;a href=&quot;https:&#x2F;&#x2F;hub.docker.com&#x2F;_&#x2F;rust&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust image&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-rust-book-now-available-in-a-crate-format&quot;&gt;The Rust Book, now available in a crate format&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;A funny crate and a nice way to close the Newsletter.
&lt;p&gt;The Rust Book also called The Book has now I crate of its own. This book is the starting point to learn Rust. Hiro created a &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;thebook&quot; target=&quot;_blank&quot;&gt;command line utility&lt;&#x2F;a&gt; to easily access the book from your command line.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;thebook&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;6&#x2F;book_to_crate.webp&quot; alt=&quot;Crate of Books&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;The Rust in crate form
Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>5 - Writing Your own Apps in Rust</title>
          <pubDate>Sun, 20 Nov 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/writing-your-own-apps-in-rust/</link>
          <guid>https://rust-trends.com/newsletter/writing-your-own-apps-in-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/writing-your-own-apps-in-rust/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;From Command Line Interface to Graphical User Interface&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The Rust community is active and has tons of nice articles, tutorials, applications, and repositories but we have to choose. This fifth email is all about setting up your project for a GUI app or CLI utility. Let’s dive in …&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Setting up your own Rust project&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Want to make your own app with a GUI?&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Command Line Interface:&lt;&#x2F;strong&gt; unleash the power of Rust&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;setting-up-your-own-rust-project&quot;&gt;Setting up your own Rust project&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;When starting a new Rust project, the package manager &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;&quot; target=&quot;_blank&quot;&gt;cargo&lt;&#x2F;a&gt; for Rust has you covered. With a simple command in your terminal &lt;code&gt;cargo new project_name&lt;&#x2F;code&gt; you are ready to write your Rust application.
&lt;p&gt;But what if you want to add additional files or directories to your project? Rust uses a module system, with modules and submodules. Then questions arise on how to include those modules. Do I know where to put my unit tests and integration tests? That’s why I created a dummy project to show the possibilities, please check it out on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;example_project_structure&quot; target=&quot;_blank&quot;&gt;GitHub&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Other nice reads are a blog article on Hackernoon, and for testing, you can also have a look at the documentation of Rust by Example &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;stable&#x2F;rust-by-example&#x2F;testing.html&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The great thing about Rust is that testing, benchmarking, examples, and package management are not an afterthought but rather integrated from the start.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;img src=&quot;..&#x2F;5&#x2F;project-structure.webp&quot; alt=&quot;Project structure&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:1&quot;&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;want-to-make-your-own-app-with-a-gui&quot;&gt;Want to make your own app with a GUI?&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;tauri.app&#x2F;about&#x2F;intro&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;5&#x2F;ferris-app.webp&quot; alt=&quot;Tauri for GUI apps&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;The ecosystem of Rust is ever-growing. One popular toolkit is &lt;a href=&quot;https:&#x2F;&#x2F;tauri.app&#x2F;about&#x2F;intro&quot; target=&quot;_blank&quot;&gt;Tauri&lt;&#x2F;a&gt;. With this toolkit, you can build &lt;a href=&quot;https:&#x2F;&#x2F;awesomeapp.org&#x2F;&quot; target=&quot;_blank&quot;&gt;Awesome&lt;&#x2F;a&gt; graphical applications for macOS, Linux, and Windows.
&lt;p&gt;The GUI&#x2F;frontend is based on web technology like javascript&#x2F;typescript and HTML.&lt;&#x2F;p&gt;
&lt;p&gt;Tauri is really worth looking at if you want to develop a (simple) desktop application.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;command-line-interface-unleash-the-power-of-rust&quot;&gt;Command Line Interface: unleash the power of Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Command line programs are popular among Rust developers. It is an easy starting point if you want to make something in Rust.
&lt;p&gt;There is a free getting-started book called &lt;a href=&quot;https:&#x2F;&#x2F;rust-cli.github.io&#x2F;book&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;Command Line Applications in Rust&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a href=&quot;https:&#x2F;&#x2F;docs.rs&#x2F;clap&#x2F;latest&#x2F;clap&#x2F;&quot; target=&quot;_blank&quot;&gt;Clap&lt;&#x2F;a&gt; crate is an easy-to-use command line parser and a great fit for your next CLI project.&lt;&#x2F;p&gt;
&lt;p&gt;For more inspiration have a look at existing CLI utilities on &lt;a href=&quot;https:&#x2F;&#x2F;lib.rs&#x2F;command-line-utilities&quot; target=&quot;_blank&quot;&gt;lib.rs&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;rust-cli.github.io&#x2F;book&#x2F;index.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;5&#x2F;command-line.webp&quot; alt=&quot;CLI terminal&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>4 - Web Frameworks, why is Rust Safe, and Blockchains that use Rust</title>
          <pubDate>Sun, 06 Nov 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/web-frameworks-why-is-rust-safe-and-blockchains-that-use-rust/</link>
          <guid>https://rust-trends.com/newsletter/web-frameworks-why-is-rust-safe-and-blockchains-that-use-rust/</guid>
          <description xml:base="https://rust-trends.com/newsletter/web-frameworks-why-is-rust-safe-and-blockchains-that-use-rust/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;Making your own API or run your smart contract but do it safe with Rust&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The newsletter is growing steadily, and this is already the fourth edition of your dose of Rust Trends. Let’s dive into the content.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Web Frameworks:&lt;&#x2F;strong&gt; make the life of a developer easier&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Why is Rust safe:&lt;&#x2F;strong&gt; improve your coding habits with Rust&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Blockchains and Rust:&lt;&#x2F;strong&gt; a definite match&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;web-frameworks&quot;&gt;Web Frameworks&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;A web framework enables developers to build and run applications for the web without having to write all the code from scratch.
&lt;p&gt;Since Rust is a system language, it has several WFs for an overview look at this &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;flosse&#x2F;rust-web-framework-comparison&quot; target=&quot;_blank&quot;&gt;GitHub&lt;&#x2F;a&gt; repository, and a blog post by &lt;a href=&quot;https:&#x2F;&#x2F;kerkour.com&#x2F;rust-web-framework-2022&quot; target=&quot;_blank&quot;&gt;Sylvain Kerkour&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;My favorite is &lt;a href=&quot;https:&#x2F;&#x2F;actix.rs&#x2F;&quot; target=&quot;_blank&quot;&gt;Actix&lt;&#x2F;a&gt;, an active community with many code examples and excellent documentation.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;flosse&#x2F;rust-web-framework-comparison&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;4&#x2F;WebFramework.webp&quot; alt=&quot;Web Frameworks&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;why-is-rust-safe&quot;&gt;Why is Rust safe?&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;4&#x2F;rust-a-safe-language.webp&quot; alt=&quot;Rust a Safe Language&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;Multiple features make the Rust language Safe. A quote from the Rust Language Book “Ownership is Rust’s most unique feature and has deep implications for the rest of the language. It enables Rust to make memory safety guarantees without needing a garbage collector, so it’s important to understand how ownership works.”
&lt;p&gt;Most design decisions in Rust do not leave room for interpretation, which forces good programming habits. Characteristics like &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;reference&#x2F;types.html&quot;&gt;Strongly typed&lt;&#x2F;a&gt;, immutable variables by default, &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;book&#x2F;ch04-00-understanding-ownership.html&quot; target=&quot;_blank&quot;&gt;ownership&lt;&#x2F;a&gt;, safe concurrency, etc, make &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;pulse&#x2F;why-rust-safest-language-you-cant-use-develop-software-ken-barker&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust one of the safest languages&lt;&#x2F;a&gt; and removes possible security vulnerabilities and bugs in your code. Most of it happens at compile time, which is way better than in production at runtime.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;blockchains-and-rust&quot;&gt;Blockchains and Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Blockchain, the technology behind Bitcoin and many other decentralized digital currencies, benefits from a secure language like Rust.
&lt;p&gt;There are at least five well-known blockchains using Rust as their primary language. The most popular ones are &lt;a href=&quot;https:&#x2F;&#x2F;solana.com&#x2F;&quot; target=&quot;_blank&quot;&gt;Solana&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;polkadot.network&#x2F;&quot; target=&quot;_blank&quot;&gt;Polkadot&lt;&#x2F;a&gt;. To see all five blockchains click &lt;a href=&quot;https:&#x2F;&#x2F;definoobs.com&#x2F;these-blockchains-use-rust-programming-language&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;. This article refers to another great article &lt;a href=&quot;https:&#x2F;&#x2F;definoobs.com&#x2F;rust-vs-go-for-blockchain&#x2F;&quot; target=&quot;_blank&quot;&gt;Rust vs. Go for Blockchain&lt;&#x2F;a&gt;, and highlights some nice criteria for both languages.&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;definoobs.com&#x2F;these-blockchains-use-rust-programming-language&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;4&#x2F;blockchain.webp&quot; alt=&quot;BlockChain&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>3 - Energy efficiency combined with style</title>
          <pubDate>Sun, 23 Oct 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/energy-efficiency-combined-with-style/</link>
          <guid>https://rust-trends.com/newsletter/energy-efficiency-combined-with-style/</guid>
          <description xml:base="https://rust-trends.com/newsletter/energy-efficiency-combined-with-style/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;Running Rust on AWS Lambda, improve your coding style and a blazing fast CLI search tool written in Rust&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The third newsletter with your dose of Rust Trends. Feel free to reply to this email if you have ideas to share… Let’s dive into the content.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lambdas and Rust:&lt;&#x2F;strong&gt; running your Rust code in Amazon’s AWS&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rust Style Team:&lt;&#x2F;strong&gt; improve your coding style&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Alternative to grep:&lt;&#x2F;strong&gt; a command line search tool on steroids&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;lambdas-and-rust&quot;&gt;Lambdas and Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Want to run your code faster and more energy efficient? Lambdas are one of the workhorses of Amazon’s AWS. Lambdas are programmatic functions that you pay by running time they are rounded to the nearest millisecond. So time is money?! To optimize for cost there are two important takeaways ARM &amp; Rust. Arm CPUs are energy efficient and Rust is fast, both are factors that influence the cost. &lt;a href=&quot;https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;opensource&#x2F;sustainability-with-rust&#x2F;&quot;&gt;AWS post&lt;&#x2F;a&gt; on Rust, another &lt;a href=&quot;https:&#x2F;&#x2F;filia-aleks.medium.com&#x2F;aws-lambda-battle-x86-vs-arm-graviton2-perfromance-3581aaef75d9&quot; target=&quot;_blank&quot;&gt;blog post on x86 vs Arm&lt;&#x2F;a&gt; Graviton, and a more practical &lt;a href=&quot;https:&#x2F;&#x2F;hackernoon.com&#x2F;how-using-aws-lambda-with-rust-saved-3x-the-cost-compared-to-using-python-or-net&quot; target=&quot;_blank&quot;&gt;Hackernoon&lt;&#x2F;a&gt; article. &lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;3&#x2F;rust-lambdas.webp&quot; alt=&quot;Rust Lambdas and ARM&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;improve-your-coding-style&quot;&gt;Improve your coding style&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;&lt;img src=&quot;..&#x2F;3&#x2F;hello-world.webp&quot; alt=&quot;Hello World&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;The Rust language gains in popularity and regularly gets new language constructs. Reasons for the &lt;a href=&quot;https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;inside-rust&#x2F;2022&#x2F;09&#x2F;29&#x2F;announcing-the-rust-style-team.html&quot;&gt;Rust Style Team&lt;&#x2F;a&gt; to actively maintain a standard style guide. This style is integrated into the widely used &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rustfmt&quot;&gt;rustfmt&lt;&#x2F;a&gt; tool, often used by the IDEs, that automatically formats your code. The standardized style guide helps to keep code readable and uniform across projects and the Rust ecosystem. See also this &lt;a href=&quot;https:&#x2F;&#x2F;www.zdnet.com&#x2F;article&#x2F;rust-programming-language-outlines-plan-for-updates-to-style-guide&#x2F;&quot; target=&quot;_blank&quot;&gt;ZDNet article&lt;&#x2F;a&gt;.&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;speedup-search-results&quot;&gt;Speedup search results&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Many people know the command line CLI command grep. But did you know a faster grep tool is available and written in Rust? It is called ripgrep and is abbreviated as &lt;code&gt;rg&lt;&#x2F;code&gt;. The link to the &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep&quot; target=&quot;_blank&quot;&gt;official ripgrep repo&lt;&#x2F;a&gt;. The command is available for Linux, macOS, and Windows. A benchmark between ripgrep, grep and other tools can be found &lt;a href=&quot;https:&#x2F;&#x2F;blog.burntsushi.net&#x2F;ripgrep&#x2F;&quot; target=&quot;_blank&quot;&gt;here&lt;&#x2F;a&gt;. Want to learn about the internals then this &lt;a href=&quot;https:&#x2F;&#x2F;blog.mbrt.dev&#x2F;posts&#x2F;ripgrep&#x2F;&quot; target=&quot;_blank&quot;&gt;Code review&lt;&#x2F;a&gt; is something for you. &lt;&#x2F;div&gt;&lt;div class=&quot;column&quot;&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;3&#x2F;ripgrep.webp&quot; alt=&quot;Ripgrep&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>2 - Cloudflare, Linux kernel, and size optimization</title>
          <pubDate>Sun, 09 Oct 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/cloudflare-linux-kernel-and-size-optimization/</link>
          <guid>https://rust-trends.com/newsletter/cloudflare-linux-kernel-and-size-optimization/</guid>
          <description xml:base="https://rust-trends.com/newsletter/cloudflare-linux-kernel-and-size-optimization/">&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;q&gt;Speed is a must, security is nonnegotiable, and size matters&lt;&#x2F;q&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;After a successful first newsletter, hereby your second dose of Rust Trends. Feel free to reply to this email if you have ideas to share… Let’s dive into the content.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cloudflare:&lt;&#x2F;strong&gt; building a better internet with Rust (Speed)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Linux Kernel:&lt;&#x2F;strong&gt; Rust will be part of the Linux Kernel (Security)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Compiling Rust:&lt;&#x2F;strong&gt; speed is number one, but size also matters (Size)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;building-a-better-internet-with-rust&quot;&gt;Building a better internet with Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Cloudflare is more than only a Content Delivery Network (CDN), that speeds up and secures your website. For their internal infrastructure, they outgrew NGINX and the programming language C. NGINX is known as one of the fastest HTTP proxies and Cloudflare decided to build their own in Rust. To optimize for speed and security on one side and development velocity on the other. Read &lt;a href=&quot;https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet&#x2F;&quot; target=&quot;_blank&quot;&gt;more&lt;&#x2F;a&gt; on their challenges, trade-offs, and how 5 milliseconds can make a difference. ps. Rust-Trends.com is a happy free user of Cloudflare.&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;blog.cloudflare.com&#x2F;how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;2&#x2F;cloudflare-pingora.webp&quot; alt=&quot;Tauri for GUI apps&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 100%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;linux-kernel-6-1-will-welcome-rust&quot;&gt;Linux Kernel 6.1 will welcome Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;www.zdnet.com&#x2F;article&#x2F;linus-torvalds-rust-will-go-into-linux-6-1&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;2&#x2F;Rust-for-Linux-logo.webp&quot; alt=&quot;Linux Kernel support for Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 30%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;column&quot;&gt;According to the original creator of Linux, Linus Torvalds: “unless something odd happens,” Rust will be part of the final Linux 6.1 release. Memory safety and removing many vulnerabilities at compile is a big plus for Rust. Read more on &lt;a href=&quot;https:&#x2F;&#x2F;www.zdnet.com&#x2F;article&#x2F;linus-torvalds-rust-will-go-into-linux-6-1&#x2F;&quot; target=&quot;_blank&quot;&gt;ZDNET&lt;&#x2F;a&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;h2 id=&quot;speed-and-size-both-matter-for-rust&quot;&gt;Speed and size both matter for Rust&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;column&quot;&gt;Often Rust is mentioned for its execution speed. However, size does matter as well in Rust. The build environment cargo lets you influence the size of the final binary. Look at our example project on &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;size-optimization-rust-binaries&quot; target=&quot;_blank&quot;&gt;GitHub&lt;&#x2F;a&gt; and read more in this &lt;a href=&quot;https:&#x2F;&#x2F;arusahni.net&#x2F;blog&#x2F;2020&#x2F;03&#x2F;optimizing-rust-binary-size.html&quot; target=&quot;_blank&quot;&gt;blog post&lt;&#x2F;a&gt;.
&lt;p&gt;Want to learn more on this topic the &lt;a href=&quot;https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;cargo&#x2F;reference&#x2F;profiles.html&quot; target=&quot;_blank&quot;&gt;Cargo Book&lt;&#x2F;a&gt; is a valuable source of information when it comes to the building environment.&lt;&#x2F;div&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;column&quot;&gt;
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Rust-Trends&#x2F;size-optimization-rust-binaries&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;2&#x2F;Cargo-logo.webp&quot; alt=&quot;Cargo Logo&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 90%; border:0&quot;&gt;&lt;&#x2F;a&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>1 - Why Rust Trends?</title>
          <pubDate>Sun, 25 Sep 2022 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://rust-trends.com/newsletter/why-rust-trends/</link>
          <guid>https://rust-trends.com/newsletter/why-rust-trends/</guid>
          <description xml:base="https://rust-trends.com/newsletter/why-rust-trends/">&lt;p&gt;Rust is a popular system programming language, and according to the yearly Stack Overflow &lt;a href=&quot;https:&#x2F;&#x2F;survey.stackoverflow.co&#x2F;2022&#x2F;#section-most-loved-dreaded-and-wanted-programming-scripting-and-markup-languages&quot; target=&quot;_blank&quot;&gt;developer survey&lt;&#x2F;a&gt; most loved programming language since 2015. So 7 years in a row!&lt;&#x2F;p&gt;
&lt;p&gt;The language stands for speed, safety, and concurrency. Why should you care? For me, with a background in Embedded Systems, so low-level coding, it became especially interesting when reading over and over again that companies&#x2F;teams that started using Rust, by rewriting part of their C&#x2F;C++ stack, experienced the following&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;When the Rust code compiles successfully, it usually just works. This is what you wished for if you ever compiled something in C with pointers, strings, memory (de)allocation, and callbacks …&lt;&#x2F;li&gt;
&lt;li&gt;Rust code in production required less maintenance and bug fixing, and therefore left more time for actual coding, which is great!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;So now, to stay in tune with everything happening in the Rust world, I challenge myself to biweekly write a newsletter with links to nice articles, blog posts, libraries, (white)papers, and code. I will be searching the web for hours so you do not have to.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;In today’s email:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tor and Rust:&lt;&#x2F;strong&gt; a Tor client on steroids&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rust for Microcontrollers:&lt;&#x2F;strong&gt; a simulator for ESP32 running Rust&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Game Engine:&lt;&#x2F;strong&gt; Unreal-Rust&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;tor-a-rewrite-from-c-to-rust-is-now-production-ready&quot;&gt;Tor a rewrite from C to Rust is now production ready&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;blog.torproject.org&#x2F;arti_100_released&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;1&#x2F;logo_tor.webp&quot; alt=&quot;Tor Blog: rewrite from C to Rust&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 30%&quot;&gt;&lt;&#x2F;a&gt;
Tor (The Onion Router), is free and open-source software for enabling anonymous communication on top of the Internet. Started thoughts of rewriting their C stack back in 2017, because of the low development speed. Combined with Rust being less error-prone and providing better secure programming methods it is a clear match. Read more about the official release on the &lt;a href=&quot;https:&#x2F;&#x2F;blog.torproject.org&#x2F;arti_100_released&#x2F;&quot; target=&quot;_blank&quot;&gt;Tor Blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rust-for-microcontrollers&quot;&gt;Rust for Microcontrollers&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;wokwi.com&#x2F;projects&#x2F;new&#x2F;rust-esp32&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;1&#x2F;ESP32.webp&quot; alt=&quot;ESP32&quot; style=&quot;display: block; margin-left: auto; margin-right: auto; width: 30%&quot;&gt;&lt;&#x2F;a&gt;
Rust’s popularity is also spreading towards Embedded Systems. I came across this nice project called &lt;a href=&quot;https:&#x2F;&#x2F;wokwi.com&#x2F;projects&#x2F;new&#x2F;rust-esp32&quot; target=&quot;_blank&quot;&gt;Wokwi&lt;&#x2F;a&gt; that provides several simulators, one of which is a simulation that runs your Rust code on an ESP32. You can attach several devices like LEDs, sensors, and displays without the need of heating up your soldering Iron&lt;&#x2F;p&gt;
&lt;h2 id=&quot;unreal-game-engine-a-rust-add-on&quot;&gt;Unreal game engine a Rust add-on&lt;&#x2F;h2&gt;
&lt;div class=&quot;row&quot;&gt;
  &lt;div class=&quot;column&quot;&gt;
    &lt;p&gt;There are already some game engines completely written in Rust but are not yet mainstream. &lt;a href=&quot;https:&#x2F;&#x2F;maikklein.github.io&#x2F;unreal-rust-1&#x2F;&quot; target=&quot;_blank&quot;&gt;Maik Klein&lt;&#x2F;a&gt; started to go at it via another route. An add-on to the Unreal Game engine that allows you to write in Rust. Note it is currently still a proof of concept.
&lt;p&gt;One important take away the editor for the Unreal Engine supports Hot Reloading while editing, however, with C++, the original language for the Engine, you can easily trigger a crash of the editor by e.g. accessing a null pointer. “In Rust crashes or panic are well defined and can be caught. That means if you ever unwrap an Option::None or do out-of-bounds access, &lt;strong&gt;unreal-rust&lt;&#x2F;strong&gt; will simply catch the panic, exit play mode, and log the error to the console. It will never crash the editor.&lt;&#x2F;p&gt;&lt;&#x2F;p&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;column&quot;&gt;
    &lt;p&gt;
    &lt;a href=&quot;https:&#x2F;&#x2F;maikklein.github.io&#x2F;unreal-rust-1&#x2F;&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;..&#x2F;1&#x2F;unreal-rust.webp&quot; alt=&quot;Unreal Engine with Rust Support&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot;&gt;&lt;&#x2F;a&gt;
    &lt;&#x2F;p&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Enjoy your Sunday, and have a great week ahead.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for reading!&lt;br&gt;
Bob Peters&lt;&#x2F;p&gt;
&lt;p&gt;Feel free to connect with me on &lt;a href=&quot;https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;bjhpeters&#x2F;&quot; target=&quot;_blank&quot;&gt;LinkedIn&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</description>
      </item>
    </channel>
</rss>
