Live-coding a Rust crate for asynchronous SSH connections

Profile Picture
Published on Mar 17, 2018🌏 Public

Let's build a Rust crate that provides asynchronous SSH connections! The ultimate goal is to use this in the EC2 crate we've been live-coding (https://www.youtube.com/playlist?list...), but this video (and the crate we're building) is fairly independent of that. We're doing a deep-dive into futures (0.1) and tokio (pre-tokio reform) by implementing AsyncRead and AsyncWrite for multiple channels multiplexed onto a single thrussh (https://docs.rs/thrussh/) SSH connection. This video is intended for users who are already somewhat familiar with Rust, but who want to see something larger and more involved be built. You can see earlier related videos (on the EC2 crate) in this playlist: https://www.youtube.com/playlist?list.... If you enjoyed this, go follow me on Twitter, or on Patreon at https://www.patreon.com/jonhoo to see announcements for new videos! Given that we didn't finish the crate in this video, there will be at least one more on coding it up, plus one where we weave it into the EC2 crate we built previously. Some useful chunking points: - First: recap + setting up target example code - Starting implementation: 31:58 - AsyncRead works! Exit status handling: 3:19:22 - Implicitly driving backing connection: 3:36:03 - Propagating errors from spawned future: 4:57:52 - Starting implementation of AsyncWrite 5:02:24 The code is available here: https://github.com/jonhoo/async-ssh