a Rust implementation of