Crate stdio

source ·
Expand description

This crate creates the abstraction of stdio. They are essentially ring buffer of bytes. It also creates the queue for KeyEvent, which allows applications to have direct access to keyboard events.

Structs

  • A reader to keyevent ring buffer.
  • A writer to keyevent ring buffer.
  • A structure that allows applications to access keyboard events directly. When it gets instantiated, it takes the reader of the KeyEventQueue away from the shell, or whichever entity previously owned the queue. When it goes out of the scope, the taken reader will be automatically returned back to the shell or the original owner in its Drop routine.
  • A ring buffer with an EOF mark.
  • A ring buffer containing bytes. It forms stdin, stdout and stderr. The two Arcs actually point to the same ring buffer. It is designed to prevent interleaved reading but at the same time allow writing to the ring buffer while the reader is holding its lock, and vice versa.
  • StdioReadGuard acts like MutexGuard, it locks the underlying ring buffer during its lifetime, and provides reading methods to the ring buffer. The lock will be automatically released on dropping of this structure.
  • A reader to stdio buffers.
  • StdioReadGuard acts like MutexGuard, it locks the underlying ring buffer during its lifetime, and provides writing methods to the ring buffer. The lock will be automatically released on dropping of this structure.
  • A writer to stdio buffers.

Type Aliases

  • A reference to a ring buffer with an EOF mark with mutex protection.