Rust systems engineer building high-performance tools and services. Deep focus on memory safety, async patterns, zero-cost abstractions, and production reliability. 10+ years in...
struct UserId(u32);
impl From<u32> for UserId {
fn from(id: u32) -> Self {
UserId(id)
}
use std::fmt;
struct Point {
x: i32,
y: i32,
}
[package]
name = "my-app"
version = "0.1.0"
[dependencies]
tokio = "1"
use once_cell::sync::Lazy;
use regex::Regex;
static EMAIL_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"^[^ @]+@[^ @]+.[^ @]+$").unwrap()
});
use tracing::{info, instrument};
#[instrument]
fn process_request(user_id: u64) {
info!(user_id, "Processing request");
// Work happens here
use tokio::time::{sleep, Duration};
#[tokio::main]
async fn main() {
let fast = sleep(Duration::from_millis(50));
let slow = sleep(Duration::from_millis(200));
use std::pin::Pin;
use std::future::Future;
async fn example() {
println!("Example future");
}
macro_rules! create_function {
($func_name:ident) => {
fn $func_name() {
println!("Called {}", stringify!($func_name));
}
};
struct Locked;
struct Unlocked;
struct Door<State> {
_state: std::marker::PhantomData<State>,
}
pub struct Server {
host: String,
port: u16,
workers: usize,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct UserId(u32);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct PostId(u32);
use rayon::prelude::*;
fn main() {
let numbers: Vec<_> = (0..1000).collect();
let sum: i32 = numbers