Tag rust in blog posts
Beginner's Guide to anyhow and thiserror in Rust
Rust error handling can feel intimidating at first, especially when you want nice error messages without writing a lot of boilerplate. Two crates make this much easier:
Building Type-Safe REST APIs with Axum in Rust
Axum is a web framework for Rust that makes building APIs a pleasure. It’s built on top of Tokio and Tower, giving you excellent performance and composability. In this post, we’ll build a simple but complete REST API for managing a todo list.
Determining if a File is a PDF in Rust
In my work generating BI (Business Intelligence) reports as PDFs with Apache FOP (the Java XSL-FO to PDF engine), I often need to verify that an output file is actually a PDF before further processing. A reliable way to do this is to inspect the file’s “magic bytes” – the fixed signature at the start of the file. Magic bytes (also called file signatures or magic numbers) are small sequences of bytes placed at the beginning of a file to identify its format. Because these signatures are defined by the file format itself and deliberately chosen to be unique, checking them is a fast and reliable way to recognize a PDF (or any file type) regardless of its extension.
Converting Excel Column Names to Numbers in Rust
When working with Excel files programmatically, converting column names (like “A”, “B”, “C”, …, “Z”, “AA”, “AB”, etc.) to their corresponding numeric values (0, 1, 2, …, 25, 26, 27, etc.) is a common task. Rust, with its performance, safety, and expressiveness, is an excellent choice for implementing such functionality.
React + Axum: Building a Type-Safe Full-Stack Application
What if your frontend and backend could share the same type definitions? No more mismatched API responses. No more runtime surprises. In this post, we’ll build a full-stack application with React and Axum that achieves exactly that.
Understanding Rust Lifetimes: A Beginner's Guide
Lifetimes are one of Rust’s most talked-about features, and they often intimidate newcomers. But once you understand why they exist, they become much less scary. Let’s demystify them.
Tag rust in projects
LRU Memory Cache Library in Rust
in-memory-cache is a straightforward, yet powerful crate that delivers an easy-to-use in-memory cache solution with a Least Recently Used (LRU) eviction policy. This crate facilitates the efficient storage of key-value pairs, providing automatic eviction of the least recently accessed entries when the cache reaches its predefined capacity.