blog | sven kanoldt

sharing thoughts on learning rust, open source projects and other tech stuff

What is the matter with `AsRef`?

the AsRef trait is everywhere in the std lib and very handy. However, the benefit using it is maybe not too obvious. But read on, and you will see some useful examples and where to apply it.

Read more ⟶

rust macro rules in practice

Rust has a very strong and typed macro system. First it sounds all overwhelming, but it's easier than you think. Let me illustrate how easy on 2 simple examples from a practical project.

Read more ⟶

super simple disk benchmark written in rust

Today I've discovered simple disk benchmark written in C and I wanted to give a very minimal version of it a try in rust. Let's explore the new crate and command line tool ssd-benchmark and discover how simple it actually is to benchmark a disk.

Read more ⟶

lifetimes made easy

Rust lifetimes have the reputation to be very complicated, hard to use and even harder to understand. With this little article the entry barrier should be lowered and clarity should shine among the curious reader.

Read more ⟶

little rust starter hint series: polymorphism and traits

Rust is not an OOP language, but there are still ways to implement polymorphism and interfaces in rust. Here we going to explore how traits can be used to introduce interface semantics in Rust on a little hexdump tool.

Read more ⟶