Today, we are announcing sanstun: a sans-IO Rust implementation of the WireGuard® state machine, optimized for ease of use, security and performance through a parallel-friendly and idiomatic API.

sans-IO is the idea that you design your system such that IO and side-effects are cleanly separated from the state and "business logic". The IO in sans-IO doesn't just mean file or network IO. It also includes things like time and randomness!

Due to their lack of side-effects, sans-IO components compose very well and are relatively easy to test. The design also avoids problems like function coloring and plays well with Rust's ownership rules.

The code examples and references in this post are in Rust but sans-IO isn't Rust-specific at all. Its patterns and ideas can be applied in any language. For a more in-depth explanation, our sans-IO post is a good place to start.