Debugging a Rust Crate/Library in VS Code

Recently, I have been learning a new programming language. I know, if you follow this really non-existant blog you would know that this is something that I do often. This time it is Rust. If you have not heard of Rust, it is a system programming language that would be in a similar space as C, only a much more modern design and is focused on memory safety and concurrency. Most of the time I get into a language and read about it a bit, then do a few hello world examples and move on. Rust on the other hand has stuck with me a little longer and I have been working on a “scratch my own itch” project with it. More on Rust itself in a future post.

Rust has a library system as many modern programming languages do and they call them Crates and are registered at http://crates.io. I have been in the process of authoring a crate called PJLink that is a Rust API to control projectors or displays that understand the PJLink protocol. The API is growing and I have been getting to points in development where old school print line debugging was just very inefficient and wanted to use the debugging features built into Visual Studio Code.  Code has very good support for programming Rust thought the integration of the Rust Language Server and debugging using  lldb inside of VS Code.

Continue reading