tokio-borrow-stdio 0.1.0

Temporarily expose standard input and output to a Tokio core.
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented0 out of 3 items with examples
  • Size
  • Source code size: 23.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.25 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 41s Average build duration of successful builds.
  • all releases: 41s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • pkgw/stund
    53 9 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • pkgw

tokio-borrow-stdio

“Borrow” the standard input/output streams temporarily, exposing them to a Tokio core as nonblocking streams.

There are several crates implementing this general class of functionality:

Why yet another one? The key is in the name — this is the only crate that temporarily takes over stdin/stdout. This makes it possible for the stund CLI client to temporarily start up an asynchronous Tokio core when necessary, but otherwise use traditional blocking I/O for most of its user interactions.

This crate only works on Unix-like operating systems. (The program for which it was developed, stund, uses things like pseudo-TTYs and Unix domain sockets, so there is no expectation of ever porting it to other kinds of OS.)